Commit Graph

134 Commits

Author SHA1 Message Date
Uwe Hermann e437da2b86 Add sr_dev_inst_channels_get() and sr_dev_inst_channel_groups_get(). 2014-11-11 11:59:23 +01: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 99d090d8e5 Fix typos. 2014-10-18 23:21:37 +02:00
Janne Huttunen c7c8994c20 Rename "SERIAL" -> "SERIES".
Use the more correct term "SERIES" for the corresponding equivalent
circuit model.
2014-10-17 12:13:51 +02:00
Soeren Apel 0157fdce99 Provide getters for sr_dev_inst member access 2014-10-17 03:02:52 +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
Uwe Hermann b9a348f56c Rename SR_CONF_LCR_METER to SR_CONF_LCRMETER.
(to be consistent with some other key names)
2014-10-13 11:39:15 +02:00
Janne Huttunen 0f5b241ec9 Add config key for output frequency.
Add a config key for getting/setting the output frequency. The value
will be an uint64 and measured in hertz.
2014-10-12 23:18:02 +02:00
Janne Huttunen 0ffce50d44 Add config key for LCR meter type.
Add a config key that can be used to indicate that the device is
an LCR meter.
2014-10-12 23:18:02 +02:00
Janne Huttunen ae27f28165 Add two new 'auto' flags.
Add flags for indicating that the meter has selected the measured
quantitiy and/or the used measurement model automatically. These
are similar to the existing auto-range flag.
2014-10-12 23:18:02 +02:00
Janne Huttunen 23601f2c7e Add quantity and flag for difference measurements.
Add 'SR_MQ_DIFFERENCE' quantity for reporting relative difference
between the current measurement and the reference value. The value
of this quantity will normally be reported in percents. Add also
the flag 'SR_MQFLAG_REFERENCE' for indicating that the reported
value is not the current measurement but the reference value instead.
2014-10-12 23:18:02 +02:00
Janne Huttunen 87d8124577 Add measured quantities for LCR meters.
Add parallel and serial model inductance, capacitance and resistance
for LCR meter measurements. Add also secondary quantities many LCR
meters calculate, namely dissipation factor, quality factor and phase
angle.
2014-10-12 23:18:02 +02:00
Janne Huttunen 01789adc72 Add two new units.
Add degrees and henrys to the list of supported units. Degree is
an unit of plane angle where one degree is 1/360th of a full circle.
Henry is the SI unit of inductance.
2014-10-12 23:18:02 +02:00
Bert Vermeulen d5cc282ff8 input: sr_input_free() is now a void function.
Its backend, input_module.cleanup(), is now also a void function.
2014-09-30 01:49:58 +02:00
Bert Vermeulen 7066fd4660 input: Add sr_input_end().
This signifies to the module instance no more input will come. This
will cause the module to process any data it may have buffered. The
SR_DF_END packet will also typically be sent at this time.
2014-09-30 01:49:58 +02:00
Soeren Apel 1b9e567b08 Removal of sdi->index, step 1: remove it from headers and helper funcs 2014-09-30 01:42:58 +02:00
Soeren Apel 2fe6210af6 Add serial_num and connection_id fields to sr_dev_inst 2014-09-24 00:40:03 +02:00
Bert Vermeulen 5827f61b64 Publish config key capabilities.
Every driver now publishes its device option config keys, i.e. the
list fetched with sr_config_list(SR_CONF_DEVICE_OPTIONS), with a
set of flags indicating which methods are implemented by the driver
for that key.

The config keys are OR'ed with any combination of SR_CONF_GET,
SR_CONF_SET and SR_CONF_LIST. These are defined as the high bits
of the uint32_t config key. Clients can OR config keys with
SR_CONF_MASK to strip out these bits. This mask will be kept up to
date if other bits are added to the capabilities list; clients MUST
therefore use SR_CONF_MASK for this.

Some keys don't have capability bits added, such as the informative
device type keys (SR_CONF_MULTIMETER, SR_CONF_OSCILLOSCOPE, ...) and
SR_CONF_CONTINUOUS.

Scan options do not have capabilities bits.
2014-09-17 15:36:11 +02:00
Bert Vermeulen 584560f142 Change type of SR_CONF keys to uint32_t. 2014-09-16 21:22:41 +02:00
Bert Vermeulen 379d260965 Add private storage pointer to struct sr_channel. 2014-09-08 12:45:21 +02:00
Bert Vermeulen a1eaa9e066 Revamp PPS-related config keys. 2014-09-08 12:45:21 +02:00
Bert Vermeulen 4f979115a4 input: sr_input_scan_*() now return a status code.
SR_OK: a match was found.
SR_ERR: no match.
SR_ERR_DATA: a match was found but the module cannot handle the input.
SR_OK_CONTINUE: some module didn't have enough data to be sure.
2014-08-28 00:22:13 +02:00
Bert Vermeulen b7f446051c Add SR_ERR_DATA. 2014-08-28 00:19:21 +02:00
Bert Vermeulen 3e2cd21115 Add second positive status code: SR_OK_CONTINUE.
Errors are thus always < 0, SR_OK == 0, and "OK but..." status
codes are > 0.
2014-08-26 01:55:41 +02:00
Bert Vermeulen bd0bfaafd8 input: Actually return a NULL-terminated array. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 20e8882106 input: Frontends don't need to see SR_INPUT_META_*. 2014-08-26 01:55:41 +02:00
Bert Vermeulen 17bfaca62a input: Introduce new input module API.
This is a work in progress.
2014-08-26 01:55:41 +02:00
Bert Vermeulen d514d35dab input: make sr_input{_module} opaque to clients. 2014-08-26 01:55:41 +02:00
Bert Vermeulen d4c937749a input: s/format/module in all naming. 2014-08-26 01:55:41 +02:00
Bert Vermeulen fc74643098 output: Actually return a NULL-terminated array.
This returned an array of structs with an NULL-ed element at the end.
The drivers still do this, but the wrappers now make and free a NULL-
terminated array around it.

sr_output_options_free() now takes the pointer returned by
sr_output_options_get(), instead of the module owning it.
2014-08-15 20:23:52 +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 a755b0e122 output: Finish output module API wrappers.
The sr_output and sr_output_module structs are now no longer accessible
from the client.
2014-07-26 03:57:17 +02:00
Martin Ling 00ebcbf48a Change prototype of sr_trigger_new to take const char *. 2014-07-17 18:39:17 +01:00
Martin Ling 63d0fb7528 Move public headers into include/libsigrok.
This is needed so that the C++ bindings, the header for which
references "libsigrok/libsigrok.h", can have a valid include
directory passed to build them before the headers are installed.
2014-07-17 18:30:49 +01:00