Commit Graph

1448 Commits

Author SHA1 Message Date
Bert Vermeulen 933e63a13b brymen-dmm: Make protocol parser locale-independent. 2014-01-21 17:02:27 +01:00
Bert Vermeulen fe9d5abefc agilent-dmm: Make protocol parser locale-independent. 2014-01-21 16:43:49 +01:00
Bert Vermeulen 357e341d9a fluke-dmm: Make protocol parsers locale-independent. 2014-01-21 16:33:34 +01:00
Martin Ling 10d309c8ab rigol-ds: DS1000 series still needs the stupid delay. 2014-01-21 13:10:29 +01:00
Bert Vermeulen 8dd0b290eb rigol-ds: On DS1000 with firmware < 0.2.4, use legacy protocol.
Apparently the ASCII header containing length was only added in version
0.2.4.
2014-01-21 13:05:06 +01:00
Bert Vermeulen fcdebbe89c rigol-ds: Shorten vendor name. 2014-01-20 19:08:10 +01:00
Bert Vermeulen 67d6f6fca2 agilent-dmm: Shorten vendor name. 2014-01-20 19:07:48 +01:00
Bert Vermeulen 6d16fdfb13 ols: Add option to turn test patterns off again. 2014-01-20 18:16:25 +01:00
Aurelien Jacobs 2b0e4a468a rigol-ds: add support for more keys in config_get() 2014-01-20 00:34:57 +00:00
Aurelien Jacobs 72ecba02f4 rigol-ds: use appropriately defined NUM_VDIV constant 2014-01-20 00:34:57 +00:00
Aurelien Jacobs 8e06edf528 rigol-ds: add more valid timebases for DS2302 2014-01-20 00:34:57 +00:00
Aurelien Jacobs 889ef4a01c rigol-ds: fix set_cfg() calls with float parameters to avoid locale issues 2014-01-20 00:34:56 +00:00
Martin Ling f76c24f6fd rigol-ds: Send FRAME_BEGIN and FRAME_END per frame, not per channel. 2014-01-20 00:24:57 +00:00
Martin Ling bac11aeb1b rigol-ds: Cleanup and fix check for short data blocks. 2014-01-20 00:24:57 +00:00
Martin Ling 51bfe5363a rigol-ds: Use *OPC? command rather than delay to await completion. 2014-01-20 00:24:57 +00:00
Martin Ling 7788579e66 scpi: Remove redundant newline removal in sr_scpi_get_hw_id(). 2014-01-20 00:24:57 +00:00
Martin Ling 334fbc2ac0 rigol-ds: Use standard sr_scpi_get functions, remove internal versions. 2014-01-20 00:24:57 +00:00
Martin Ling d03dfac6b9 scpi: Strip trailing newlines in sr_scpi_get_string(). 2014-01-20 00:24:57 +00:00
Martin Ling 470140fc0d rigol-ds: DS1000 series actually use IEEE488.2 data block format. 2014-01-20 00:24:57 +00:00
Martin Ling d22250a96a rigol-ds: Correct digital waveform block sizes. 2014-01-20 00:24:14 +00:00
Martin Ling 3ed7a40c75 rigol-ds: Check SCPI read is complete after reading expected block length. 2014-01-20 00:24:14 +00:00
Martin Ling 904fd29b72 rigol-ds: Update which channels are enabled after making changes. 2014-01-20 00:24:14 +00:00
Bert Vermeulen f0de2dd0fa Remove SR_CONF_MAX_UNCOMPRESSED_SAMPLES again.
The maximum sample size that can be set on a device is now published
by sr_config_list(SR_CONF_LIMIT_SAMPLES). This returns a tuple of
uint64_t representing minimum and maximum number of samples.
2014-01-19 17:18:59 +01:00
Daniel Elstner 9497f49ef8 sysclk-lwla: Improve message log output.
Report settings at acquisition start as informational messages.
Print a message when the the trigger condition has been met.
Demote some other messages from information to debug, and use
the %zu format for printing size_t values.
2014-01-18 19:09:56 +01:00
Daniel Elstner 2cfd16a316 sysclk-lwla: Streamline packet output logic.
(process_sample_data): When expanding run-length samples into
session packets, calculate the number of samples to write in
advance while honoring all constraints.  This is cleaner than
checking constraints within the expansion loop.  Also, the new
logic always fills up packets exactly to whatever limit applies
first, thereby removing the need for truncation after the fact.
2014-01-18 17:36:23 +01:00
Daniel Elstner 29d587670d sysclk-lwla: Implement SR_CONF_LIMIT_MSEC.
Allow the acquisition to be constrained by time in addition to
a sample count limit.  Since the LWLA protocol actually provides
only a duration natively, implement the sample count limit on top
of the new duration limit.

With this change, limiting an acquisition in external clock mode
should finally work properly.
2014-01-18 16:08:39 +01:00
Bert Vermeulen 2438b737ae demo: Bring analog square wave amplitude into line with other patterns. 2014-01-17 14:36:00 +01:00
poljar (Damir Jelić) 9f54e0e84f demo: Add analog sawtooth pattern. 2014-01-17 14:30:28 +01:00
poljar (Damir Jelić) 091c962127 demo: Add triangle pattern. 2014-01-17 14:30:28 +01:00
poljar (Damir Jelić) 4374219bc8 demo: Implement sine wave pattern.
This adds sine wave generation capabilities for the analog channels in the demo
driver. The frequency of the sine wave depends on the configured sample rate of
the demo device. The frequency of the sine wave is always 20 times smaller than
the sample rate, in other words we always have 20 samples per period.
2014-01-17 14:30:28 +01:00
Bert Vermeulen e196cb6193 uni-t-ut32x: Fix typo that prevents usage with multiple devices. 2014-01-17 12:11:52 +01:00
Uwe Hermann c2b394d562 rigol-ds: Minor whitespace fixes. 2014-01-17 02:03:09 +01:00
Martin Ling 04e8e01ec6 rigol-ds: Enable/disable LA pod when (de)selecting digital channels. 2014-01-17 01:52:29 +01:00
Martin Ling 51b294cd01 rigol-ds: Reset num_frames to zero in dev_acquisition_start. 2014-01-17 01:52:29 +01:00
Martin Ling b751cf7a82 rigol-ds: Make sure to always send SR_DF_END at end of capture. 2014-01-17 01:52:29 +01:00
Martin Ling 4914dd4b9a rigol-ds: Calculate effective samplerate. 2014-01-17 01:52:29 +01:00
Martin Ling 5415e60247 rigol-ds: Separate function to compute analog frame size. 2014-01-17 01:52:29 +01:00
Martin Ling c1bcb8cc63 rigol-ds: Advertise SR_CONF_LIMIT_FRAMES support. 2014-01-17 01:52:29 +01:00
Martin Ling 969edf6306 rigol-ds: Fix check for probe group validity. 2014-01-17 01:52:29 +01:00
Uwe Hermann 55eb33dbf8 hameg-hmo: Fix two compiler warnings on Windows.
CC       libsigrok_hw_hameg_hmo_la-protocol.lo
api.c: In function 'auto_find_usb':
api.c:70:39: warning: unused parameter 'vendor_id' [-Wunused-parameter]
 static GSList *auto_find_usb(uint16_t vendor_id, uint16_t product_id)
                                       ^
api.c:70:59: warning: unused parameter 'product_id' [-Wunused-parameter]
 static GSList *auto_find_usb(uint16_t vendor_id, uint16_t product_id)
                                                           ^
2014-01-17 00:38:47 +01:00
Uwe Hermann dcc94340bd usb: Fix two compiler warnings on Windows.
CC       libsigrok_hw_common_la-usb.lo
usb.c:241:18: warning: no previous prototype for 'usb_thread'
[-Wmissing-prototypes]
 SR_PRIV gpointer usb_thread(gpointer data)
                  ^
usb.c:256:13: warning: no previous prototype for 'usb_callback'
[-Wmissing-prototypes]
 SR_PRIV int usb_callback(int fd, int revents, void *cb_data)
             ^
2014-01-17 00:38:33 +01:00
poljar (Damir Jelić) c06c24d2d3 hameg-hmo: Silence warning about format security.
The command for fetching the sample rate while in single shot mode doesn't take
an argument so the snprintf here is redundant.
2014-01-16 23:02:47 +01:00
poljar (Damir Jelić) ef1a346b0b hameg-hmo: Reset the number of acquired frames in acquisition stop. 2014-01-16 23:02:47 +01:00
poljar (Damir Jelić) ccf1461825 hameg-hmo: Expose more options with config_get().
This patch exposes the TRIGGER_SOURCE and COUPLING options via config_get().
2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) eff1ee0321 hameg-hmo: Advertise the frame limit option. 2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 23e1ea7a7d hameg-hmo: Update the sample rate when the channel states or the timebase change.
The sample rate on the Hameg scopes changes depending on the number of channels
turned on and on the current timebase.

Update the sample rate if any of the above change.
2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 14a2f74d9a hameg-hmo: Add support for sample rate fetching. 2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 8de2dc3b2e hameg-hmo: Change the way vdiv and timebase are saved.
The current vertical division setting (per channel) and the timebase are stored
as a floating point number. This is suboptimal since clients expect us to send
this information to them in form of a rational number.

Store only the index of the current setting since all the supported settings are
already stored inside of an array.
2014-01-16 16:27:35 +01:00
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