Commit Graph

3793 Commits

Author SHA1 Message Date
Benjamin Larsson 7fb90f94d6 fx2lafw: Add working glue layer for frontends 2016-04-29 15:19:08 +02:00
Joel Holdsworth 7e5ccff2ec fx2lafw: Add analog sampling handler
This will be needed for the MSO support of the CWAV USBee AX and clones.
2016-04-27 22:49:51 +02:00
Joel Holdsworth 7b5d1c64fc fx2lafw: Factor out packet sending
This will make it possible to use different senders based on
driver mode. This is needed for USBee AX support.
2016-04-27 22:29:56 +02:00
Joel Holdsworth ce35b282de fx2lafw: Add CTL2 clocking command flag to header
The USBee AX hardware needs a sampling clock that is lower than
the 30MHz or 48MHz that the FX2 has to offer. This flag will enable
clocking via the CTL2 pin that is an even divisor of the main clock.
2016-04-27 22:29:16 +02:00
Joel Holdsworth 232a975fe2 fx2lafw: Add support for AX analog channel probing 2016-04-27 22:29:16 +02:00
Uwe Hermann 152e7f4d7c hwdriver.c: Add missing SR_MQFLAG_FOUR_WIRE entry. 2016-04-23 17:45:49 +02:00
Alexandru Gagniuc 9a093be9f5 hp-3457a: Implement support for rear terminals and plug-in cards 2016-04-23 17:44:26 +02:00
Alexandru Gagniuc 2c04f943ef hp-3457a: Implement AC, ACDC, and four-wire resistance modes
The driver did not look at the mq_flags provided with the
SR_CONF_MEASURED_QUANTITY key, and it defaulted to DC measurements.
Use the second member of the tuple provided by the config key, which
represents the flags for the measurement, and set the instrument's
measurement mode accordingly.
2016-04-23 17:44:26 +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
Alexandru Gagniuc e2626373b7 hp-3457a: Do not retrigger new measurement after the last sample
Due to a PEBKAC error, after the last sample was sent, a new
measurement was triggered, but its value was never sent down the
session bus. This is easily fixed by incrementing devc->num_samples
right after a measurement is sent instead of when a measurement is
retriggered.
2016-04-23 17:44:26 +02:00
Sergey Alirzaev cee6d3fa0c ftdi-la: added support for the device selection
Tested on FT232RL and FT2232H both attached to the same PC.
2016-04-23 17:37:46 +02:00
Benjamin Larsson 5954e71653 hantek-6xxx: fix memory leaks
Free the first flush packet and the driver context when closing.
2016-04-23 17:37:45 +02:00
Benjamin Larsson 2c4600191b memory leak fix: g_variant_print() usage fix
g_variant_print() allocates memory during call. Save the pointer
so that it can be free'd afterwards.

==10048== 16 bytes in 1 blocks are definitely lost in loss record 17 of 37
==10048==    at 0x4C2DEAE: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10048==    by 0x536C85D: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x53877C6: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x5388B60: g_string_append_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x5388D83: g_string_append_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x539D034: g_variant_print_string (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x539C92C: g_variant_print (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x4E5F713: log_key (hwdriver.c:597)
==10048==    by 0x4E5FCD5: sr_config_set (hwdriver.c:752)
==10048==    by 0x408C1A: run_session (session.c:661)
==10048==    by 0x404FC5: main (main.c:267)
==10048==
==10048== 16 bytes in 1 blocks are definitely lost in loss record 18 of 37
==10048==    at 0x4C2DEAE: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10048==    by 0x536C85D: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x53877C6: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x5388B60: g_string_append_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x5388D83: g_string_append_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x539D034: g_variant_print_string (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x539C92C: g_variant_print (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4400.1)
==10048==    by 0x4E5F713: log_key (hwdriver.c:597)
==10048==    by 0x4E5FBDD: sr_config_get (hwdriver.c:709)
==10048==    by 0x4080D7: datafeed_in (session.c:196)
==10048==    by 0x4E5D47E: sr_session_send (session.c:1192)
==10048==    by 0x4E62682: std_session_send_df_header (std.c:101)
2016-04-23 17:37:45 +02:00
Markus Siegert 050eb3b32d hantek-6xxx: Use power of 2 usb packet sizes
Using non power of 2 sizes causes the driver to not work on OS X.
Depending on the usb transfer mode the buffer sizes will map
perfectly to the underlying transport protocol.
2016-04-23 17:37:45 +02:00
Markus Siegert 1079324f9e hantek-6xxx: use 1D50:608E for Sainsmart DDS-120 2016-04-23 17:37:45 +02:00
Benjamin Larsson cc5ebc8a3d hantek-6xxx: add coupling support
Sainsmart DDS-120 supports AC or DC coupling. Add driver support
to control that feature.
2016-04-23 17:37:45 +02:00
Benjamin Larsson 10e0d374cb hantek-6xxx: store the amount samples received 2016-04-23 17:37:45 +02:00
Benjamin Larsson 8d6d7d5d0d hantek-6xxx: positive return code is not an error 2016-04-23 17:37:45 +02:00
Benjamin Larsson 692c3b229d hantek-6xxx: Add support for Sainsmart DDS120 2016-04-23 17:37:45 +02:00
Uwe Hermann f07298663f Fix two compiler warnings. 2016-04-23 17:37:45 +02:00
Stefan Brüns f4f273ce1e hameg-hmo: Also start reading on timeout (workaround for USBTMC)
scpi_serial generate an POLLIN event after the requested data is returned
by the instrument. For USBTMC it is necessary to
1. send an REQUEST_DEV_DEP_MSG_IN request
2. submit an USB bulk read transfer asynchronously.

Using the synchronous libusb_bulk_read() does not generate an POLLIN event.

Solving this properly needs major surgery in spci_usbtmc_libusb.
2016-04-23 17:09:52 +02:00
Stefan Brüns 055804e89e spci: Terminate all commands with a linefeed for all transports
While some transports add a terminating (carriagereturn+)linefeed
unconditionally, the USBTMC transport does not. At least the R&S HMO1002
requires the linefeed and locks up otherwise. Fixes bug #784.

This changes the TCP and VXI transport from CR+LF to LF only.

Also fixes a possible memory leak for VXI, where the temporary command
buffer was not freed in case of a write error.
2016-04-23 17:08:50 +02:00
Stefan Brüns 66836720f7 scpi/usbtmc: fix remote locking according to USBTMC spec
According to USBTMC usb488 subclass spec, wValue hast to be 0 for both
LOCAL_LOCKOUT and GO_TO_LOCAL. At least required for R&S HMO1002, the
bad request results in a STALL. Fixes bug #783.
2016-04-23 17:08:44 +02:00
Diego F. Asanza 3db03efa4a Working trigger on rising and falling edges. 2016-04-23 17:04:18 +02:00
Uwe Hermann 1a7ff3d087 fx2lafw: Only run dslogic_stop_acquisition() on DSLogic. 2016-04-17 15:49:47 +02:00
Diego F. Asanza 40ebad3524 Ensure DSLogic can be stopped.
After acquisition start, DSLogic stores samples in memory, and when done it
sends a USB packet with the trigger position.

This initial fillup can take some time. If the user requests a session stop
in between, the USB transfer is cancelled and the session hangs because it
is not closed properly.

This commit manages this case and closes the session properly when
acquisition is stopped by the user.

Signed-off-by: Diego F. Asanza <f.asanza@gmail.com>
2016-04-17 15:31:58 +02:00
Sergey Alirzaev c04ca4da17 ftdi-la: order the channels properly 2016-04-17 14:54:08 +02:00
Andrew Bradford 4801798f63 udev: Add DSLogic Pro rule
Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
2016-04-17 14:53:21 +02:00
Stefan Brüns 851329ca3a contrib: add udev rules for HAMEG HO720/HO730 2016-04-17 14:50:42 +02:00
Stefan Brüns d71ead65ea contrib: add udev rules for R&S HMO1002 in VCP and USBTMC mode 2016-04-17 14:50:42 +02:00
Stefan Brüns d38f4e7a0f scpi/serial: Add USB IDs for R&S HMO 1002 Series 2016-04-17 14:50:42 +02:00
Stefan Brüns 356f64f8c7 hameg-hmo: support triggering on either falling or rising edge
At least the HMO 1002 allows triggering on rising or falling edge, the
corresponding SCPI value is "EITH"

See also bug #740
2016-04-17 14:50:42 +02:00
Stefan Brüns e3abd15d08 hameg-hmo: fix "invalid argument" exception when setting trigger edges
The hameg-hmo driver uses the values from the trigger_slopes array.
2016-04-17 14:50:42 +02:00
Stefan Brüns da1726cc4c hameg-hmo: Add Rohde&Schwarz HMO 1002
Hameg is a R&S measurement instruments subsidiary. The HMO 1002 is an
entry level scope, compatible with the SCPI commands of the larger models.
2016-04-17 14:50:42 +02:00
Uwe Hermann 797f1a0cf3 sanity_check_all_drivers(): Add some code comments. 2016-04-17 14:50:18 +02:00
Uwe Hermann bc48ec3755 gmc-mh-1x-2x: Make two functions static. 2016-04-17 14:24:05 +02:00
Uwe Hermann 3c996d8e23 scpi-pps: Drop unused function prototype. 2016-04-17 14:22:37 +02:00
EJ 116670b15d Fix #786 by checking for opts in the bindings 2016-04-17 09:30:54 +02:00
Wolfram Sang 1f706c21a2 input: vcd: skip BOM at beginning of file
According to the infos I have, VCD files should be plain ASCII, but we
got report of a version adding a UTF8 BOM at the beginning of the file,
so we need to skip it.

This fixes bug #755.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-04-13 09:35:03 +02:00
Diego F. Asanza 62974b235a Set DSLogic in logic analyzer mode.
It was being initialized in DSO mode.

Signed-off-by: Diego F. Asanza <f.asanza@gmail.com>
2016-04-13 09:35:03 +02:00
Diego Asanza 3f0ff41284 Fix DSLogic FPGA binary image upload and signal acquisition.
For some reason, uploading the FPGA binary into DSLogic in small chunks
does not work. In this commit, the whole binary image is loaded into memory
and transfer is done in one chunk.

Furthermore, the FPGA configuration structure was not initialized
properly. This was changed with the initialization values taken from the
original DSLogic software.

Signed-off-by: Diego Asanza <f.asanza@gmail.com>
2016-04-13 09:35:02 +02:00
Soeren Apel 600cc1a8a5 Demo: Use 20Vpp as amplitude instead of 50Vpp 2016-04-06 21:11:37 +02:00
Uwe Hermann f9197887e4 ftdi-la: Move ftdi_la_set_samplerate() to protocol.c. 2016-04-03 17:22:05 +02:00
Uwe Hermann f227338297 Rename 'ft2232h' driver to 'ftdi-la'.
The driver already supports more than just the FT2232H chip.
2016-04-02 18:36:52 +02:00
Uwe Hermann dba986ab0a configure.ac: The ft2232h driver also depends on libusb. 2016-03-30 13:38:55 +02:00
Sergey Alirzaev 4f7fdcdd74 ft2232h: Add support for FTDI FT2232H/FT232R chip as LA.
This closes bug #780.
2016-03-30 13:36:02 +02:00
Alexandru Gagniuc 625430bf88 hp-3457a: Implement workaround for double-precision data
Certain output modules do not understand double-precision data.
Although we need double precision to represent the full resolution
of 7.5 digit readings, temporarily convert data to single precision
so that the output modules understand it. While the reasing might be
off by a few counts, we ensure the output modules do not display
completely bogus data.

For details, see bug #779.
2016-03-30 12:50:59 +02:00
Alexandru Gagniuc db23af7fc2 hp-3457a: Implement basic configuration and sampling
KNOWN ISSUES:
- When sampling with 100 NPLC, the poll function will timeout a few
times before the first sample is acquired. Increasing the timeout
passed to sr_scpi_source_add() will cause all the other commands to
be processed slowly, producing a sampling rate of about one sample
every ten seconds.
- Support for plug-in cards (44491A and 44492A) is not implemented.
- Support for AC, AC+DC and four-wire resistance measurements is not
implemented.
- Support for configuring the frequency measurement source is not
implemented.
2016-03-30 12:50:27 +02:00
Alexandru Gagniuc fadb19ac96 hwdriver: Add configuration key for number of powerline cycles
High precision multimeters have a special setting, called "number of
powerline cycles" (NPLC) which determines the integration time of the
ADC in terms of the power line period. Some devices need their NPLC
adjusted from the default value before they can measure at their full
rated precision.
2016-03-30 12:39:25 +02:00
Alexandru Gagniuc 8b0ad3a559 scpi/libgpib: Place device in local mode before closing handle
Devices connected on a real GPIB bus are placed in remote mode when
opening them. libgpib does not automatically place devices back in
local mode when closing the handle. It is thus possible to lock out a
GPIB device by probing it with libsigrok.

This happens on the HP 3457A meter, which does not have a "LOCAL"
command, and must be put back in local mode via GPIB handshake.
ibloc() takes care of this, and it does it on a per-device basis,
such that other devices on the GPIB bus are not affected.
2016-03-30 12:39:20 +02:00