Commit Graph

51 Commits

Author SHA1 Message Date
Uwe Hermann 988357ca2f transform: Add a basic set of API calls. 2015-02-11 12:23:02 +01:00
Uwe Hermann 790320f605 transform: Add struct sr_transform and struct sr_transform_module. 2015-02-11 12:23:02 +01:00
Uwe Hermann 4fb0a5f8a0 in/out: Minor consistency renames.
- 'struct sr_input *' variables are consistently named 'in'.
 - 'struct sr_input_module *' variables are consistently named 'imod'.

 - 'struct sr_output *' variables are consistently named 'o'.
 - 'struct sr_output_module *' variables are consistently named 'omod'.
2015-01-27 18:05:30 +01:00
Joel Holdsworth 8a174d2342 output: Added preferred file extension field
This fixes parts of bug #541.
2015-01-27 18:05:29 +01:00
Joel Holdsworth c7bc82ffa1 input: Added preferred file extension field
This fixes parts of bug #541.
2015-01-27 18:05:25 +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
Aurelien Jacobs 24287ea9e3 Add a public API to list available serial ports. 2015-01-03 17:51:51 +01:00
Bert Vermeulen 90cefe0cc7 Add sr_rational_set() convenience function. 2014-11-23 17:48:29 +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
Martin Ling a24da9a813 Make sr_analog_*_to_string() functions allocate the necessary buffers. 2014-11-19 17:34:19 +01:00
Bert Vermeulen a5892391b0 Add analog helper sr_analog_unit_to_string(). 2014-11-18 01:16:27 +01:00
Bert Vermeulen c2a25ebb8f Add analog helper sr_analog_float_to_string(). 2014-11-18 01:15:41 +01:00
Bert Vermeulen fb019a0e4d Add sr_analog_to_float(). 2014-11-13 22:51:39 +01:00
Bert Vermeulen d2e0f58539 Add SR_DF_ANALOG2 and related structs.
New structs:
 - sr_rational
 - sr_datafeed_analog2
 - sr_analog_encoding
 - sr_analog_meaning
 - sr_analog_spec
2014-11-13 22:35:54 +01:00
Uwe Hermann e705ce3bf6 Add sr_dev_inst_user_new(), sr_dev_inst_channel_add(). 2014-11-11 22:16:12 +01:00
Uwe Hermann 2f5f97056a Constify the sdi parameter of all sr_dev_inst_*() getters. 2014-11-11 12:44:37 +01:00
Uwe Hermann 96727ef016 Make 'struct sr_dev_inst' opaque. 2014-11-11 12:24:08 +01:00
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