Commit Graph

313 Commits

Author SHA1 Message Date
Triss 012becda49 ikalogic-scanaquad: Initial driver skeleton. 2021-08-03 23:50:01 +02:00
Gerhard Sittig 64d54a719a dcttech-usbrelay: Initial driver skeleton. 2021-07-21 20:41:16 +02:00
Frank Stettner 12e7abe219 hp-59306a: Initial driver skeleton. 2021-04-24 16:47:06 +02: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 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
Soeren Apel a3fe36d01e configure: Add optional TI-RPC dependency, unbreak VXI communication.
Recent glibc-2.26 no longer provides support for SunRPC, and libsigrok's
build support failed to detect the presence of libtirpc in that case.

  https://wiki.gentoo.org/wiki/Glibc_2.26_porting_notes/RPC_implementation

Extend the check, use either SunRPC or TI-RPC. Which re-enables VXI on
recent setups. This resolves bug #1473.
2020-10-09 18:50:58 +02:00
Timo Kokkonen c16effaedc itech-it8500: Initial driver skeleton. 2020-10-06 22:02:20 +02:00
Timo Kokkonen 068db0fbe6 rigol-dg: Initial driver skeleton. 2020-09-28 09:03:37 +02:00
Gerhard Sittig 400bc4ffab dmm/bm52x: introduce support for Brymen BM525s
Introduce a bm52x DMM packet parser which is modelled after the bm86x
implementation, and hook it up to the serial-dmm driver. This supports
the live readings (real-time download) of the Brymen BM525s logging DMM.
The timing follows the vendor documentation (0.5s between requests, and
4.0s absolute timeout after request transmission). Reading previously
recorded data (memory data sets) unfortunately does not fit well into
the serial-dmm approach, and needs to get addressed differently later.
2020-09-19 12:52:41 +02:00
Gerhard Sittig d891892dc0 input/saleae: introduce input module for Saleae Logic exported files
Start the implementation of an input module which covers Saleae Logic's
export files. CSV and VCD are handled by other modules, this one accepts
binary exports for Logic1 digital data (every sample, and when changed),
Logic1 analog data, Logic2 digital data, and Logic2 analog data.

The newer file format versions contain header information and can get
auto-detected, the older formats require a user spec. Some of the file
formats lack essential information in the file content, thus require
another user spec (samplerate for digital data is an example).

The .logicdata file format is unknown, and is not supported. The .sal
format could get added later, but requires local file I/O in the input
module, which current common infrastructure does not provide.
2020-07-24 17:21:13 +02:00
Gerhard Sittig 47a102f9bb input: introduce helper for buffered submission of sample data
Input modules often find themselves in the situation where sample data
was received and could be sent to the session bus, but submission should
get deferred to reduce the number of send calls and provide larger data
chunks in these calls. Introduce common support code for buffered sample
data submission (both logic and analog), provide a simple alloc, submit,
flush, and free API.
2020-07-24 09:10:27 +02:00
Florian Schmidt f2cd2debf9 kingst-la2016: tested with idVendor=77a1, idProduct=01a2 2020-06-07 00:48:24 +02:00
Andreas Sandberg cae33a5874 rdtech-tc: Add initial support for the RDTech TC66C
This changeset adds support for the RDTech TC66C USB power meter.

Currently, the driver reports the following channels:
  * V: VBus voltage
  * I: VBus current
  * D+: D+ voltage
  * D-: D- voltage
  * E: Energy consumed in threshold-based recording mode.

The number of significant digits shown for each channel has been set
to match the number of digits shown on the device.

Usage example:

sigrok-cli -d rdtech-tc:conn=/dev/ttyACM0 --scan

Known issues:

  * BLE support is currently unimplemented. This uses a different
    command set, but the same poll data format.

Kudos to Ben V. Brown for reverse engineering some of the protocol and
documenting the encryption key used for poll data.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-05 00:25:26 +02:00
Andreas Sandberg 4ea012bdf5 crc: Factor out CRC16 implementation from Modbus
Being able to calculate a CRC16 is useful in multiple places, factor
this into a new module with CRC implementation. This module currently
only supports ANSI/Modbus/USB flavor of CRC16.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-05 00:25:26 +02:00
Andreas Sandberg 8b607a24e7 rdtech-um: Add initial support for the RDTech UMxx series
This changeset adds support for the RDTech UMxx series of USB power
meters. The driver has been tested with the RDTech UM24C, but should
support the UM24C, UM25C, and the UM34C.

Currently, the driver reports the following channels:
  * V: VBus voltage
  * I: VBus current
  * D+: D+ voltage
  * D-: D- voltage
  * T: Device temperature
  * E: Energy consumed in threshold-based recording mode.

The number of significant digits shown for each channel has been set
to match the number of digits shown on a UM24C.

Missing features:

  * There is currently no support for configuring threshold-based
    recording from sigrok, but this can be done on the device itself.

  * Fast charging mode currently not logged.

Usage example:

sigrok-cli -d rdtech-um:conn=bt/rfcomm/MAC --scan
sigrok-cli -d rdtech-um:conn=/dev/rfcomm0 --scan

Known issues:

  * When using sigrok's Bluetooth transport implementation, the device
    is disconnected between probing and sampling. Some devices (e.g.,
    the UM24C), dislikes this and can't be reconnected reliably for
    sampling. This is not an issue when setting up a rfcomm device
    manually and using it as a serial port.

Kudos to Sven Slootweg for documenting most of the protocol.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-05 00:25:26 +02:00
Andreas Sandberg 18698b40d1 binary_helpers: Add helper for devices with binary data
Many devices receive a struct with binary values when polled. Many of
these values will correspond channels in sigrok. This
change introduces helper functions for automatically reading and
scaling such values and sending them down a sigrok analog channel.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-06-05 00:07:30 +02:00
Gerhard Sittig 3094e9d8ca uni-t-ut181a: Initial driver skeleton. 2020-06-01 18:35:05 +02:00
Gerhard Sittig f2a9a7c2c8 tests: also cover endianess conversion helpers
Introduce a new tests/conv.c source file which exercises the endianess
conversion macros. It's assumed that some use cases may break their
operation, fortunately these edge cases were not seen before, or the
unreliable operation went unnoticed. This test raises awareness of the
implementation's constraints.

This is a start, the test sequence will benefit from adding some more
cases to increase coverage.
2020-05-29 06:09:47 +02:00
Uwe Hermann 4c660b46c1 Makefile.am: Add missing src/serial_hid.h. 2019-12-24 16:39:01 +01:00
Dave Buechi 23669c3df3 Initial support for MASTECH MS6514 thermometer 2019-12-22 15:32:51 +01:00
Marc Jacobi 40f812f5dc output/wavedrom: introduce a wavedrom output module
WaveDrom provides a textual description of digital timing diagrams,
using the JSON syntax. See https://wavedrom.com/ for more details.
2019-12-21 13:58:43 +01:00
Derek Hageman ebcd1aba01 Add support for the Mooshimeter DMM
This adds support for the Mooshim Engineering BLE based Mooshimeter.
Because the meter requires raw BLE packets, the driver uses the BLE
layer directly. Since the meter has no physical way of configuring it,
the actual configuration is set entirely with sigrok device options.
2019-10-22 12:21:47 +02:00
Gerhard Sittig b50970a541 lcr/vc4080: introduce LCR packet parser for Voltcraft 4080 (and PeakTech 2165)
Introduce the lcr/vc4080.c source file which implements the parser for
the serial data stream of the Voltcraft 4080 LCR meter. Add the meter to
the list of supported devices in the serial-lcr driver, as well as the
PeakTech 2165 LCR meter which is another compatible device.

This implementation contains a workaround for USB based serial cables
which seem to suffer from incomplete parity handling (observed with the
FT232R based PeakTech cable). Similar approaches were seen in existing
DMM drivers.

This implementation supports the main and secondary displays. The D and Q
"displays" which are communicated in the serial packets appear unreliable
and redundant, users can have the D and Q values shown in the supported
displays.
2019-07-31 22:40:44 +02:00
Gerhard Sittig e45a8de41c victor-dmm: remove obsolete device driver, has moved to serial-dmm
Remove the victor-dmm device driver. Its functionality is contained in
the Victor specific serial-over-HID transport, the FS9922 DMM parser,
and the serial-dmm device driver. The additional implementation became
obsolete.
2019-06-13 19:34:43 +02:00
Gerhard Sittig 0cdb72c8f2 serial-hid: add support for (scrambling) Victor DMM cables
Introduce a serial transport which undoes the Victor DMM cable's
obfuscation to the DMM chip's original data packet. Which allows to
re-use the existing FS9922 support code, obsoleting the victor-dmm
device driver.
2019-06-13 19:34:09 +02:00
Gerhard Sittig 97c8fa70da brymen-bm86x: retire libusb using driver, has moved to serial-dmm
Remove the src/hardware/brymen-bm86x/ hierarchy of source files. Its
functionality has moved to the bm86x packet parser and the serial-dmm
device driver.
2019-06-13 19:32:51 +02:00
Gerhard Sittig 0759e2f55b dmm/bm86x: add Brymen BM86x packet parser, register with serial-dmm
Move Brymen BM86x specific packet parse logic to a new src/dmm/bm86x.c
source file, and register the routines with the serial-dmm driver's list
of supported devices. Which obsoletes the src/hardware/brymen-bm86x/
hierarchy.

This implementation differs from the previous version: The parse routine
gets called multiple times after one DMM packet was received. Values for
the displays get extracted in separate invocations, the received packet
is considered read-only. Unsupported LCD segment combinations for digits
get logged. Low battery gets logged with higher severity -- the validity
of measurement values is uncertain after all. The parse routine uses
longer identifiers. Packet reception uses whichever serial transport is
available (need no longer be strictly USB HID nor libusb based). All
features of the previous implementation are believed to still be present
in this version.

This configuration queries measurement values each 0.5 seconds and
re-sends a not responded to request after 1.5 seconds. Which follows the
combination of the vendor's suggested flow (frequency) and the previous
implementation's timeout (3x 500ms). This implementation does not try to
re-connect to the HID device for each measurement, and neither checks
for the 4.0 seconds timeout (vendor's suggested flow). Local experiments
work without these.
2019-06-13 19:23:24 +02:00
Gerhard Sittig a10284cd18 serial-hid: introduce support for Brymen BU-86X IR adapters
The Brymen BU-86X infrared adapters are sold with BM869s meters. Raw
streams of data bytes get communicated by means of HID reports with
report number 0 and up to 8 data bytes each. Communication parameters
are fixed and need no configuration.
2019-06-13 18:33:23 +02:00
Gerhard Sittig bf5c4d46f8 serial-lcr: move device driver code from src/lcr/ to src/hardware/
Keep the ES51919 chip support in the src/lcr/ directory, and move device
driver specific code to the src/hardware/serial-lcr/ directory. Implement
the same driver layout for LCR meters as is used for DMM devices.

This also addresses a few issues in the serial-lcr driver: Unbreak --get
and --show, do process a few LCR packets after probing the device, to
gather current parameter values. Keep sending meta packets when these
parameters change during acquisition, like the previous implementation
did. Use common code for frame/time limits.

Note that although LCR meters usually operate with AC to classify L/C/R
components, one of the officially supported modes is DC resistance.
Which means that an output frequency of 0 is not just a fallback when
packet parsing fails, it's also a regular value of the freq parameter.
List all supported frequencies including DC in strict numerical order.

Although all currently supported devices use the same ES51919 chip, the
implementation is prepared to support other devices which use different
LCR meter chips as well. The list of known equivalent circuit models and
output frequencies is kept in src/lcr/ chip support. It's assumed that
one LCR packet communicates the data for all channels/displays similar
to the serial-dmm driver implementation.
2019-06-12 22:01:52 +02:00
Gerhard Sittig b79c342278 serial_bt: implement the serial over Bluetooth transport (conn=bt/...)
Introduce the serial_bt.c source file which implements the methods of a
serial transport and calls into the platform agnostic src/bt/ support
code.

Implement support for several chips and modules: RFCOMM (BT classic,
tested with HC-05), BLE122 (tested with 121GW), Nordic nRF51, and TI
CC254x (the latter untested). Read support is assumed to be complete,
write support for BLE may be incomplete due to lack of access to
hardware for tests.
2019-06-04 18:53:04 +02:00
Gerhard Sittig 7c8ae47dcb bluetooth: introduce Bluetooth communication API, implement BlueZ support
Create a src/bt/ subdirectory for source files. Declare a platform
agnostic internal API for Bluetooth communication, and provide an
implementation of that portable API when the BlueZ library is available.

This implementation assumes that HAVE_BLUETOOTH and HAVE_LIBBLUEZ can be
used interchangeably, which is true for this initial version. When
support for other platforms gets added, the common and the specific
parts need to get sorted. Trying that now would involve guessing. :)
2019-06-04 18:52:40 +02:00
Gerhard Sittig 616bc3a170 serial_hid: add support for the SiLabs CP2110 chip (UT-D09, UT612)
Also reported to be seen in Voltcraft devices (VC-650, VC-890).
2019-06-02 20:39:02 +02:00
Gerhard Sittig 828eeea227 serial_hid: add support for the WCH CH9325 chip (UT-D04 cables, UT32x) 2019-06-02 20:39:02 +02:00
Gerhard Sittig 4417074c68 serial: prepare serial over HID in common layer and build support
Search for the optional HIDAPI library. Call the library's init and exit
routine, and print version information. Extend the common serial layer's
code paths for open, list, and find USB to also support serial over HID.

This commit prepares serial over HID, but the HIDAPI specific transport
for serial communication still is empty in this implementation.
2019-06-02 20:39:02 +02:00
Gerhard Sittig ae4c1fb637 serial_libsp: move libserialport specific code to separate source file
Introduce a new serial_libsp.c source file, and move code from serial.c
there which is specific to libserialport. Keep the existing serial.c API
in place, this is a pure internal refactoring.

Adjust a little whitespace while we are here. Rearrange long lines to
keep related parameter groups adjacent (like pointer and size, or UART
frame length and flow control). Consistently reduce indentation of
continuation lines.
2019-06-02 20:39:02 +02:00
Uwe Hermann 3535a6eeee Fix an issue when building in directories that are symlinks.
Explicitly use SRCDIR and BUILDDIR in Doxyfile files to reference input
files. This seems to be a sufficient fix for an issue where the build
would fail when libsigrok/ was located in a directory that was a symlink.

This fixes bug #547.
2019-05-01 17:58:06 +02:00
Vitaliy Vorobyov dcd212f7a2 Add MASTECH MS2115B support. 2019-05-01 15:55:07 +02:00
Uwe Hermann 9e0693f92d sysclk-sla5032: Merge sla5032.[ch] into protocol.[ch]. 2019-04-24 18:18:57 +02:00
Vitaliy Vorobyov 8da8c8265f Add initial Sysclk SLA5032 driver. 2019-04-22 13:39:48 +02:00
Gerhard Sittig a5c0259c4a microchip-pickit2: Initial driver skeleton. 2018-12-20 16:19:42 +01:00
Gerhard Sittig 7a396ff5c5 scpi-dmm: Initial driver skeleton. 2018-11-10 20:11:35 +01:00
Gerhard Sittig 1c3098aae0 dmm/eev121gw: introduce parser for EEVblog 121GW 19-byte binary packets
Introduce the dmm/eev121gw.c source file with parse routines for the
EEVblog 121GW meter's 19-bytes binary packets. Get the values and MQ
properties of the device's several displays (main, sub, bar) in several
individual parse calls.

This commit introduces initial support for the device. Some of the modes
and features are untested, as are some of the device's ranges.
2018-10-14 18:21:56 +02:00
Gerhard Sittig bd10287e7c Makefile: cosmetics, alpha-sort src/dmm/ entries 2018-10-02 19:01:04 +02:00
Uwe Hermann 8a9788e2b7 ipdbg-la: Consistently use the same naming everywhere.
Use "ipdbg-la" everywhere to refer to the driver, including
in function name prefixes etc. There's no need to encode
website details (.org) into the driver/function name(s).
2018-08-30 00:11:51 +02:00
Eva Kissling a4210e1890 ipdbg-la: Add changes for IPDBG project 2018-08-29 23:59:10 +02:00
Matthias Schulz 9456d63610 Add support for the Voltcraft VC-96 DMM. 2018-06-18 16:30:04 +02:00
JohnCh e756c595b6 fluke-45: Initial driver skeleton. 2018-06-15 15:05:04 +02:00
Bastian Schmitz b872ab7d30 gwinstek-gpd: Initial implementation. 2018-06-14 14:19:08 +02:00
Frank Stettner fd20e59caa scpi: Synchronize read, write and write+read operations.
This ensures that SCPI read/write/write+read operations are thread safe.
F.e.: If a write operation expects a return value (in other words: a
read operation), it is not allowed to be interrupted by another write
operation.

To simplify things, the SCPI helper functions are moved from
scpi/helpers.c to scpi/scpi.c and also are renamed to fit the naming
scheme.

libgpib in particular will abort the program execution in case of
concurrent operations.
2018-06-01 15:46:17 +02:00