Commit Graph

63 Commits

Author SHA1 Message Date
Martin Ling d72b0cc898 Remove orphaned prototype for sr_filter_channels from proto.h. 2014-04-25 18:15:19 +02:00
Bert Vermeulen dba3e6826e output: Introduce output module API wrappers. 2014-04-21 01:50:43 +02:00
Uwe Hermann fca75cbb74 A few more random 'probe' to 'channel' changes.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann f3ca73edd2 Rename a few more API calls with 'probe' in their name.
This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 53b4680fce Consistently use 'cg' for channel group variables.
This matches how we consistently use sdi, devc, and so on all over
the code-base.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Uwe Hermann 660e398fe9 Replace 'probe group' with 'channel group' everywhere.
The name 'probe' (and thus 'probe group') is a relic from the times when
sigrok was mostly about logic analyzers. Nowadays we support a lot more
device types where 'probe' is not really a good term and 'channel' is
much better suited.

This fixes parts of bug #259.
2014-03-25 20:58:54 +01:00
Daniel Elstner 2a854d7139 hwdriver: Introduce sr_config_commit() API call.
(sr_dev_driver.config_probe_set): New optional callback enabling
drivers to be notified upon changes to probe settings.
(sr_dev_probe_enable, sr_dev_trigger_set): Invoke new driver
callback on changes.
(sr_dev_driver.config_commit): New optional callback allowing
drivers to defer application of configuration settings until
an explicit call to config_commit().
(sr_config_commit): New public wrapper function.
2014-01-20 14:16:32 +01:00
Bert Vermeulen a769b9f357 Add sr_session_save_init().
This allows a frontend to initialize a session file, providing the
required samplerate and probe names, without having a proper
struct sr_dev_inst handy.

sr_session_append() is then used to add captured data to the session
file, as usual.

The existing sr_session_save() function works the same way as always.
2014-01-07 12:55:02 +01:00
Uwe Hermann a582788653 Fix a few #include guard names. 2013-12-17 17:45:18 +01:00
Uwe Hermann 8d558c7a9f strutil.c: Don't expose sr_atox() as API calls for now. 2013-12-03 17:16:59 +01:00
poljar (Damir Jelić) 9e4f8cf93b strutil: Add helper functions: string to number.
This patch adds helper functions for converting a string to different number
formats (double, long, float, int).

These functions are exposed in the public API.
2013-12-03 15:10:00 +01:00
Martin Ling 8f996b8948 probe_groups: API changes required to implement probe groups. 2013-11-08 01:03:16 +01:00
Bert Vermeulen f438e0c923 Add sr_session_append(): add captured data to an existing session file
This extends the session file format to contain logic data files named
either "logic-1" as before, or "logic-1-1", "logic-1-2", ...
representing chronologically ordered chunks of captured data.

The chunks are transparently concatenated together by sr_session_load().
2013-09-18 13:28:07 +02:00
Matt Ranostay c542391f82 proto: Add missing prototype in proto.h
Add missing prototype sr_session_dev_list that was
breaking the Pulseview build.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
2013-09-04 10:17:09 +02:00
Bert Vermeulen f6eb2cb555 Make sr_session_iteration() private 2013-07-18 15:06:37 +02:00
Bert Vermeulen b483be7456 Add sr_session_iteration() API function 2013-07-16 16:08:38 +02:00
Bert Vermeulen efdecf4c05 Add sr_dev_open()/sr_dev_close()
Frontends will be required to open a device before using
sr_config_set() or starting acquisition.
2013-04-24 22:02:34 +02:00
Uwe Hermann 50985c2019 GPL headers: Use correct project name. 2013-04-23 22:24:30 +02:00
Bert Vermeulen f99e32affc sr_dev_inst_*() -> sr_dev_*() 2013-04-22 15:55:06 +02:00
Martin Ling 2726474a61 Add a void *cb_data parameter to datafeed callbacks. 2013-04-16 11:13:18 +02:00
Bert Vermeulen e0e150672a sr_voltage_string(): deprecate struct sr_rational 2013-04-11 18:32:07 +02:00
Bert Vermeulen 76e107d68c sr_parse_(period|voltage): deprecate struct sr_rational 2013-04-11 18:32:07 +02:00
Bert Vermeulen bc1c2f001a Use GVariant for sr_config_*() functions
sr_config_get() provides a GVariant owned by the caller, so it must be
released with g_variant_unref() when done.

sr_config_set() takes a GVariant from the caller which may be floating;
it will be properly sunk and release after use by this function. Thus
the output of g_variant_new_*() may be used as an argument.

sr_config_list() also provides a GVariant owned by the caller, to be
unreferenced when done.

sr_config_make() can take a floating reference.
2013-04-11 18:32:06 +02:00
Bert Vermeulen 13d8e03c4f Bump copyright year 2013-04-11 18:32:06 +02:00
Uwe Hermann a819da9c25 Drop deprecated sr_session_halt().
This has been deprecated in favor of sr_session_stop() since a while.

None of the current frontends use sr_session_halt() anymore, neither
does libsigrok.
2013-03-03 18:02:24 +01:00
Joel Holdsworth 4c961f5ed5 Made sr_config_list driver argument a const pointer 2013-01-28 20:26:37 +00:00
Joel Holdsworth 9fd504b9eb Made sr_config_get driver argument a const pointer 2013-01-28 20:25:56 +00:00
Bert Vermeulen cbadb856d6 Code cleanup. 2013-01-26 01:18:19 +01:00
Bert Vermeulen 41bad9283d Remove sr_driver_hwcap_exists(). 2013-01-25 20:41:49 +01:00
Bert Vermeulen 4d15e5c907 Rename sr_dev_has_hwcap() to sr_dev_has_option(). 2013-01-25 16:20:40 +01:00
Bert Vermeulen ddd9b41f5a Rename sr_info_get() to sr_config_get(). 2013-01-25 15:48:44 +01:00
Bert Vermeulen 358d050d7a Rename sr_dev_config_set() to sr_config_set() 2013-01-25 15:38:57 +01:00
Bert Vermeulen c5fb502f97 New driver API function: config_list()
This takes an sr_config key and returns a list of possible values for
that key to be submitted with config_set(). The format of the list and
its contents is dependent on the key.

This will replace the SR_DI_* keys that returned such a list before,
such as SR_DI_SAMPLERATES.
2013-01-25 01:24:42 +01:00
Bert Vermeulen c89c1c9c21 Unify all SR_HWOPT_* and SR_HWCAP_* enums.
Only two functions remain for accessing meta info on the keys:
sr_config_info_get() and sr_config_info_name_get().
2013-01-21 23:32:49 +01:00
Bert Vermeulen 72e435ab94 Adjust option helpers to new sr_config struct 2013-01-21 23:32:49 +01:00
Bert Vermeulen 18bc270461 sr_session_save(): don't use datastore 2013-01-08 14:14:44 +01:00
Bert Vermeulen 6936ee4206 remove datastore functionality
Keeping a copy of acquired data is up to the frontend, not libsigrok.
2013-01-08 14:14:44 +01:00
Bert Vermeulen 305de92e9d use a dynamically expanding probe list 2013-01-08 14:14:44 +01:00
Joel Holdsworth bf53457d1d Pass sr_datafeed_packets and payloads with const pointers
This patch marks packet structures and their payloads as const.
This indicates to packet receivers that modifications to these are
not allowed. In general all pointers should be marked const unless
modification of the referenced data is explicitly allowed.
2012-12-20 07:51:21 +00:00
Peter Stuge 44fc870c9c Add a struct sr_context * parameter to sr_driver_init()
Since the public API is changed, this commit also bumps the libtool
version component SR_LIB_VERSION_CURRENT in configure.ac.
2012-12-03 12:07:40 +01:00
Uwe Hermann 393fb9cb18 Doxygen: Add @file items for the relevant files.
These short descriptions are shown in the "Files" section of the
Doxygen output.
2012-10-22 11:56:18 +02:00
Peter Stuge b8072700c1 Add a struct sr_context * parameter to sr_init() and sr_exit() 2012-10-21 20:23:14 +02:00
Joel Holdsworth 4cc9aea15b sr: Refactored sr_samplerate_string into a more general function: sr_si_string_u64 2012-09-03 13:53:09 +02:00
Bert Vermeulen 811deee4af sr/drivers: add API calls sr_dev_inst_list() and sr_dev_inst_clear()
These are used to list the device instances currently known to the driver,
and clear that list.

Drivers that don't necessarily clear their list of instances on every scan,
such as genericdmm, need to provide these to the frontend to keep instance
management sane.
2012-08-06 00:59:25 +02:00
Bert Vermeulen a56f148094 sr: new API call sr_dev_config_set()
This is a wrapper around the driver dev_config_set() call, to avoid
frontends needing visibility into drivers.
2012-08-05 15:53:04 +02:00
Bert Vermeulen 15cb43d67c sr: replace published static option data with API calls
To find a driver or device option by name,  the sr_drvopt_name_get() and
sr_devopt_name_get() calls are now available. This was the only reason the
driver and device struct sr_hwcap_option arrays were published.
2012-08-05 03:18:07 +02:00
Bert Vermeulen 3cf91809a5 sr: rename sr_hw_hwcap_get() to sr_devopt_get() 2012-08-04 14:35:40 +02:00
Bert Vermeulen 48a486cd3e sr: code organization cleanup
Device-specific functions (public and private) go in device.c,
more general driver-related code in hwdriver.c
2012-08-03 11:29:00 +02:00
Bert Vermeulen 056be0719f sr: sr_session_save() now takes sdi and datastore parameters
This means it's restricted to saving one device's capture per file, for
now.
2012-08-03 11:28:59 +02:00
Bert Vermeulen 37e8b4c4f7 sr: change sr_dev_probe_name_set() to use sdi 2012-08-03 11:28:59 +02:00