Gerhard Sittig [Sun, 3 Jun 2018 14:49:45 +0000 (16:49 +0200)]
ols: use serial layer's "has receive data" query
Eliminate a direct libserialport dependency in the OLS device driver.
Use libsigrok's internal serial layer's API instead to check for the
availability of receive data.
Gerhard Sittig [Sun, 3 Jun 2018 10:17:09 +0000 (12:17 +0200)]
serial: introduce "has receive data" query
Add a serial_has_receive_data() routine to the serial layer's API which
returns the number of (known to be) available RX data bytes. Implement
support in the libserialport specific code.
Gerhard Sittig [Fri, 17 Mar 2017 21:15:37 +0000 (22:15 +0100)]
serial_libsp: move libserialport specific code to separate source file
Introduce a new serial_libsp.c source file, and move code from serial.c
there which is specific to libserialport. Keep the existing serial.c API
in place, this is a pure internal refactoring.
Adjust a little whitespace while we are here. Rearrange long lines to
keep related parameter groups adjacent (like pointer and size, or UART
frame length and flow control). Consistently reduce indentation of
continuation lines.
Gerhard Sittig [Sun, 26 Mar 2017 15:56:36 +0000 (16:56 +0100)]
serial: determine timeout from most recent set_params() values
Store the most recent successfully applied set of parameters for serial
communication. Re-use these values as a fallback to calculate timeouts,
when the underlying transport fails to provide the current settings.
The rohde-schwarz-sme-0x device driver used to unconditionally reference
a libserialport header file. Remove that reference, it's not needed in
this specific driver.
Gerhard Sittig [Wed, 1 May 2019 04:19:55 +0000 (06:19 +0200)]
doc: update manual driver addition in the HACKING document
Build support has changed to use linker sections for driver registration.
Update the subsection in the HACKING document which discusses the manual
addition of device drivers, to match what the new-driver script does for
driver authors.
Andreas Piesk [Mon, 13 May 2019 19:33:32 +0000 (21:33 +0200)]
saleae-logic16: Warn (instead of erroring out) if FPGA is unsupported
Don't exit with an error if the FPGA is detected as unsupported.
Just issue a warning with the detected version and continue. I have such
a clone and it works with the original Saleae software and with sigrok
despite the fact that its FPGA version is 0xff.
Uwe Hermann [Wed, 1 May 2019 13:33:05 +0000 (15:33 +0200)]
Fix an issue when building in directories that are symlinks.
Explicitly use SRCDIR and BUILDDIR in Doxyfile files to reference input
files. This seems to be a sufficient fix for an issue where the build
would fail when libsigrok/ was located in a directory that was a symlink.
Gerd v. Egidy [Sun, 10 Feb 2019 19:14:27 +0000 (20:14 +0100)]
agilent-dmm: add basic support for Agilent/Keysight U127x
Their commands are very similar to the U123x series, they just
add some more modes and the second channel. So use the re-functions
and just extend them where necessary.
Gerhard Sittig [Sun, 19 Mar 2017 15:11:56 +0000 (16:11 +0100)]
serial: update doxygen comments (flush vs drain, in vs out params)
It's important to remain aware that the serial layer's flush and drain
semantics differs from e.g. filesystem calls. The libserialport API is
said to follow the termios example.
Extend comments in the libsigrok API, to not depend on the libserialport
layer and the availability of its documentation. This raises awareness
during maintenance of sigrok device drivers, as well as the pending
addition of alternative transports for serial communication.
Adjust the doxygen comment for the read line routine while we are here.
Add "in" and "out" attributes for routine parameters.
Gerhard Sittig [Mon, 22 Apr 2019 08:28:07 +0000 (10:28 +0200)]
libsigrok-internal.h: fix source file references in comments
The src/hardware/ subdirectory exclusively contains device drivers these
days, while common support code has moved to the src/dmm/, src/lcr/,
src/scale/, etc directories or src/ itself. Adjust comments in the
libsigrok-internal.h declaration blocks which reference source files.
Gerhard Sittig [Mon, 2 Oct 2017 15:26:52 +0000 (16:26 +0100)]
device: rephrase sizeof() calls for reduced redundancy, use malloc0
Just allocate the memory needed to hold the very variable's size. No
need to duplicate the variable's type. Reduces redundancy and increases
robustness during maintenance.
Use g_malloc0() in sr_serial_new() to make sure all of the structure is
initialized.
Uwe Hermann [Mon, 22 Apr 2019 11:12:20 +0000 (13:12 +0200)]
sysclk-sla5032: Fix compiler warnings (max vs. MAX).
src/hardware/sysclk-sla5032/protocol.c: In function ‘la_start_acquisition’:
src/hardware/sysclk-sla5032/protocol.c:244:8: warning: implicit declaration of function ‘max’ [-Wimplicit-function-declaration]
pre = max(pre, 2);
^~~
Frank Stettner [Wed, 10 Apr 2019 09:54:37 +0000 (11:54 +0200)]
scpi-pps: Add config keys SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE and
SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE to HP 66xxA power supplies.
Frank Stettner [Tue, 9 Apr 2019 13:47:19 +0000 (15:47 +0200)]
scpi-pps: Add config keys SR_CONF_OVER_VOLTAGE_PROTECTION_ACTIVE,
SR_CONF_OVER_CURRENT_PROTECTION_ACTIVE and
SR_CONF_OVER_TEMPERATURE_PROTECTION_ACTIVE to HP 66xxB power supplies.
Frank Stettner [Wed, 20 Feb 2019 17:58:13 +0000 (18:58 +0100)]
demo: Set an initial mq, mq flag and digits to the analog package.
Without a measured quantity in packet.meaning->mq the C++ binding function
sigrok::Analog::mq() throws an exception and there is no way to check if
there is any measured quantity set in the analog package.
Wolfram Sang [Wed, 2 Jan 2019 12:15:25 +0000 (13:15 +0100)]
ols: add feature to support >256K memory
Add support for the Pepino-style of accessing >256K of memory. Because
this the only known extension of accessing >256K currently, we apply it
as soon as the sample size is bigger than 256K. Let's hope other
devices (if any) will follow this style. If not, we need to add support
depending on the device name later.
Wolfram Sang [Wed, 2 Jan 2019 12:15:24 +0000 (13:15 +0100)]
pipistrello: rename registers to match actual function
Magnus (creator of the Pipistrello) confirmed that he mixed up the
register names. The code was doing it correctly nonetheless but was
confusing to read because of this. Fix it to make it easier to
comprehend.
Wolfram Sang [Wed, 2 Jan 2019 12:15:20 +0000 (13:15 +0100)]
ols: refactor using max_channels
Let max_channels really carry the number of maximum channels the
hardware supports. We will handle the limitation of only half the
channels available in 200MHz mode later. Note that there won't be a
regression because we only set the variable but never check it. The
desired result of this patch is the removal of the NUM_CHANNELS macro.
The number of channels needs to be dealt with at runtime.
Wolfram Sang [Wed, 2 Jan 2019 12:15:17 +0000 (13:15 +0100)]
ols: drop wrong usage of macro
commit f51acd69 ("ols: combine demux samples") wrongly replaced the bit
pattern of 0x20 with the number of channels which just happens to be 32
as well. So, the code works but is confusing to read. Reword the
for-loop to make it more comprehensible.
Wolfram Sang [Wed, 2 Jan 2019 12:15:16 +0000 (13:15 +0100)]
ols: use 32bit for handling sample counts
The OLS protocol sends 16bit values to specify the sample count and
delay count. However, this 16bit value is the number of 32bit words to
be sampled, so the actual sample count is 4 times larger and does not
fit into a uint16_t. Extend it to support the full range of 256K
(LogicShrimp will need this) and to prepare support for devices with
even more memory (Pepino).
Gerhard Sittig [Thu, 5 Oct 2017 23:38:26 +0000 (01:38 +0200)]
uni-t-ut32x: rephrase the receive buffer and packets relation
The previous implementation assumed that a receive data chunk ends
exactly with a sensor packet's end. Yet the buffer had 32 bytes while
the packets have 19 bytes.
Separate the data reception from the packet processing. Collect whatever
chunks the USB connection provides, and scan the resulting buffer for
packets. Cope with either incomplete or corrupt or misaligned packets as
well as with multiple packets in receive chunks. The latter might happen
upon initial synchronization, when a device already sends data or the
serial port buffered previously communicated data.
In the regular case, the computer will process so fast that each single
character will be handled individually. We don't mind. The frequency is
some 60 times per second, and the data volume is 19 bytes. The software
works for the regular case, and synchronizes fast at startup or after
comm errors.
Gerhard Sittig [Thu, 5 Oct 2017 22:34:05 +0000 (00:34 +0200)]
uni-t-ut32x: improve robustness of packet parser, more diagnostics
Always print the data bytes of received buffers in the packet parser,
then check some more fixed fields to not process invalid packets, then
process the packet content as the previous implementation did.
Call the packet parser for incomplete packets and discarded input
buffers as well (initial synchronization, re-sync after comm errors).
This results in the availability of more diagnostics during development.
Pass the packet's location and size from outside. This prepares the
logic to cope with situations where the receive buffer contains multiple
(potentially incomplete) packets.
Gerhard Sittig [Thu, 5 Oct 2017 22:09:44 +0000 (00:09 +0200)]
uni-t-ut32x: use ASCII literals in packet parser, symbols for magic numbers
Slightly unobfuscate the UT32x packet parser. The protocol is mostly
ASCII based, checks for hex numbers may be unexpected. Use symbolic
identifiers for the packet length and some special characters.
Gerhard Sittig [Thu, 5 Oct 2017 09:35:25 +0000 (11:35 +0200)]
uni-t-ut32x: pre-set to default conn= spec
The previous implementation of the UT32x driver expected to see a conn=
spec, without it no device is found. Default to the USB identification
of the CH9325 chip, to make the driver work out of the box. Users still
can provide conn= specs and override the default for other cables.
Gerhard Sittig [Sun, 30 Dec 2018 11:31:20 +0000 (12:31 +0100)]
doc: update README.devices (USB detection, enable serial comm)
Slightly rephrase README.devices since there is no strict distinction
into "fully automatic" and "always manual". Some drivers _accept_ conn=
specs when provided, _and_ support automatic detection of enumerable
devices, _and_ might implement defaults but also support overrides.
Nit, numerically sort the list of Uni-T cables (which is about to grow
in the future) for improved readability.
Add two more devices which require users to manually enable the serial
communication (Brymen BM257s, EEVBlog 121GW).