Commit Graph

28 Commits

Author SHA1 Message Date
Bert Vermeulen f6a0ac9f62 rigol-ds1xx2: Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:07 +02:00
Uwe Hermann 333bf022e3 rigol-ds1xx2: Use ARRAY_SIZE. 2013-03-23 14:14:58 +01:00
Uwe Hermann 6fab7b8f53 Driver struct cleanups.
- Explicitly list .config_get in all drivers for consistency, and set it
   to NULL if unused (whether or not a driver implements it is optional).

 - List all 'struct sr_dev_driver' entries in the same order in all drivers.

 - Move the check whether .config_set/.config_list exist (i.e., are non-NULL)
   into sanity_check_all_drivers().
2013-02-07 10:58:35 +01:00
Uwe Hermann 4afdfd4628 Add and use std_session_send_df_header().
This is a small helper function which sends the SR_DF_HEADER packet that
drivers usually emit in their hw_dev_acquisition_start() API callback.
It simplifies and shortens the hw_dev_acquisition_start() functions
quite a bit.

It also simplifies the input modules which send an SR_DF_HEADER packet, too.

This patch also automatically removes some unneeded malloc/free in some
drivers for the 'packet' and 'header' structs used for SR_DF_HEADER.
2013-02-07 10:46:28 +01:00
Uwe Hermann 0e94d524c1 Shorten/simplify hw_dev_list() implementations. 2013-02-05 18:27:05 +01:00
Uwe Hermann 063e7aef6d Factor out common hw_init() driver code.
Most drivers do pretty much the same things in their hw_init()
right now, so factor out that code to std_hw_init() in std.c.
2013-01-29 12:56:02 +01:00
Uwe Hermann 4b97c74e0b sr_driver_scan(): Improve checks.
Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.

Also, do some minor whitespace and consistency improvements.
2013-01-29 12:56:02 +01:00
Uwe Hermann c0eea11c45 sr_driver_init(): Improve checks.
Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.

Also, change one SR_ERR to the more correct SR_ERR_MALLOC, and assign
sr_ctx in the rigol-ds1xx2's hw_init() function, like all the other
drivers do.
2013-01-29 12:56:02 +01:00
Bert Vermeulen 6a4710fac2 drivers: Trim unused config_get() calls
None of the driver config_get/set/list calls are required.
2013-01-25 16:05:48 +01:00
Bert Vermeulen 9a6517d14b Deprecate SR_DI_HWCAPS.
This is replaced by SR_CONF_DEVICE_OPTIONS.
2013-01-25 15:01:49 +01:00
Bert Vermeulen 328bafabd4 Deprecate SR_DI_TRIGGER_SOURCES.
This is replaced by SR_CONF_TRIGGER_SOURCE.
2013-01-25 11:25:32 +01:00
Bert Vermeulen 41f5bd09b0 Deprecate SR_DI_TIMEBASES.
This is replaced by SR_CONF_TIMEBASE.
2013-01-25 11:22:20 +01:00
Bert Vermeulen e4f2b2adc1 Deprecate SR_DI_VDIVS.
This is replaced by SR_CONF_VDIV.
2013-01-25 11:13:49 +01:00
Bert Vermeulen 2a7b113d13 Deprecate SR_DI_COUPLING.
This is replaced by SR_CONF_COUPLING.
2013-01-25 11:04:27 +01:00
Bert Vermeulen a1c743fc51 drivers: implement config_list() 2013-01-25 02:37:26 +01:00
Bert Vermeulen 035a1078fd drivers: rename and reorganize config get/set
The driver API calls info_get() and dev_config_set() have been renamed
to config_get() and config_set(), respectively.
2013-01-24 19:19:09 +01:00
Bert Vermeulen 69e19dd769 Always interleave analog data with all enabled probes.
The new "probes" field in sr_datafeed_analog contains a copy
of all enabled struct sr_probe.
2013-01-23 03:40:44 +01:00
Bert Vermeulen 1953564a96 Rename SR_HWOPT_* and SR_HWCAP_* to SR_CONF_* 2013-01-21 23:32:50 +01:00
Bert Vermeulen 1987b8d63e drivers: use new sr_config struct
Sending an SR_DF_META packet at the start of every stream is not
mandatory; the frontend should ask for what it needs, and any extra
information the driver wants to send will come in due time.
2013-01-21 23:32:49 +01:00
Uwe Hermann 4ebd48b352 Remove non-error hw_info_get() messages.
Currently hw_info_get() can receive requests for entries (info_id) that
the specific driver doesn't support. That is (right now) a valid
use-case and not an error (might change later, though).

Thus, for now, don't output messages for such requests at all (certainly
not as sr_err() where they show up in e.g. sigrok-cli output per default).
2013-01-20 18:48:02 +01:00
Bert Vermeulen 6b8d6f93bb Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES.
Frontends should use the probe list in the device's sr_dev_inst
to get this information.
2013-01-15 17:42:23 +01:00
Bert Vermeulen 512bb890df rigol-ds1xx2: More selective Rigol DS1xx2 scan
Patch submitted by Martin Ling.
2013-01-13 22:42:21 +01:00
Uwe Hermann 29d957ceae rigol-ds1xx2: Cosmetics, whitespace. 2013-01-03 19:04:11 +01:00
Martin Ling fb6e5ba8c7 rigol-ds1xx2: Autoprobe for usbtmc devices on Linux. 2013-01-03 18:41:29 +01:00
Martin Ling 4e108ace13 rigol-ds1xx2: Fix setting trigger parameters. 2013-01-03 18:41:29 +01:00
Martin Ling 542843f76f rigol-ds1xx2: Assorted parameter setting fixes. 2013-01-03 18:41:29 +01:00
Martin Ling e0b7d23ce8 rigol-ds1xx2: First working version.
Currently hardcoded to use /dev/usbtmc1. Analog data readout works.
2013-01-03 18:41:29 +01:00
Martin Ling f4816ac6cc rigol-ds1xx2: Initial driver skeleton. 2013-01-03 18:41:28 +01:00