Commit Graph

42 Commits

Author SHA1 Message Date
Bert Vermeulen 661cc2ec46 Convert SR_CONF_MEASURED_QUANTITY to SR_T_MQ. 2015-08-30 20:40:56 +02:00
Bert Vermeulen 75772c721d Change SR_T_MQLIST to SR_T_MQ.
The need to make this a list no longer applies.

SR_T_MQ is thus a type consisting of a tuple with two elements: the first
item is the MQ (type G_VARIANT_TYPE_UINT32), and the second is the MQ
flags value (G_VARIANT_TYPE_UINT64).
2015-08-30 20:40:56 +02:00
Uwe Hermann ca7dbb5616 Various key lists: Add reminders of what needs updates upon changes. 2015-08-28 16:32:14 +02:00
Uwe Hermann 29ae6f0880 hwdriver.c: Fix key order, add missing items. 2015-08-28 16:29:07 +02:00
Bert Vermeulen a1f7c854c5 Add SR_T_MQLIST.
This type consists of an array, with each item a two-member tuple,
representing an MQ/MQflags pair: the first item is the MQ (type
G_VARIANT_TYPE_UINT32), and the second is the MQ flags value
(G_VARIANT_TYPE_UINT64).

A GVariant of type SR_T_MQLIST can thus always represent more than
one MQ/MQflag pair.
2015-08-26 01:54:34 +02:00
Bert Vermeulen 0176c92fea Add key info tables for MQ and MQflags. 2015-08-26 01:54:34 +02:00
Bert Vermeulen 2fb60e2329 Replace sr_config_info with sr_key_info.
The tables defined with this struct can now be used for information
on items other than config keys.

Functions to access these tables have been renamed sr_key_info_[name_]get.
These take an extra argument, keytype, which should be set to SR_KEY_CONFIG
to get the config key tables. Other key types will be added.
2015-08-26 01:08:42 +02:00
Daniel Elstner c1aae90038 Build: Set local include directories in Makefile.am
Move the include flags for files in the source tree from
configure.ac to Makefile.am where they belong.  Also use
AM_CPPFLAGS instead of CFLAGS/CXXFLAGS to make sure the
files in the build/source tree are always picked up first.

Also, remove the include/libsigrok sub-directory from the
search path, thereby making the <libsigrok/> prefix mandatory
when building libsigrok itself.  This matches the convention
already imposed on users of the library.
2015-08-16 18:28:12 +02:00
Soeren Apel 41812aca43 Fix #442 by renaming sr_dev_driver.priv to .context 2015-07-10 01:22:15 +02:00
Aurelien Jacobs c4b7838922 libsigrok.h: Add SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE. 2015-06-07 20:15:07 +02:00
Aurelien Jacobs daa3901205 Add a modbus communication helper module. 2015-05-12 13:22:34 +02:00
Aurelien Jacobs 7a0b98b544 Rename SR_CONF_OUTPUT_* to SR_CONF_*.
All those options are currently applied only to power-supplies
but they could apply as well to electronic loads, except for the
fact that electronic loads channels are called inputs and not
outputs.
Also when you think about an SMU (or any kind of 4-quadrants
power-supply), their channels can both source and sink current,
so they can be considered as input as much as output.
Those SR_CONF_* are thus renamed so that they can be used in all
those situations.
2015-05-12 13:22:34 +02:00
Alexandru Gagniuc a77585d4ae global: Add configuration key for output frequency target
This will be used to set up the output frequency of AC sources.
2015-05-06 19:41:46 +02:00
Alexandru Gagniuc b94dd07b08 global: Treat SR_CONF_OUTPUT_FREQUENCY as float instead of uint64_t
This makes 'output_frequency' symmetrical with 'output_current' and
'output_voltage'. On a more fundamental level, there's no reason why
frequency should be treated as a discrete quantity, other than
"es51919 used it this way".
2015-05-06 10:25:16 -07:00
Uwe Hermann 032da34b78 sr_driver_list() now takes a context pointer.
This requires sr_hw_cleanup_all() and sanity_check_all_drivers()
to also take a context.

The (runtime) generation of the driver list now happens in sr_init()
and sr_driver_list() always returns that pre-generated list. This fixes
a segfault when (correctly) invoking multiple sr_init() and sr_exit()
calls with different contexts (caught by the unit tests).

This fixes bug #565.
2015-04-07 02:09:56 +02:00
Uwe Hermann dcd438ee35 Simplify a few config_set() callbacks.
Also, extended logging and random whitespace fixes.
2015-03-22 02:15:30 +01:00
Uwe Hermann 1a8639164e Minor cosmetics, cleanups. 2015-03-21 18:28:02 +01:00
Martin Ling 4f840ce965 Pass driver struct pointer to driver callbacks.
This lays the groundwork for subdrivers to share callbacks without
needing a separate wrapper function for each subdriver.
2015-03-21 13:09:40 +01:00
Martin Ling 9e60a31fb9 Construct driver array at runtime, from an array of per-file arrays.
This lays the groundwork for drivers to define their own array of
subdrivers, rather than having to list each subdriver here.
2015-03-21 13:09:39 +01:00
Martin Ling bf622e6d00 Rename SR_CONF_NUM_TIMEBASE to SR_CONF_NUM_HDIV. 2015-03-02 12:24:12 +01:00
Bartosz Golaszewski d3c81725ae SR_CONF_PROBE_FACTOR: New option.
Add new configuration option allowing to modify the probe factor
for oscilloscopes and power-monitors.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-02-16 01:20:07 +01:00
Bartosz Golaszewski 9ed444e622 new config options: averaging
Add new config options to libsigrok - 'averaging', which allows to
enable averaging of samples and 'avg_samples' for setting the number
of samples to be averaged over in each cycle.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2015-01-25 18:00:40 +01:00
Uwe Hermann 54ab1dcdc4 Add missing entries to sr_config_info_data[].
Newly added keys:

 - SR_CONF_SAMPLE_INTERVAL
 - SR_CONF_NUM_TIMEBASE
 - SR_CONF_NUM_VDIV
 - SR_CONF_CENTER_FREQUENCY
 - SR_CONF_DEVICE_MODE
 - SR_CONF_SCAN_OPTIONS
 - SR_CONF_DEVICE_OPTIONS
 - SR_CONF_DEVICE_MODE
 - SR_CONF_TEST_MODE

Also, keep the same ordering and grouping as in libsigrok.h.
2014-11-22 17:02:57 +01:00
Uwe Hermann 91219afc75 Use g_malloc0() consistently, simplify error handling.
Use g_malloc0() for small allocations and assume they always
succeed. Simplify error handling in a few places accordingly.

Don't always sanity-check parameters for non-public (SR_PRIV)
functions, we require the developers to invoke them correctly.
This allows further error handling simplifications.
2014-11-22 17:02:57 +01:00
Aurelien Jacobs 8a58419d37 Finish fixing broken sr_config_list() logic. 2014-11-19 17:34:19 +01:00
Bert Vermeulen db6fa867a4 Add debug spew to all sr_config_(get|set|list) calls. 2014-11-18 15:46:59 +01:00
Bert Vermeulen cf3db38193 Fix broken sr_config_list() logic. 2014-11-18 15:46:24 +01:00
Bert Vermeulen c6dde8125a Check driver capabilities before sr_config_get/set/list. 2014-11-17 13:20:32 +01:00
Bert Vermeulen adfba7368a Refactor scan options check. 2014-11-14 20:25:12 +01:00
Bert Vermeulen 071151b578 sr_driver_scan: Enforce options passed in by client. 2014-11-14 12:22:54 +01:00
Bert Vermeulen 6fad08e6ab Change SR_CONF_FILTER key to a boolean type.
This was an ill-defined string before, now it's simply something
you turn on or off on a channel.
2014-10-27 17:09:57 +01:00
Bert Vermeulen a700a3a4bf More robust searching for config keys. 2014-10-27 17:09:27 +01:00
Bert Vermeulen 51b1b95edb Add config info for device type and limit config keys. 2014-10-27 17:09:07 +01:00
Bert Vermeulen 61b0292217 Accept subtype of expected GVariant values. 2014-10-22 22:18:52 +02:00
Janne Huttunen a42a39ac37 Export LCR meter 'auto' bits as config keys instead of mqflags.
The automatic selections of the measured quantity and equivalent circuit
model are more part of the configuration of the meter than attributes
of the measurement result. To reflect this, model them as config keys
instead of mqflags. This allows a driver that supports remote control to
implement 'set' method for them and has the additional benefit of saveing
two flag bits.
2014-10-21 12:23:20 +02:00
Bert Vermeulen ae431bc8d6 Fix short names for SR_CONF_OUTPUT_VOLTAGE_TARGET/_CURRENT_LIMIT. 2014-10-16 13:22:51 +02:00
Bert Vermeulen ca95e90fb3 Use SR_CONF_OUTPUT_VOLTAGE_TARGET and _CURRENT_LIMIT.
These describe them better; the two are fundamentally different
things to set.
2014-10-15 12:03:00 +02:00
Bert Vermeulen 584560f142 Change type of SR_CONF keys to uint32_t. 2014-09-16 21:22:41 +02:00
Martin Ling 13fef1ed24 hwdriver: Validate types of GVariants passed by user. 2014-09-14 04:47:12 +01:00
Bert Vermeulen a1eaa9e066 Revamp PPS-related config keys. 2014-09-08 12:45:21 +02:00
Bert Vermeulen cff7d8d60d Add config key for amplitude.
This is intended for setting (or getting) the amplitude of a source
which doesn't really have an MQ associated with it, such as the demo
driver's analog channels.
2014-07-28 15:40:19 +02:00
Bert Vermeulen 155b680da4 Reorganize project tree. 2014-07-22 18:19:29 +02:00
Renamed from hwdriver.c (Browse further)