Commit Graph

162 Commits

Author SHA1 Message Date
Frank Stettner 522381a343 Add device type SR_CONF_MULTIPLEXER. 2021-04-24 16:47:06 +02:00
Gerhard Sittig 1a7adeac29 serial: extend stream detect for variable length packet checkers
The previous implementation of the packet detection in a serial stream
assumed that all packets are of equal length which is known in advance.
Extend the packet validity check interface such that caller provided
callbacks can either decide that the input is valid or invalid (terminal
decision), or request more receive data before a decision can be made
(deferral, coverring variable length packets, with a minimum size to
cover the header before a length becomes available and the total packet
length is known).

This commit extends the API, and adjusts the call sites to not break the
compilation. Actual variable length checkers are yet to be done. Improve
readability while we are here: Better reflect the purpose and units of
variables in their identifiers. Tweak diagnostics messages, update
inline and doxygen comments.
2020-10-22 21:25:02 +02:00
Timo Kokkonen 34ce5b0439 hwdriver: New entries for DC Load "CW" (Power) and "CR" (Resitance) modes.
Added following new entries:
	- SR_CONF_POWER
	- SR_CONF_POWER_TARGET
	- SR_CONF_RESISTANCE_TARGET
2020-10-06 22:02:20 +02:00
Timo Kokkonen 63eec38073 hwdriver: Add SR_CONF_DUTY_CYCLE & SR_CONF_PHASE. 2020-09-28 09:02:52 +02:00
Frank Stettner b54d9b4974 libsigrok.h: Fix comment for unit Joule. 2020-08-23 13:10:00 +02:00
Frank Stettner fe8c5aef1f libsigrok.h: Add Joule, Coulomb, and Ah units.
Also extend a comment on energy in comparison to power.
2020-08-22 21:53:56 +02:00
Frank Stettner 82ff704449 libsigrok.h: Add MQ for electric charge. 2020-08-22 21:53:56 +02:00
Gerhard Sittig d643e6bc39 hwdriver: introduce SR_CONF_FORCE_DETECT config key (scan option)
Often previously unsupported models might be covered by existing code,
but would not match against a builtin list of known devices.

Introduce a config key which provides a scan option for users to force
the use of a driver with an unsupported device. This increases the
probability of requests for support of an additional model which are
associated with a successful use of that very device, and eliminates
the necessity to build from source for the trivial cases.

It's up to individual drivers whether they support forced detection,
and how they interpret the value of the scan option.
2020-08-22 09:10:29 +02:00
Andreas Sandberg 0cc3d090b7 libsigrok.h: Add SR_MQ_ENERGY 2020-06-04 23:13:43 +02:00
Frank Stettner ccf68765aa Add config key SR_CONF_DIGITS. 2019-12-20 13:02:06 +01:00
Frank Stettner 84b4f9a1ff Add config key SR_CONF_RANGE. 2019-12-20 13:02:06 +01:00
Uwe Hermann ea9e7a3e82 config keys: Revert re-orderings to avoid ABI changes. 2019-07-30 23:53:42 +02:00
Guido Trentalancia 97a000748a hameg-hmo: Add SR_CONF_HIGH_RESOLUTION and SR_CONF_PEAK_DETECTION.
Implement High Resolution mode and Peak Detection settings.

Beautify the code by reordering the Trigger Source settings
definitions.
2019-07-26 01:43:19 +02:00
Guido Trentalancia 4fa4db2c79 hameg-hmo: Add SR_CONF_TRIGGER_PATTERN support.
Introduce support for the Pattern Trigger functionality, sometimes also
called Logic Trigger.
2019-07-26 00:11:07 +02:00
Guido Trentalancia e131be0ac3 hameg-hmo: Add support for SR_CONF_LOGIC_THRESHOLD/_CUSTOM.
Update the Hameg/Rohde&Schwarz HMO driver (hameg-hmo) so that it
is possible to configure the logic threshold for digital signals.

The user can get or set the logic threshold configuration using
the channel group POD0 (and/or POD1 where available), for example:

sigrok-cli --driver hameg-hmo --get logic_threshold -g POD0
sigrok-cli --driver hameg-hmo --config logic_threshold=TTL --set -g POD0

sigrok-cli --driver hameg-hmo --get logic_threshold_custom -g POD0
sigrok-cli --driver hameg-hmo --config logic_threshold_custom=0.7 --set -g POD0
2019-07-26 00:11:07 +02:00
Frank Stettner 43ff1110fb scpi-pps: Add SR_CONF_REGULATION for HP 66xxB power supplies. 2019-04-17 17:11:21 +02:00
Frank Stettner 78ec6cf99d Add new config key OFFSET. 2019-03-29 16:15:37 +01:00
Uwe Hermann 3bae09ab9f Make sr_packet_{copy,free} API calls public.
This fixes bug #1277.
2018-09-18 23:39:56 +02:00
Gerhard Sittig b736fa0c7d proto.h: move routine declaration to its respective group 2018-09-03 22:22:40 +02:00
Uwe Hermann ee425a466a Add a new sr_log_callback_get() API call. 2018-08-30 19:11:30 +02:00
Andrej Valek bc294eaca8 Add SR_CONF_EXTERNAL_CLOCK_SOURCE key.
Signed-off-by: Andrej Valek <andy@skyrain.eu>
2018-06-05 22:01:12 +02:00
Frank Stettner 21ef355e50 strutil: Locale independent sprintf() and vsprintf() functions 2018-06-01 15:46:17 +02:00
Gerhard Sittig c83bdde9da input: provide accessor routine for (struct sr_input *)->module
Add a public API routine which allows applications to query the
sr_input_module from an sr_input.
2018-05-17 22:31:27 +02:00
Uwe Hermann 3601d50e26 libsigrok.h: Fix multiple compiler warnings (-Wshift-overflow=2).
../include/libsigrok/libsigrok.h:653:19: warning: result of ‘1 << 31’ requires 33 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=]
    SR_CONF_GET = (1 << 31),
                     ^~

[...]
2018-05-16 23:57:58 +02:00
Soeren Apel addb7340dd Introduce sr_resourcepaths_get()
This provides an interface to fix #1128.
2018-03-18 18:25:36 +01:00
Uwe Hermann 187c300b59 libsigrok.h: Fix SR_CONF_UNDER_VOLTAGE_CONDITION_THRESHOLD order.
This has to be the last entry in its "category", otherwise it'll mean an
ABI breakage.
2018-03-03 19:25:57 +01:00
Frank Stettner 3d70d77709 arachnid-labs-re-load-pro: Add SR_CONF_UNDER_VOLTAGE_THRESHOLD. 2018-03-03 19:10:51 +01:00
Uwe Hermann d9b716fc5f Use UINT64_C instead of "ULL" number suffix.
Avoid hardcoding a "ULL" number suffix, use the more portable and more
correct UINT64_C.
2018-02-20 20:03:21 +01:00
Frank Stettner 79034d4f39 strutil: Locale independent snprintf() and vsnprintf() functions 2018-02-11 23:15:39 +01:00
Uwe Hermann 31bdc10ec2 Add SR_CONF_POWERMETER. 2017-07-19 15:40:41 +02:00
Soeren Apel 6ad2fbaad2 Introduce A2L methods
The memory allocation for sr_datafeed_logic is broken, the memory
will never be freed. #994 is used to handle this issue.
2017-07-06 00:16:24 +02:00
Uwe Hermann 42be2adb5a Add APIs to query libsigrok build information. 2017-05-26 18:00:58 +02:00
Gerhard Sittig fe3004f5a0 minor nit, fixup whitespace in libsigrok.h 2017-05-05 18:25:10 +02:00
Soeren Apel 6984cfb245 Rework sr_period_string 2017-03-07 17:13:46 +01:00
Uwe Hermann 6928c4a928 Add SR_CONF_SIGNAL_GENERATOR. 2017-03-02 15:17:53 +01:00
Aurelien Jacobs 841aadc95b libsigrok.h: Add SR_MQ_HARMONIC_RATIO. 2017-01-22 19:03:29 +01:00
Aurelien Jacobs 5728718b66 analog: use SI prefix only with units that accept SI prefixes 2016-10-17 02:24:53 +02:00
Aurelien Jacobs cdc311957b analog: use correct unit for dBm/dBV 2016-10-17 02:09:18 +02:00
Aurelien Jacobs 962172e495 analog: improve output readability by using SI prefix 2016-08-29 00:25:19 +02:00
Aurelien Jacobs 96117c5660 document encoding.digits and spec.spec_digits 2016-08-23 12:58:06 +02:00
Aurelien Jacobs 28c95cc6c4 analog: add support for negative number of digits
When a meter display 105.2 kΩ, libsigrok will return 105200 Ω
but it is really valuable to know that the last 2 digits are not
significant, so encoding.digits should be set to -2.
This would allow a sigrok client to display 105200 as 105.2 k
instead of 105.200 k.
2016-06-26 20:32:56 +02:00
Aurelien Jacobs 9ea62f2e0a rigol-ds: add support for getting/setting trigger level. 2016-06-25 18:19:47 +02:00
Uwe Hermann 24f4a9d50b session: Drop SR_DF_ANALOG_OLD support completely.
This closes bug #728.
2016-06-17 15:13:12 +02:00
Stefan Brüns 17d5a11c69 analog: Implement division for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns ee1b6054d6 analog: Implement multiplication for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns bdba362695 analog: Add equality check for sr_rational 2016-05-16 23:35:10 +02:00
Stefan Brüns 5ec172d7e9 strutil: add method to get an sr_rational from a string
The method accepts strings with numbers in scientific or normal notation,
e.g. -1.25 or 3.37e-6. The numeric range is limited by the sr_rational
range, i.e +-9.2e18, resolution is ~19 digits.
2016-05-16 23:35:10 +02:00
Soeren Apel b6b4f03e40 Input: Add reset() function 2016-05-09 13:02:29 +02:00
Uwe Hermann 695dc859c1 dev_acquisition_{start,stop}(): Drop duplicate 'cb_data' parameter.
These are always 'sdi', which is passed in already.
2016-04-29 19:20:53 +02:00
Alexandru Gagniuc 6d5cd3bd38 analog: Add MQ Flag for four-wire measurements
On the high-end bench multimeters, resistance can be measured with a
kelvin connection as well as the more common two wire method. Provide
a flag which can indicate if four-wire mode is used.
2016-04-23 17:44:26 +02:00