Commit Graph

2278 Commits

Author SHA1 Message Date
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ć) c09392d092 scpi: Add CMD_GET_SAMPLE_RATE to the command enum. 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
poljar (Damir Jelić) 9806c2d573 strutil: Add function to parse floating point numbers while ignoring the locale.
Most of the supported gear uses the ANSI C locale for communication, and if the
client sets up an incompatible locale parsing would fail.

This function ignores the client's locale and parses floating point numbers
using the ANSI C locale. This function should be always used when parsing
floating point numbers coming from the instrument.
2014-01-16 16:27:35 +01:00
poljar (Damir Jelić) 92b68bb5d6 device: Pass sdi as an function argument to config_list in dev_has_option()
With drivers that support multiple devices we need to know the device model
while listing options. That information is most of the time saved in the private
part of the dev_inst structure.

Pass the pointer to the dev_inst structure as an function argument so we have
access to this information.
2014-01-16 09:35:38 +01:00
poljar (Damir Jelić) 580f309948 strutil: Correctly parse floating point frequencies in parse_size_string().
parse_size_string() incorrectly parses a real number, e.g. 1.5 kHz ends up
being 1Hz.

This patch fixes parse_size_string() to take the fractional part as well into
account. The fractional part is parsed as an double precision floating point
number while ignoring the locale.
2014-01-16 09:35:38 +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 9e2bf9d204 configure: add -Wmissing-prototypes compiler option
This should avoid introduction SR_PRIV functions when static would be enough.
2014-01-14 23:39:23 +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
Aurelien Jacobs 2588e50c63 es519xx: add missing declarations for es519xx_2400_11b_altfn 2014-01-14 23:26:00 +01:00
Aurelien Jacobs 365cca8aca gnuplot: proper error message when using gnuplot output without logic probe 2014-01-14 22:59:33 +01:00
Aurelien Jacobs ad7621d445 add udev rule for the Rigol DS2000 series 2014-01-14 22:58:48 +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
Uwe Hermann 2379783d85 configure.ac: Don't build sysclk-lwla if libusb-1.0 is not found. 2014-01-14 19:46:05 +01:00
Uwe Hermann 87283d98c9 configure.ac: Move sysclk-lwla chunk to correct location. 2014-01-14 19:36:28 +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
Bert Vermeulen 69d83be9bf Use PRIu64 for format in pretty-printer.
Thanks to Marcus Comstedt for the fix.
2014-01-14 00:01:06 +01:00
Aurelien Jacobs 02820f0795 rigol-ds: does not depend on libserialport 2014-01-13 22:53:57 +01:00
Aurelien Jacobs a44a804bc6 scpi_usbtmc: does not depend on libserialport 2014-01-13 22:53:57 +01:00
poljar (Damir Jelić) 138c0652f8 udev: Add the Rigol DG4000 series to the udev rules 2014-01-13 22:53:21 +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