Commit Graph

1400 Commits

Author SHA1 Message Date
poljar (Damir Jelić) 66e3219dbd hameg-hmo: Send the DF_END packet in acquisition_stop()
The DF_END packet was send out after all configured frames were fetched, but
devices may stop the acquisition at any point in time and an DF_END will not be
send out in this case.

Send the DF_END packet inside of acquisition_stop() so this can't happen.
2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 68e3d07014 hameg-hmo: Close the device after initial scan.
The device is after a scan left open and clients that don't call unconditionally
dev_open() will never fetch the initial device state.

Close the device after the scan so clients know they need to open it.
2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 965b463d98 hameg-hmo: Handle floating point numbers while ignoring the locale. 2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 13dbd151fe scpi: Use sr_atof_ascii() instead of sr_atof(). 2014-01-16 16:27:35 +01:00
Daniel Elstner 0b92c32cb8 sysclk-lwla: Make use of the probe index again.
(configure_probes): sr_probe::index has been un-deprecated,
so use it instead of relying on the list order.
2014-01-15 21:44:59 +01:00
Daniel Elstner d02d475442 sysclk-lwla: Bypass divider in external clock mode.
(lwla_setup_acquisition): Set the clock divider bypass
flag to 1 for the external clock modes as well.
(capture_setup): Set the clock divide count to 0 if an
external clock source is selected.
2014-01-15 21:44:59 +01:00
Daniel Elstner 313c7a7da2 sysclk-lwla: Utility functions clean-up and semantic fixes.
(lwla_send_bitstream): Unref the mapped file earlier in order
to simplify the error handling.
(lwla_receive_reply): Do not treat a reply buffer length of
zero as silent no-op.  That logic was left over from an earlier
iteration, before the distinction between reply buffer size and
expected read length was introduced.
2014-01-15 21:44:59 +01:00
Daniel Elstner 60e2fa0a03 sysclk-lwla: Remove unused dev_context::next_state. 2014-01-15 21:44:59 +01:00
Daniel Elstner 945e4343e2 sysclk-lwla: Avoid warning due to bogus range check.
(lwla_set_clock_source): Checking whether an enum value is greater
than or equal to zero apparently results in a warning with some
compilers.  Assign the enum to an unsigned variable to avoid this,
and return SR_ERR_BUG if the range is exceeded, as this indicates
a bug in the driver code itself.
2014-01-15 21:43:54 +01:00
Aurelien Jacobs 8a2aaffa02 remove unused static functions 2014-01-14 23:39:23 +01:00
Aurelien Jacobs d87c1766f2 change a bunch of functions from SR_PRIV to static
None of those functions are called across compilation units.
2014-01-14 23:39:23 +01:00
Aurelien Jacobs 8162cad7e0 move function declarations to the appropriate header 2014-01-14 23:39:23 +01:00
Uwe Hermann 1f98295dfa sysclk-lwla: Fix probe name issue.
The g_ascii_formatd() function expects the "format" argument to start
with a '%' character, e.g. it should be "%f" or such (this is not
clearly documented in the glib API docs, but visible from the source code).

The usage of "CH%f" for example will trigger an assertion and thus make the
LWLA device unusable in practice (e.g. in PulseView on Windows no probenames
would be shown, and sampling wouldn't work).

Example:
  GLib-CRITICAL **: g_ascii_formatd: assertion 'format[0] == '%'' failed

(not exposed in all glib versions or builds of glib on all distros
apparently, some may need G_MESSAGES_DEBUG=all or other measures)

From the glib g_ascii_formatd() code:
  g_return_val_if_fail (format[0] == '%', NULL);

We now use g_snprintf() instead for simplicity. This has been tested to
fix this specific issue (i.e. the probenames now do show up in PulseView).

This closes bug #270.
2014-01-14 19:52:26 +01:00
Daniel Elstner 7ebe9b9e7e sysclk-lwla: Honor SR_CONF_CONN at scan time. 2014-01-14 19:33:31 +01:00
Daniel Elstner 8a3ddd8815 sysclk-lwla: Fix calculation of the running sample count.
Field 7 of the status response is actually a duration in
milliseconds at all samplerates but 125 MHz.
2014-01-14 19:33:31 +01:00
Daniel Elstner 5874e88d83 sysclk-lwla: Implement support for the LWLA1034. 2014-01-14 19:33:31 +01:00
Daniel Elstner aeaad0b0b5 sysclk-lwla: Initial driver skeleton. 2014-01-14 19:33:31 +01:00
Martin Ling bfaf112b68 rigol-ds: Use correct digital channel numbers when fetching config. 2014-01-14 18:28:19 +00:00
Bert Vermeulen a4eb4b296d cem-dt-885x: Don't use char as signed type. 2014-01-14 01:29:30 +01:00
Aurelien Jacobs 613c110849 scpi: properly check for HAVE_RPC (which is always defined) 2014-01-14 00:18:31 +01:00
Aurelien Jacobs d993d8d39d rigol-ds: remove lonely break 2014-01-14 00:01:50 +01:00
Aurelien Jacobs a31b2ccbd8 rigol-ds: prevent config_list() to return empty g_variant
This fixes the following glib message:
$ ./sigrok-cli -d rigol-ds --show
[...]
g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed
2014-01-14 00:01:50 +01:00
Aurelien Jacobs a44a804bc6 scpi_usbtmc: does not depend on libserialport 2014-01-13 22:53:57 +01:00
Bert Vermeulen e22aa87808 atten-pps3xxx: Fix options reporting. 2014-01-13 02:10:11 +01:00
Bert Vermeulen fe997353bf atten-pps3xxx: Fix output channel mode get. 2014-01-13 02:05:39 +01:00
Bert Vermeulen 2388ae860c demo: Properly handle logic vs. analog when setting the pattern. 2014-01-12 23:31:23 +01:00
Bert Vermeulen 7a1da33198 demo: Split supported device options by probe group. 2014-01-12 22:36:39 +01:00
Aurelien Jacobs dc3b3be5cb scpi_vxi: ensure the vxi link was properly opened before closing it 2014-01-12 18:46:24 +01:00
Aurelien Jacobs 104ed12553 scpi_tcp: split into scpi_tcp_raw and scpi_tcp_rigol
The current implementation is renamed to tcp-rigol as it seems to be
a Rigol proprietary protocol used only on Rigol VS5000 series.

A new tcp-raw implementation is introduced which simply carries raw SCPI
commands over TCP. It is probably a much more common protocol and it is
at least available on Rigol DS2000 series on port 5555.
2014-01-12 00:38:08 +01:00
Aurelien Jacobs f754c14691 scpi: make the scpi_dev_inst_new more generic 2014-01-12 00:05:02 +01:00
Aurelien Jacobs c3515cea44 scpi: factorize dev_inst_new calls out of individual drivers 2014-01-11 22:36:46 +01:00
Aurelien Jacobs d5876cfb4a scpi: add VXI transport support 2014-01-11 22:36:09 +01:00
Aurelien Jacobs c84b6ab81c import VXI RPC Language description
along with the corresponding rpcgen generated source code files
2014-01-11 22:34:51 +01:00
Bert Vermeulen ab988ecb23 atten-pps3xxx: Push configured settings even without acquisition. 2014-01-10 02:10:51 +01:00
Bert Vermeulen 81c9e1a064 atten-pps3xxx: Use configured values to construct packet.
This used the values previously received from the device, not very useful.
2014-01-10 02:09:49 +01:00
Bert Vermeulen 33c40990fd atten-pps3xxx: Full support for the PPS3203T-3S. 2014-01-10 00:39:36 +01:00
Bert Vermeulen fa0d6afe19 atten-pps3xxx: Initial driver skeleton. 2014-01-10 00:38:32 +01:00
Bert Vermeulen 14563512ec chronovu-la8: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES. 2014-01-09 16:28:29 +01:00
Bert Vermeulen 0b9b3c41c2 ikalogic-scanalogic2: List all keys in device options. 2014-01-09 16:27:56 +01:00
Bert Vermeulen f649fe8f8e zeroplus-logic-cube: List all keys in device options. 2014-01-09 16:26:58 +01:00
Bert Vermeulen 67055d4c18 zeroplus-logic-cube: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES. 2014-01-09 14:30:20 +01:00
Bert Vermeulen c2b988bd4a ikalogic-scanalogic2: Publish SR_CONF_MAX_UNCOMPRESSED_SAMPLES. 2014-01-09 14:00:53 +01:00
Bert Vermeulen 7730e4f002 Add support for SR_CONF_MAX_UNCOMPRESSED_SAMPLES. 2014-01-09 13:08:32 +01:00
Uwe Hermann 311622f69e serial-dmm: Drop unused DMM_COUNT. 2014-01-06 20:54:00 +01:00
Uwe Hermann ec5186f936 hardware/common/dmm: Fix debug output level.
Most messages from the DMM parsers are not hard errors, lower to
sr_dbg() so that the sigrok-cli output doesn't get cluttered (by default)
with debug output such as:

 P1: 0.001100 V DC AUTO
 sr: fs9721: Sync nibble in byte 0 (0x00) is invalid.
 P1: 0.001100 V DC AUTO

(using -l 4 or -l 5 will still allow the user to see such messages)
2014-01-06 20:44:44 +01:00
Uwe Hermann 2710cb53fd serial-dmm: Support the Tenma 72-7745 via UT-D02 cable.
(it was already supported in uni-t-dmm via UT-D04 cable)
2014-01-06 20:30:56 +01:00
Uwe Hermann d9e79c5122 Add support for the Tenma 72-7750 (UNI-T UT60G rebadge). 2014-01-06 20:30:35 +01:00
Uwe Hermann 4104ef810e Add initial support for the UNI-T UT60G. 2014-01-06 19:06:51 +01:00
Matthias Heidbrink 48d3238e66 serial: Improved docs. 2014-01-03 20:08:04 +01:00
Aurelien Jacobs 8ae157d976 scpi_usbtmc: fix reading of blocks bigger than the 2048 bytes buffer 2014-01-03 17:54:47 +01:00
Aurelien Jacobs a53278de01 rigol-ds: fix waveform reception on DS2000 series
The ":WAV:DATA?" scpi command must be sent before calling
sr_scpi_read_begin().
2014-01-03 17:54:47 +01:00
Aurelien Jacobs 036d378a62 rigol-ds: add a few more DS2000 models to the supported list 2014-01-03 17:54:47 +01:00
Russ Dill 7142d6b9d5 zeroplus: Add voltage threshold support
It doesn't currently mesh well with libsigrok, but at least the support is there.
2014-01-03 15:09:11 +01:00
Russ Dill 42ceb77726 zeroplus: Major rework of sample buffer processing
The sample buffer is a still a bit of a mystery, but this should help.
The variables in play:

triggerbar/ramsize_trigger - These two variables added together indicate
how many samples we want captured. ramsize_trigger - triggerbar
indicades how many samples must be captured. The ratio between the two
is determined by capture ratio.

memory_size - This indicates the number of samples in the circular
capture buffer. stop_address, now_address, and trigger_address are
pointers within the zeroplus that wrap based on this size.

now_address - The address that the zeroplus was about to write to when
it finished capturing, and now the address that will be read from when
reads are done from the capture buffer

stop_address - The address that the zeroplus last wrote to when it
completed capture.

trigger_address - The sample address for which the trigger occured.

status - This one is a bit tricky. Some testing has shown that if the
zeroplus has captured memory_size or less samples, the STATUS_READY bit
is set. For all captures generated with more samples than this,
STATUS_READY was cleared. However, boundary conditions are difficult to
test and values such as, memory_size + 1 have not been tested. We use
this to determine if the capture has wrapped through the sample buffer.

More testing is required, but this improves behavior in a number of
cases, specifically capturing sample amounts that are not a power of 2
of the sample buffer size. Before, random data was passed to libsigrok.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:11 +01:00
Russ Dill a864a05b25 zeroplus: Add getters for memory configuration
This is needed at capture readback time to determine how many samples to read
in.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Russ Dill aad031928e zeroplus: Modify analyzer_read_start to just prep for bulk reads.
Let the capture loop manage which samples are thrown out rather
than throwing out two here.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Russ Dill bc059b42a2 zeroplus: Always set DONT_CARE_TRIGGERBAR to 1
Experimentation with the windows driver has found no situation where
this is set to anything other than 1. The zerominus software also never
sets this to anything other than one. Revert the code change made in
0ab0cb942f.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Russ Dill 4c1433d172 zeroplus: Ignore capture ratio if there is no trigger
If there is no trigger, don't try to capture anything before it. There
won't be any because we trigger immediately.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Russ Dill 05f853b5c3 zeroplus: Add missing config_get for SR_CONF_CAPTURE_RATIO
Without this, latest pulseview gets an assert and dies.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Russ Dill 5db0c668fa zeroplus: Support all 32 channels of 32 channel models
This will need some additional work when support is added for compression
modes since group D is disabled for RLE compression and C and D are
disabled for "double" compression.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
2014-01-03 15:09:10 +01:00
Matthias Heidbrink 1d4a283928 gmc_mh_1x_2x: Fixed sign and AC/DC for current measurements with Metrahit <= 16. 2014-01-02 19:38:52 +01:00
Uwe Hermann 124c548de8 serial-dmm: Increase timeout when scanning for DMMs.
We have to wait a bit longer than 1s for a valid DMM packet to arrive,
since for various DMMs some modes (Hz/% for example) the packets will
arrive a lot less often than in other modes. If the waiting period is
too short detection of the DMM will fail.
2014-01-02 14:25:06 +01:00
Uwe Hermann 7fb5f0a0f5 serial-dmm: Drop obsolete function prototypes. 2014-01-02 02:48:13 +01:00
Uwe Hermann d327972b97 Add initial support for the V&A VA40B multimeter. 2014-01-02 01:46:15 +01:00
Uwe Hermann 79bc9924d7 uni-t-dmm: Fix incorrect order which breaks UT61B/C. 2014-01-01 16:40:36 +01:00
Uwe Hermann 7cb69b1870 Add support for the UNI-T UT61B multimeter. 2014-01-01 15:28:44 +01:00
Uwe Hermann 162a48bfc7 teleinfo: Fix a compiler warning (clang).
CC       libsigrok_hw_teleinfo_la-protocol.lo
protocol.c:62:41: warning: missing field 'num_samples' initializer
      [-Wmissing-field-initializers]
        struct sr_datafeed_analog analog = { 0 };
                                               ^
2013-12-31 19:22:16 +01:00
Uwe Hermann 42f2f8a533 gmc-mh-1x-2x: Fix compiler warning (clang).
CC       libsigrok_hw_gmc_mh_1x_2x_la-protocol.lo
protocol.c:133:32: warning: equality comparison with extraneous
parentheses
      [-Wparentheses-equality]
                        } else if ((devc->scale1000 == 2)) {
                                    ~~~~~~~~~~~~~~~~^~~~
protocol.c:133:32: note: remove extraneous parentheses around the
comparison to
      silence this warning
                        } else if ((devc->scale1000 == 2)) {
                                   ~                ^   ~
2013-12-31 19:21:04 +01:00
Uwe Hermann 35b904a792 es519xx.c: Fix a few compiler warnings (clang).
CC       libsigrok_hw_common_dmm_la-es519xx.lo
es519xx.c:632:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:659:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:688:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:717:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:746:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:773:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
es519xx.c:800:33: warning: missing field 'is_voltage' initializer
      [-Wmissing-field-initializers]
        struct es519xx_info info = { 0 };
                                       ^
7 warnings generated.
2013-12-31 19:20:51 +01:00
Martin Ling 264c99eda2 ols: Use serial source management wrappers. 2013-12-30 14:19:39 +01:00
Martin Ling 9f5d4c3cc3 ols: Mark all serial calls as blocking or nonblocking. 2013-12-30 14:19:39 +01:00
Martin Ling 9a47421157 Add blocking and nonblocking versions of serial_read and serial_write. 2013-12-30 14:19:39 +01:00
Aurelien Jacobs cb410697fb remove the es51922 protocol parser, superseded by the es519xx protocol parser 2013-12-29 18:46:08 +01:00
Aurelien Jacobs d97824e52e switch the UNI-T UT61E driver to the new es519xx parser 2013-12-29 18:46:08 +01:00
Aurelien Jacobs 29bad967a4 es519xx: correctly handle the VAHZ function
This handles the frequency and duty cycle display in voltage or current mode.
2013-12-29 18:46:08 +01:00
Aurelien Jacobs c3e871dc8e es519xx: apply the proper fixed factor in duty cycle mode 2013-12-29 18:46:08 +01:00
Aurelien Jacobs e1f9f1e1f2 es519xx: fix switching between frequency and duty cycle mode on 14 bytes chips
Here is what the datasheet says about this:
  "If judge bit is 1, it means frequency mode. If judge bit is 0,
   it means duty cycle mode."
But this is plain wrong. Reality proves this is the other way around.
2013-12-29 18:46:08 +01:00
Aurelien Jacobs 4d2630e63a es519xx: correctly handle the voltage factor in diode mode 2013-12-29 18:46:08 +01:00
Aurelien Jacobs a7c01629f6 es519xx: fix continuity mode handling
Depending on the chip, the limit value for the buzzer is between 25 and 35 Ω,
so this code set the limit for continuity to 25 Ω to be on the safe side.
2013-12-29 18:46:03 +01:00
Uwe Hermann 5f985df23c Add support for the UNI-T UT61C multimeter. 2013-12-29 17:35:51 +01:00
Uwe Hermann 683fd16137 fx2lafw: Fix incorrect unitsize when a trigger fires.
The unitsize was always being set to 2, regardless of whether an fx2lafw
device with 8 or 16 probes was used.

This fixes bug #182.
2013-12-29 14:18:51 +01:00
Uwe Hermann 87b545fba4 fx2lafw: Minor cleanups. 2013-12-29 14:18:51 +01:00
Martin Ling 0709197deb rigol-ds: Correct usage of NUM_TIMEBASE and NUM_VDIV config keys. 2013-12-29 13:22:32 +01:00
Martin Ling bc7b7eb196 scpi: Strip trailing newline from *IDN response if present. 2013-12-29 13:22:31 +01:00
Uwe Hermann b178c79d35 victor-dmm: Fix MIN/MAX always being reported.
This fixes bug #228.
2013-12-29 12:33:10 +01:00
Bert Vermeulen 8b2d41edb3 demo: Analog probe support. 2013-12-29 10:58:56 +01:00
Bert Vermeulen c07f60e73d demo: User-configurable number of probes.
The sigrok and incremental patterns repeat every 8 probes, shifted by
one probe.
2013-12-29 10:58:56 +01:00
Martin Ling 05c644ea08 Revise SCPI read API to allow backend-independent data handling. 2013-12-29 04:26:36 +01:00
Martin Ling 227a0981c0 rigol-ds: Support the rest of the DSO1000 range. 2013-12-29 01:39:49 +01:00
Martin Ling 821fbcadcc rigol-ds: Support 4 analog channels. 2013-12-29 01:34:58 +01:00
Martin Ling 0d9f5a12cb rigol-ds: Use correct live waveform size for Agilent DSO1000 series. 2013-12-29 00:35:09 +01:00
Martin Ling 10afee13a3 rigol-ds: Add support for Agilent DSO1014A. 2013-12-29 00:27:11 +01:00
Martin Ling 77c16c0463 scpi: Log IDN? result. 2013-12-29 00:26:54 +01:00
Martin Ling 07ccb2b3f1 rigol-ds: Fix rigol_ds_channel_start() for digital channels. 2013-12-28 14:05:56 +01:00
Martin Ling 9e4b7d9833 rigol-ds: Use correct analog frame size for VS5000 series. 2013-12-28 14:05:56 +01:00
Martin Ling 6396b0a76b rigol-ds: Use set_cfg wrapper for capture setup commands. 2013-12-28 14:05:56 +01:00
Martin Ling 1fed20cb38 rigol-ds: Select channels before issuing RUN command. 2013-12-28 14:05:55 +01:00
Martin Ling 48460c6f3e rigol-ds: Unify partial read handling. 2013-12-27 22:47:42 +01:00
Martin Ling f80a0bf232 rigol-ds: Unify code for counting expected incoming bytes. 2013-12-27 22:47:42 +01:00
Martin Ling 677f85d00b rigol-ds: Use rigol_ds_channel_start() function for legacy protocol too. 2013-12-27 22:47:42 +01:00