Commit Graph

5588 Commits

Author SHA1 Message Date
Gerhard Sittig 4b8348941d input/csv: trim surrounding whitespace from header line channel names
When CSV import grabs channel names from the first line in the file then
the text strictly between column separators (a comma) was used. Which
resulted in channel names like " channel 1". Trim leading and trailing
space before unquote, to better fulfill most users' expectation. Users
still can quote the input data for special cases if desired.
2021-04-25 12:51:33 +02:00
Gerhard Sittig 7a78fd56f7 rdtech-dps: research to reduce serial comm transfer volume again
The DPS devices default to a rather low UART communication bitrate. The
generous retrieval of more Modbus registers than strictly necessary for
the periodic acquisition of analog channel values and state tracking may
or may not be an issue.

Instrument all call sites in api.c to the device state gathering calls
such that the protocol.c side transparently can reduce the transfer
volume depending on which level of detail the caller may expect given
its current context. Under optimal circumstances this might cut the
traffic in half, which DPS devices may benefit from.

This commit adds the infrastructure to potentially reduce transfer
volume, but does not change behaviour. The "config" reasons may need
further partitioning if Modbus register access really turns out to be
a severe bottleneck. The API lends itself to that extension easily. The
approach which gets prepared in this commit needs to get runtime tested
by those who got access to the hardware.
2021-04-25 12:10:33 +02:00
Gerhard Sittig 884ae8c021 rdtech-dps: introduce support for RD6006 and other Riden RD models
The RD devices differ from DPS devices in their default communication
bitrate (115200), register content endianess (BE), and register set
layout (addresses for registers). In either case 16bit registers get
accessed by means of Modbus communication over a serial channel. The
interpretation of the registers' values mostly is the same as for DPS
devices once a register with the same meaning got identified. Device
identification includes a 32bit serial number which DPS devices appear
to not provide.

All other product features are the same, and map to identical sigrok
mechanisms. That's why re-using the rdtech-dps driver to add rdtech-rd
support is considered desirable. This implementation shares all code
"above" the raw register addressing and raw value interpretation. All
logical processing, configuration interface, state tracking and data
submission to the session feed, are shared among the different device
types.

Declare support for the RD6006, RD6012, and RD6018 models. Their specs
were taken from the 2020.12.2 instruction manual. The driver was tested
with an RD6006 device (firmware version 1.28). Unfortunately automatic
device detection is not possible or will not be reliable, which is why
users need to specify the respective model by picking one of the two
drivers. Within a driver variant the device identification and use of
the device are automatically dealt with.
2021-04-25 12:10:26 +02:00
Gerhard Sittig d7a4dad881 rdtech-dps: layer separation between API and protocol, style nits
The existing power supply driver for Riden DPS/DPH devices unfortunately
duplicated intimate details of modbus communication and register layout
including interpretation of raw register values across several source
files. Do separate the physical transport and the register layout and
register fields interpretation layers. This brings the driver in line
with the usual api.c and protocol.c arrangement of responsibilities, and
prepares the future addition of other similar devices.

Address a few style nits while we are here. Include <config.h> in all
source files, and alpha-sort include directives. Address minor data type
nits. Reduce indentation in code paths. Propagate more error codes.
Update comments which lagged behind the code, adjust grammer (eliminate
"actual" false friends). Eliminate a few magic numbers and redundancies,
switch to the more recent endianess aware byte stream reader API where
beneficial, to eliminate redundant offset math.

Other nits seem to have gone unnoticed before: The indices of all sigrok
channels were identical (all zero). Signed print formats were used for
unsigned data.

This implementation compiles, but wasn't runtime tested due to lack of
hardware. A rough estimate of transfer volume and transport throughput
suggests that the 10ms cycle time no longer can be kept, may end up
around 25ms (40 cycles per second). This can get avoided by adding more
code to tell the configuration requests, the acquisition start, and the
measurements grabbing during acquisition apart. It's assumed though that
the 10ms glib poll interval did not translate to such fast measurement
gathering. The firmware may typically provide data at lower rates anyway.

The generic source code may look overly complicated or redundant at
first glance, but compilers' generated code will greatly get optimized.
Simplified maintenance because of reduced cognitive load is considered
more important.
2021-04-25 12:10:22 +02:00
Frank Stettner 584269fd2f hp-59306a: Initial HP 59306A driver.
[ gsi: drop libgpib dependency, minor style adjustment ]
2021-04-25 12:04:10 +02:00
Frank Stettner 12e7abe219 hp-59306a: Initial driver skeleton. 2021-04-24 16:47:06 +02:00
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