Commit Graph

50 Commits

Author SHA1 Message Date
Uwe Hermann 6078d2c996 Use consistent API callback function names.
This now matches what the 'new-driver' tool generates.
2013-05-10 20:01:37 +02:00
Uwe Hermann 29a27196a1 s/DRIVER_LOG_DOMAIN/LOG_PREFIX/.
This is more correct anyway, and also a bit shorter and more readable.
2013-05-03 21:59:32 +02:00
Bert Vermeulen e73ffd4238 Enforce open device before config_set()/dev_acquisition_start() 2013-04-24 22:03:50 +02:00
Bert Vermeulen 46a743c1fa Whitespace fixes
Damn editor.
2013-04-24 19:07:46 +02:00
Bert Vermeulen cc9fd2d29c rigol-ds1xx2: Code cleanup 2013-04-24 03:23:11 +02:00
Martin Ling 9bd4c95606 rigol-ds1xx2: Use common serial code. 2013-04-24 02:10:25 +02:00
Martin Ling ca55277ca8 rigol-ds1xx2: Accept SR_CONF_CONN. 2013-04-24 02:10:25 +02:00
Martin Ling e31d410d26 rigol-ds1xx2: fix delay time. 2013-04-21 20:42:22 +01:00
Martin Ling d2e0b1fa71 rigol-ds1xx2: better error handling in hw_scan. 2013-04-21 19:48:34 +01:00
Bert Vermeulen bd6fbf628a drivers: return SR_ERR_NA on unsupported config key
Fixes bug 89.
2013-04-16 11:00:55 +02:00
Bert Vermeulen a7be14ada2 rigol-ds1xx2: Don't assume there's a valid sdi 2013-04-15 18:45:38 +02:00
Martin Ling 6bb192bc05 rigol-ds1xx2: support digital channels. 2013-04-14 16:57:02 +02:00
Martin Ling a789b61087 rigol-ds1xx2: doesn't actually support SR_CONF_LIMIT_SAMPLES 2013-04-14 16:57:01 +02:00
Martin Ling ee7e9bee5d rigol-ds1xx2: fix handling of partial frames. 2013-04-14 16:57:01 +02:00
Bert Vermeulen 8f35be72b4 rigol-ds1xx2: Use g_usleep() for portability 2013-04-12 19:42:44 +02:00
Uwe Hermann 169dbe8577 rigol-ds1xx2: Whitespace, minor fix.
Return SR_ERR_MALLOC for failed malloc, not SR_ERR.
2013-04-12 18:44:28 +02:00
Bert Vermeulen 254dd102e8 rigol-ds1xx2: Support for all channels, proper defaults
Since this driver supports devices with a control panel and display,
we take the defaults from the device -- not a set of sensible
defaults as usual.
2013-04-11 18:32:08 +02:00
Bert Vermeulen 88e429c97f rigol-ds1xx2: fix channel numbers
Copyright bump, too.
2013-04-11 18:32:08 +02:00
Bert Vermeulen a3df166f02 rigol-ds1xx2: better debugging 2013-04-11 18:32:08 +02:00
Bert Vermeulen 75d8a4e576 rigol-ds1xx2: properly send frame begin/end packets 2013-04-11 18:32:08 +02:00
Bert Vermeulen d62d7ad151 rigol-ds1xx2: Support SR_CONF_NUM_TIMEBASE/SR_CONF_NUM_VDIV 2013-04-11 18:32:08 +02:00
Bert Vermeulen 861c447bfb rigol-ds1xx2: SR_CONF_TIMEBASE and _VDIVS lists are now an array of tuples 2013-04-11 18:32:08 +02:00
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