Martin Ling [Wed, 22 Jan 2014 00:25:32 +0000 (00:25 +0000)]
rigol-ds: Overhaul VS5000 and DS1000 support.
This change moves the handling of series differences out to the points in the
code where they actually matter, unifying the overall structure of the code.
It also adds new VS5000/DS1000 series equivalents for commands that were
previously only implemented on the later models.
After this change, trigger waiting and the 'Memory' data source are supported
on the VS5000/DS1000 series.
Daniel Elstner [Mon, 20 Jan 2014 22:04:49 +0000 (23:04 +0100)]
session: Auto-commit settings before acquisition.
(sr_session_start): Just before starting acquisition on
a device, call sr_config_commit() to apply pending config
changes to the hardware device.
(sr_session_dev_add): Ditto. Also, return an error code
if starting acquisition failed.
Daniel Elstner [Sun, 19 Jan 2014 19:39:11 +0000 (20:39 +0100)]
hwdriver: Introduce sr_config_commit() API call.
(sr_dev_driver.config_probe_set): New optional callback enabling
drivers to be notified upon changes to probe settings.
(sr_dev_probe_enable, sr_dev_trigger_set): Invoke new driver
callback on changes.
(sr_dev_driver.config_commit): New optional callback allowing
drivers to defer application of configuration settings until
an explicit call to config_commit().
(sr_config_commit): New public wrapper function.
Bert Vermeulen [Sun, 19 Jan 2014 16:18:59 +0000 (17:18 +0100)]
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.
Daniel Elstner [Sat, 18 Jan 2014 17:13:40 +0000 (18:13 +0100)]
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.
Daniel Elstner [Sat, 18 Jan 2014 16:36:23 +0000 (17:36 +0100)]
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.
Daniel Elstner [Sat, 18 Jan 2014 15:08:39 +0000 (16:08 +0100)]
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.
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.
Uwe Hermann [Thu, 16 Jan 2014 23:26:30 +0000 (00:26 +0100)]
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)
^
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.
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.
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.
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.
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.
Daniel Elstner [Wed, 15 Jan 2014 01:51:08 +0000 (02:51 +0100)]
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.
Daniel Elstner [Wed, 15 Jan 2014 00:12:39 +0000 (01:12 +0100)]
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.
Daniel Elstner [Tue, 14 Jan 2014 23:52:26 +0000 (00:52 +0100)]
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.
Uwe Hermann [Tue, 14 Jan 2014 18:52:26 +0000 (19:52 +0100)]
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).