Commit Graph

5532 Commits

Author SHA1 Message Date
Frank Stettner 522381a343 Add device type SR_CONF_MULTIPLEXER. 2021-04-24 16:47:06 +02:00
Soeren Apel 004fd9ffd3 Amend #119 to use vector instead of tuple
This way, we don't need to bump glibmm to 2.54, which we otherwise would
2021-03-28 23:17:17 +02:00
Gerhard Sittig 955ab60455 kingst-la2016: address trivial style nits (whitespace, braces, line length)
Improve readability by addressing the trivial style nits in the driver.

Break the channel list into two times eight instead of nine plus seven
items. Put braces around all branches if one of them has braces. Add
braces to multi line branches despite most of the branch just being a
comment -- it's still many lines. Break extra long text lines, adjust
the position of operators when single expressions span multiple lines.

Drop unnecessary parentheses around single variables and auto
incrementing pointer dereferences. Adjust whitespace especially for
pointer data types, and arith operators.
2021-03-16 21:40:32 +01:00
Helge Kruse c3d4003710 kingst-la2016: Eliminate non-portable packed structs for USB transfer layout
Eliminate packed structs in the construction and in the reception of
USB transfers, since these are rather non-portable. Use common support
for endianess aware access to byte streams instead. This unbreaks the
driver for MinGW builds, and increases portability and maintainability
on all other sigrok supported platforms.

[ gsi: adjust more locations, improve robustness, fixup style, reword message ]
2021-03-16 21:27:24 +01:00
Helge Kruse d9a74e97f4 kingst-la2016: Use common code to send trigger and frame boundary packets
[ gsi: adjust more locations, reword commit message ]
2021-03-16 21:26:35 +01:00
Gerhard Sittig 8f87c5284b tests: extend endianess conversion tests to also cover the 48bit writer
Cover the recently added writer for 48bit little endian data. Prepare a
large bytes pattern buffer that can also serve for future 64bit tests.
2021-03-16 21:26:35 +01:00
Gerhard Sittig 797c8d9034 libsigrok-internal.h: add 48bit endianess aware byte stream helpers 2021-03-16 21:26:35 +01:00
Helge Kruse 40a0b2f466 kingst-la2016: Upload firmware to correct USB configuration 1
The ezusb_upload_firmware() routine opens the USB device and selects the
current configuration. The specified value must match the previously read
configuration descriptor. This commit unbreaks the firmware download for
MinGW builds which link against libusb-1.0.20-rc3-event-abstraction-v4.

[ gsi: reworded commit message ]
2021-03-16 21:25:56 +01:00
Frank Stettner 051d85f28d korad-kaxxxxp: Add support for Korad KD3005P V2.1 2021-03-16 21:04:20 +01:00
Petteri Aimonen 2111d1574b scpi-dmm: Add support for Owon XDM2041 2021-03-06 19:04:32 +01:00
Petteri Aimonen ddeaa49d43 scpi-dmm: Gracefully handle meters that lack OPC command.
The SCPI standard requires OPeration Complete command,
but some Owon meters do not implement it. This commit
makes the probe try OPC once, and if it gets no reply
it assumes it is not supported.
2021-03-06 19:04:19 +01:00
Petteri Aimonen 33306b13ac scpi-dmm: Add infinity limit to model-specific config.
Owon multimeters seem otherwise compatible with gwinstek reader,
except infinity is only 1e9.
2021-03-06 19:04:14 +01:00
Petteri Aimonen 5433907ed9 scpi-pps: Add support for Owon P4000 series.
Tested on P4603 firmware version 1.6.0.
2021-02-28 15:25:21 +02:00
litospain 389acdd991 hantek-6xxx: Add ISDS205B support 2021-02-21 23:26:20 +01:00
waka f5c618e55f hantek-6xxx: Fix for channel coupling not updating on changing
Presumed regression related to fix for bug #836
2021-02-21 23:20:22 +01:00
Florian Ragwitz b41562f6ce zketech-ebd-usb: Don't ignore errors 2021-02-21 23:05:32 +01:00
Florian Ragwitz a99ff45359 beaglelogic: Fix resource leak 2021-02-21 23:05:27 +01:00
Alberto Scotta fe185e4990 hantek-dso: fix 100MS/s
Do not downsample at 100MS/s.
The device actually sampled at (100.0/0x1000)MS/s when 100MS/s was set.
2021-02-21 23:01:58 +01:00
HReimann 0f5dcee6ce rigol-ds: Add DS1102Z-E model variant 2021-02-21 22:55:00 +01:00
Richard Allen a2916ad017 python bindings: Support passing in rational voltages for config_set 2021-02-21 22:21:17 +01:00
Richard Allen 1145ceaa78 gwinstek-gpd: Fix voltage/current measurement 2021-02-21 21:46:08 +01:00
Richard Allen c93c014f47 gwinstek-gpd: Support auto-baud detection
If the user does not specify a serialcomm configuration,
try all three options from the manual.
2021-02-21 21:46:08 +01:00
Richard Allen c329b788d2 gwinstek-gpd: Retry device identification on failure
Try the identification command up to three times
if the device responds with 'Invalid Character.',
which can happen if the device has buffered part
of a command but not executed it.
2021-02-21 21:41:18 +01:00
Richard Allen 10fd326dea gwinstek-gpd: Print serialcomm config 2021-02-21 21:41:18 +01:00
Gerhard Sittig 1c5d5905a4 scpi-pps: add R&S HMP2000 model specs
Re-use HMP4000 options and channel groups, only keep separate channel
specs for HMP2000 devices. HMP2030 has three identical 32V/5A channels.
HMP2020 has one 10A channel and one 5A channel.
2021-02-02 21:09:54 +01:00
Gerhard Sittig 7320ce5ecc scpi-pps: adjust R&S HMP4000 current resolution for 10A channels
Specs published by R&S suggest that 10A channels support 0.2mA resolution,
while only 5A channels resolve to 0.1mA (up to 1A full scale, 1mA above 1A).
2021-02-02 21:07:29 +01:00
v1ne 3cc9e21573 ols: Clean up: Replace hand-rolled byte order conversion with existing macros 2021-01-06 10:45:28 +01:00
v1ne f8fd84208d ols: Refactor: Extract trigger setup into private place
This copies the code verbatim from one place to another in preparation to adding
support for complex triggers.
2021-01-06 10:45:28 +01:00
v1ne 50b15953fe ols: Make external clock setting queriable
... and thus selectable in PulseView.
2021-01-06 10:45:28 +01:00
v1ne f20c39d933 ols: Add option to use the falling edge of the external clock 2021-01-06 10:45:28 +01:00
v1ne c36a7d84ca ols: Clear "disabled groups" flags before setting them
This fixes a bug where the channel group setting would not be overwritten in a
new run, but instead the channel group settings of both runs would be merged
together.
2021-01-06 10:45:28 +01:00
v1ne 29f15d52cb ols: Display actual expanded sample instead of the raw sample
While the raw sample is the actual received data, the expanded sample is the
crucial data I as a developer am interested in seeing. At least if I assume that
the sample expansion works.
2021-01-06 10:45:28 +01:00
v1ne aad6b9de5f ols: Clean up: Prefix private function for consistency 2021-01-06 10:45:28 +01:00
Gerhard Sittig ba1fb5e926 doc: update README.devices for Meterman 38XR (RS232 button) 2021-01-05 18:17:45 +01:00
Peter Skarpetis 4c29bba1f0 dmm/mm38xr: introduce DMM packet parser for Meterman 38XR
Introduce a DMM packet parser in src/dmm/ and register it with the
serial-dmm device driver. This adds support for the Meterman 38XR
multimeter.

[ gsi: style adjustment, raise awareness during maintenance ]
2021-01-05 08:13:23 +01:00
Gerhard Sittig 3fa436bb48 serial-dmm: move Mastek items after Metex in the model database
Keep the alpha-sort order in the list of supported chips and models.
2021-01-05 08:10:21 +01:00
Frank Stettner 8fb9afcacd arachnid-labs-re-load-pro: Fix for get voltage and current while in acquisition.
[ gsi: moved intruction order to unify with other cond signalling code paths ]
2021-01-04 16:02:00 +01:00
Gerhard Sittig f93bf8ba02 dmm/bm52x: unbreak build when serial comm is not available
Make another code path in the Brymen BM52x packet parser optional which
snuck in earlier and broke compilation when serial_comm dependencies are
not met.

Ideally the src/dmm/ parser code would not get built at all in that
case, but building a parser with reduced functionality and not using it
later because its callers are conditional is as good, and is what other
DMM packet parsers did in the past.

How to reproduce:

  $ configure --without-libserialport --without-libhidapi --without-libbluez
  $ make
2020-12-29 18:31:38 +01:00
Ralf 6065d660e0 fx2lafw: Unbreak SR_CONF_LIMIT_SAMPLES for large values (above 2**32)
Capture does not stop for sample count values which exceed the range of
a 32bit type variable. Adjust the data type to 64bit.

How to reproduce: 8MSa/s * 600s -> 4,800,000,000 samples

  $ sigrok-cli -d fx2lafw -o capture.sr --config samplerate=8M --time 600000

[ gsi: rephrased the commit message ]
2020-12-25 13:02:07 +01:00
Gerhard Sittig aa8e4959e2 ftdi-la: work around missing USB strings during device probe
Some FTDI chip based products ship with EEPROM content which makes
libftdi fail to lookup the USB strings, which breaks the scan for the
device's presence. The previous implementation was strict and only
accepted the absence of a serial number. This implementation also copes
when vendor and model cannot be gathered from the device, and provides
fallback values based on VID:PID numbers.

Also factor out a magic number for string lengths. Stick with dynamic
allocation since 3x 32bytes would be rather huge a local stack use, and
future maintenance might bump that string length again.

[ gsi: magic number in one spot, bounded string assignment, style nits ]

Submitted-By: Christo Crause <christo.crause@gmail.com>
2020-12-25 12:47:01 +01:00
Niklas Thorne d7ce5452ac asix-sigma: parse serial numbers as unsigned values
This unbreaks device detection on 32bit platforms.
2020-11-28 08:01:31 +01:00
Niklas Thorne 30903c4043 strutil: introduce sr_atoul_base() conversion helper (non-decimal)
Introduce a text to number conversion routine which supports non-decimal
bases and optional suffixes, but returns unsigned results and thus covers
a larger range of values. This kind of amends commit 97aa41e9b5 which
introduced the sr_atol_base() routine.
2020-11-17 17:51:02 +01:00
Gerhard Sittig 3decd3b1f0 driver_list: unbreak list of builtin drivers for LTO configurations
Check for the availability of the "no_reorder" linker attribute, which
keeps the list of builtin drivers in shape on LTO enabled build setups.
Keep backwards compatibility for platforms which lack support for the
"no_reorder" attribute. Phrase the implementation such that other
keywords as well as user provided external specs are possible.

This resolves bug #1433.

Submitted-By: Ivan Mironov <mironov.ivan@gmail.com>
2020-11-05 05:20:42 +01:00
Gerhard Sittig efce57da32 libsigrok-internal.h: add u64be endianess writer
Add endianess aware writer for uint64_t data in BE format. This is
motivated by the Codethink Interrogizer.
2020-10-26 19:50:33 +01:00
Gerhard Sittig 6bee394dee serial-dmm: add support for the Brymen BM820s family
The BM820s series uses the same 10000 counts protocol as BM520s does,
but lacks the capability of recording measurements. Re-use the bm52x
DMM packet parser, but don't register the config get/set/list and
acquisition start callbacks.

It turns out that the packet request and packet validity check routines
need to be individual, since 0x82 is used instead of 0x52 as a magic
number in some places. Fortunately the complex payload parser is shared
among BM520s and BM820s series. This was tested with a BM829s meter.
2020-10-22 21:25:34 +02:00
Gerhard Sittig 0931639a12 dmm/bm52x: add support for recorded measurements (memory data sets)
Extend the BM52x packet parser, add config get/set/list code to handle
the data source property. Either let the common serial-dmm code run the
acquisition of live readings, or locally retrieve the selected "session
page" and forward its measurements to the session bus. These separate
code paths are required because the protocol differs a lot between these
modes, a totally different set of requests and responses is involved,
response interpretation logic is impossible to share between live and
recorded measurements.
2020-10-22 21:25:34 +02:00
Gerhard Sittig 9a1a7dc283 brymen-dmm: remove obsolete driver (support has moved to serial-dmm)
The DMM support for Brymen BM850s has moved to src/dmm/ and became
part of the serial-dmm driver. Remove the now obsolete brymen-dmm/
source code.
2020-10-22 21:25:34 +02:00
Gerhard Sittig 27186edacf dmm/bm85x: introduce DMM packet parser for Brymen BM850(a/s)
Implement a DMM packet parser for the BM850s protocol. This involves
variable length responses, which recently became a common serial-dmm
feature. Register the new parser under the "brymen-bm85x" device name.
This obsoletes the brymen-dmm driver which announces as "brymen-bm857".
This implementation was tested with the BM859s meter.

The text to number conversion with precision detection resolves the
last remaining issue of bug #1611.
2020-10-22 21:25:34 +02:00
Gerhard Sittig 91ab2f6475 strutil: add text to float conversion which also gets precision from text
Provide a common string helper routine which converts input text to a
double precision floating point number, and also gets its precision in
the process.
2020-10-22 21:25:34 +02:00
Gerhard Sittig 070668a0fd serial-dmm: more DMM parser callbacks (open, var length, config, start)
Extend the serial-dmm driver's common infrastructure to support more
per-parser (per-model) specific extensions. Add support for variable
length packets (motivated by BM85x), and pass the packet length to
parsers which accept it. Add callbacks which run after the COM port got
opened (motivated by BM85x). Add support for additional configuration
get/set/list properties (motivated by BM52x), including a hook into the
acquisition start and a state container which is owned by the parser.

Device specific acquisition start can check its local state which can
store the result of previous config get/set requests, and can arrange
for a different receive routine to execute (motivated by BM52x). The
default code path will execute serial-dmm's receive routine which keeps
invoking the DMM's packet parser for each registered display.

Prefer double precision values in the new parser callbacks. Also fixup
some data type issues: Use unsigned types for length and size specs as
well as timeouts, don't promote false booleans to NULL pointers, reduce
malloc() argument redundancy. Rephrase some instruction grouping and
update comments to simplify future maintenance. Get the current time
just once for improved consistency in the packet re-request code path.
Rename identifiers in the data reception path to improve readability.
2020-10-22 21:25:34 +02:00