Commit Graph

167 Commits

Author SHA1 Message Date
Uwe Hermann 1c2d542df2 demo: Use std_dev_clear(). 2013-06-02 16:57:07 +02:00
Uwe Hermann 3b412e3a30 s/clear_instances/dev_clear/.
Consistently use the same name for the dev_clear() API callback
everywhere.
2013-06-02 16:56:41 +02:00
Uwe Hermann f6beaac55c std: Drop hw_ from function names.
The per-driver API calls no longer have a hw_ prefix (e.g. hw_init()
became init() and so on), so drop the 'hw_' from the std versions
for those API callbacks too.
2013-06-02 16:46:18 +02:00
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 decfe89d4e Drop some lines that are no longer needed. 2013-05-10 18:30:32 +02:00
Uwe Hermann 2a052cc4d6 Use consistent naming for internal libtool helper libs.
This now also matches what the 'new-driver' tool generates.
2013-05-10 17:44:01 +02:00
Uwe Hermann 9e165e742f Use consistent HW_ name prefixes everywhere.
Older drivers used LA_* previously, we now use HW_* everywhere though.
2013-05-10 17:18:42 +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
Uwe Hermann 50985c2019 GPL headers: Use correct project name. 2013-04-23 22:24:30 +02:00
Bert Vermeulen bd6fbf628a drivers: return SR_ERR_NA on unsupported config key
Fixes bug 89.
2013-04-16 11:00:55 +02:00
Uwe Hermann e45ad6e24f demo: Fix compiler warning, cosmetics. 2013-04-15 12:27:55 +02:00
Joel Holdsworth 2150a69b76 demo: Unref the IO channel when it is no longer used 2013-04-14 23:39:15 +02:00
Joel Holdsworth ed20a42803 demo: Free dev_contexts 2013-04-14 23:39:15 +02:00
Joel Holdsworth a76842947f demo: Moved demo configuration variables into dev_context 2013-04-14 23:39:15 +02:00
Joel Holdsworth 33ef757383 demo: Keep a pointer to dev_context in sr_dev_inst and vice-versa 2013-04-14 23:39:15 +02:00
Joel Holdsworth e053204700 demo: Only one GIOChannel is needed 2013-04-14 23:39:15 +02:00
Joel Holdsworth bbd7ef0f18 demo: Fixed glitching in increment signal 2013-04-14 23:39:15 +02:00
Bert Vermeulen d00088ca6d demo: Adjust to GVariant-based sr_config_* functions 2013-04-11 18:32:06 +02:00
Bert Vermeulen 2474d87e8c demo: sync get/set options 2013-03-03 21:21:08 +01:00
Uwe Hermann 3e9b7f9c77 Rename session_dev_id to cb_data everywhere.
We use 'cb_data' in all drivers these days, make the few remaining ones
that use 'session_dev_id' consistent.
2013-02-07 11:26:02 +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 d3b38ad389 Drivers: Explicitly list sr_samplerates fields.
This makes it a bit easier to understand which value means what, just
from looking at the driver code.
2013-01-29 12:56:02 +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 9a6517d14b Deprecate SR_DI_HWCAPS.
This is replaced by SR_CONF_DEVICE_OPTIONS.
2013-01-25 15:01:49 +01:00
Bert Vermeulen dd96ea9879 Deprecate SR_DI_PATTERNS.
This is replaced by SR_CONF_PATTERN_MODE.
2013-01-25 03:38:44 +01:00
Bert Vermeulen 123e131383 Deprecate SR_DI_CUR_SAMPLERATE.
This is replaced by SR_CONF_SAMPLERATE.
2013-01-25 03:17:36 +01:00
Bert Vermeulen fbec8bd2f3 deprecate SR_DI_SAMPLERATES
This is replaced by a call to config_list() with id SR_CONF_SAMPLERATE.
2013-01-25 02:39:58 +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 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
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
Uwe Hermann 35e199da50 Fix limit_samples check in various drivers.
Check whether a sample limit was actually set (> 0) before checking if
that sample limit is reached. This also fixes continuous acquisition mode
for drivers which have that.
2012-12-26 02:11:00 +01:00
Uwe Hermann 7869340103 Shorten probe_names[] arrays everywhere.
Also, NULL-terminate all of them.
2012-12-26 00:16:07 +01:00
Uwe Hermann a873c5940c Consistently use 'di' as variable name.
Use 'di' consistently in all drivers as the name for a local, static
pointer to the respective driver's 'struct sr_dev_driver'.
2012-12-18 00:52:39 +01:00
Peter Stuge 1ebe4b4e69 hw_init(): Save struct sr_context * parameter in struct drv_context 2012-12-03 12:07:40 +01:00
Peter Stuge 34f06b903e Add a struct sr_context * parameter to hw_init() 2012-12-03 12:07:40 +01:00
Uwe Hermann eebb606762 demo: Add missing dev_clear() API call. 2012-12-02 17:21:13 +01:00
Alexandru Gagniuc 3b20367381 demo: Do not use a separate thread for generating data
We already have an event-based mechanism in place. Using a thread just
adds unneeded complexity, especially for a driver designed not for
performance, but for providing a testbed to frontends.
Generate the data in the event handler, not in a separate thread.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-02 16:08:03 +01:00
Alexandru Gagniuc c216d62307 demo: Properly stop acquisition after reaching our sample quota
The demo driver was using sr_session_source_add_channel() to add
a poll source, but was relying on sr_session_run_poll() to call
sr_session_source_remove(). This, coupled with the design of the
driver caused errors once the samples were collected.

The error stream was most likely related to failing to properly close
one of the channels.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-01 22:00:16 +01:00
Alexandru Gagniuc 49145a63c7 demo: Be more verbose about starting/stopping acquisition
This is the first step in fixing the demo driver: figuring out what is
being called and what is not _and_ have it show up in the logs.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-01 22:00:15 +01:00
Uwe Hermann de6e0eca95 sigma/la8/demo: s/SR_PROBE_ANALOG/SR_PROBE_LOGIC/. 2012-11-11 19:40:14 +01:00
Uwe Hermann 64d33dc28e All drivers: Drop unneeded comments. 2012-11-11 18:09:11 +01:00
Uwe Hermann 92bcedf6e8 demo: Use message logging helpers. 2012-11-10 19:42:37 +01:00
Bert Vermeulen 69b07d14db allow for intermediate stage in stopping acquisition
In the case of USB drivers, a driver's dev_acquisition_stop() cannot
simply remove its fd sources from the session and close its devices:
a USB transfer might still be underway, and it needs to be finished
(and its memory freed) properly.

An sr_dev_inst->status value is added: SR_ST_STOPPING, which should
be set when the driver's dev_acquisition_stop() is called, and acts
as a marker for the USB event handler to wind up its operations.

In order for dev_acquisition_stop() to be able to set the sdi status,
however, it needs to be unconstified.
2012-11-06 15:16:22 +01:00
Uwe Hermann 886a52b6fb Return SR_ERR_MALLOC upon allocation errors.
Add some TODOs.
2012-10-30 20:25:54 +01:00