Daniel Elstner [Tue, 6 Oct 2015 20:30:14 +0000 (22:30 +0200)]
util: Factor out Python module load
Create a utility function for loading a Python module by its name
in UTF-8.
Daniel Elstner [Tue, 6 Oct 2015 19:07:47 +0000 (21:07 +0200)]
decoder: Refactor loading code and plug leaks
Daniel Elstner [Sun, 4 Oct 2015 23:53:43 +0000 (01:53 +0200)]
Python: Restrict code to stable ABI subset
Limit usage of the Python C API to the stable ABI subset as defined
by PEP 384. This removes some type definitions and functions which
libsigrokdecode made use of. Convert all affected code to suitable
API alternatives. Also fix a few leaks that became apparent while
working on the code.
The most visible change is that PyTypeObject is now an opaque type.
Thus, the custom Decoder and srd_logic types are now created on the
heap via an alternative API. Unfortunately, since tp_name is now
inaccessible, type names had to be removed from the log output.
Stack traces after Python exceptions are now formatted by calling
into Python, since the trace object C API is no longer available.
Stefan Brüns [Sat, 3 Oct 2015 22:43:38 +0000 (00:43 +0200)]
usb_request: USB transaction decoder and PCAP generator
The new decoder stacks on top of the usb_packet PD. It adds one new
annotation row, and is able to save the decoded data as PCAP trace.
It has been successfully tested against all traces in sigrok-dumps and
some more traces.
Uwe Hermann [Tue, 6 Oct 2015 06:29:56 +0000 (08:29 +0200)]
usb_packet: Document CRC5 ERROR and CRC16 ERROR packets.
Uwe Hermann [Tue, 6 Oct 2015 06:28:03 +0000 (08:28 +0200)]
usb_{signalling,packet}: Minor cosmetics.
Stefan Brüns [Tue, 29 Sep 2015 22:24:24 +0000 (00:24 +0200)]
usb_signalling: Track USB symbol width to compensate frequency errors
USB low/full speed allows for frequency tolerance of 1.5%/0.25%. At
maximum packet size (sync + PID + data + CRC16) of 12 bytes/1027 bytes
this amounts to 1.4 bits/20 bits, so the decoder has to lock to the
actual symbol frequency to avoid any symbol misdetections.
The signal is sampled twice, once at the symbol center and once at
the expected edge position. Comparing the symbol at both positions gives
an indication if the current bit width is too low or too high. Adjust
accordingly.
Stefan Brüns [Wed, 30 Sep 2015 22:12:29 +0000 (00:12 +0200)]
usb_packet: calculate and check CRC5/CRC16
In case CRC validation fails, an crc5-err/crc16-err annotation is issued,
instead of crc5-ok/crc16-ok, and the error is noted in the annotation
text.
Roland Hieber [Sun, 4 Oct 2015 21:04:02 +0000 (23:04 +0200)]
rfm12: fix small typo
There is a small typo in the rfm12 protocol decoder that I just noticed:
Daniel Elstner [Sat, 3 Oct 2015 12:28:43 +0000 (14:28 +0200)]
tests: Do not reference parent directory in includes
Rely on the compiler include path instead.
Daniel Elstner [Sat, 3 Oct 2015 12:21:01 +0000 (14:21 +0200)]
tests: Rename DECODERS_DIR to DECODERS_TESTDIR
Avoid confusion resulting from using the same macro name for
different purposes.
Daniel Elstner [Sat, 3 Oct 2015 12:17:07 +0000 (14:17 +0200)]
build: Do not hard-code decoders location on Windows
Daniel Elstner [Sat, 3 Oct 2015 11:18:09 +0000 (13:18 +0200)]
init: Also look for decoders in XDG data directories
Daniel Elstner [Sat, 3 Oct 2015 09:40:33 +0000 (11:40 +0200)]
init: Simplify srd_decoder_searchpath_add()
Don't mess with colon-separated search path strings -- instead,
simply prepend items to the sys.path list object. Also keep the
internal decoder path list in the same order as the items added
to sys.path.
Daniel Elstner [Tue, 15 Sep 2015 09:42:05 +0000 (11:42 +0200)]
jitter, pwm: Avoid Unicode string literals
It seems the Python we ship along our Windows binaries does not
support u"..." strings, even though it's been a language feature
since Python 2. Remove the "u" prefix to avoid a syntax error.
Also, consistently use format "%.1f" at all scales.
This fixes bug #569.
Uwe Hermann [Mon, 14 Sep 2015 17:05:54 +0000 (19:05 +0200)]
can: Improve stuff bit annotation placement.
Uwe Hermann [Mon, 14 Sep 2015 16:25:02 +0000 (18:25 +0200)]
can: Emit bit value annotations.
Uwe Hermann [Mon, 14 Sep 2015 15:56:46 +0000 (17:56 +0200)]
Makefile.am: Shorten ChangeLog target a bit.
Daniel Elstner [Sun, 13 Sep 2015 21:05:42 +0000 (23:05 +0200)]
log: Use GLib printf for consistency
Just as in libsigrok, use g_vfprintf() in the log callback to make
sure we are linking to a standard-conforming printf implementation.
Daniel Elstner [Sun, 13 Sep 2015 20:10:54 +0000 (22:10 +0200)]
Build: Move _POSIX_C_SOURCE definition to config.h
Do not redefine it though when already set, so that it can be
overridden by the user, or indirectly by the compiler settings.
Daniel Elstner [Sun, 13 Sep 2015 20:07:11 +0000 (22:07 +0200)]
Build: Include <config.h> first in all source files
Since Autoconf places some important feature flags only into the
configuration header, it is necessary to include it globally to
guarantee a consistent build.
Daniel Elstner [Sun, 13 Sep 2015 20:01:34 +0000 (22:01 +0200)]
Fix srd_log() format warnings
Daniel Elstner [Sun, 13 Sep 2015 19:32:27 +0000 (21:32 +0200)]
log: Enable varargs format warnings
Decorate srd_log() with the GCC format printf attribute so that the
compiler can check the format string and arguments for consistency.
Also remove the srd_err(), sr_warn(), etc. functions and replace
them with macro wrappers around srd_log().
Daniel Elstner [Sun, 13 Sep 2015 19:10:40 +0000 (21:10 +0200)]
log: Remove srd_log_logdomain_{get,set} from the API
The confusingly named srd_log_logdomain_set() simply set a global
string prefixed to the log message by the default log callback.
This is pretty much useless, misleadingly named, and not used by
either sigrok-cli or PulseView.
Uwe Hermann [Thu, 10 Sep 2015 16:19:47 +0000 (18:19 +0200)]
instance.c: Don't use 'di' before NULL-checking it.
Daniel Elstner [Thu, 10 Sep 2015 16:45:50 +0000 (18:45 +0200)]
Build: Put --no-print-directory into GNUMAKEFLAGS
Also output the compiler version in the configuration summary.
Daniel Elstner [Thu, 10 Sep 2015 16:44:55 +0000 (18:44 +0200)]
sigrok.m4: Update with latest version from libsigrok
Daniel Elstner [Sun, 6 Sep 2015 08:53:54 +0000 (10:53 +0200)]
libsigrokdecode.pc: Publish decodersdir variable
This is so that downstream modules can find the install location
of the decoders.
Daniel Elstner [Sun, 6 Sep 2015 08:51:22 +0000 (10:51 +0200)]
Build: Show CC and CFLAGS in configuration summary
Uwe Hermann [Thu, 3 Sep 2015 07:19:56 +0000 (09:19 +0200)]
jtag_stm32: Decode IDCODE contents as strings (not just hex vals).
Uwe Hermann [Thu, 3 Sep 2015 06:36:21 +0000 (08:36 +0200)]
jtag_stm32: Decode more fields, improve IDCODE handling.
Uwe Hermann [Wed, 2 Sep 2015 19:06:01 +0000 (21:06 +0200)]
jtag_stm32: Cleanups, shorter code.
Uwe Hermann [Wed, 2 Sep 2015 18:49:47 +0000 (20:49 +0200)]
jtag_stm32: Update to reflect change in jtag OUT_PYTHON.
Uwe Hermann [Wed, 2 Sep 2015 18:49:20 +0000 (20:49 +0200)]
jtag: Submit bit samplenumbers together with the bits.
Uwe Hermann [Tue, 1 Sep 2015 18:13:27 +0000 (20:13 +0200)]
jtag_stm32: Fix incorrect handling of registers.
The STM32F10xxx has two serially connected JTAG TAPs, the boundary scan tap
(5 bits) and the Cortex-M3 TAP (4 bits). See UM 31.5 "STM32F10xxx JTAG TAP
connection" for details.
Due to this, we need to ignore the last bit of each data shift (and we
currently ignore the 5 bits of the boundary scan tap).
Uwe Hermann [Sat, 15 Aug 2015 22:37:34 +0000 (00:37 +0200)]
jtag: Add more annotations, fix a SHIFT-IR/-DR issue.
The code was previously not decoding a bit for the first state change
to SHIFT-IR/-DR, which was incorrect.
Uwe Hermann [Fri, 14 Aug 2015 18:05:34 +0000 (20:05 +0200)]
jtag: Fix/enable OUT_PYTHON output.
Uwe Hermann [Fri, 28 Aug 2015 17:25:09 +0000 (19:25 +0200)]
Replace another -D_DEFAULT_SOURCE with -D_POSIX_C_SOURCE=200112L.
Uwe Hermann [Fri, 28 Aug 2015 16:34:34 +0000 (18:34 +0200)]
Build: Go back to _POSIX_C_SOURCE=200112L
Daniel Elstner [Wed, 26 Aug 2015 21:12:28 +0000 (23:12 +0200)]
configure: Enable largefile support on 32-bit systems
Daniel Elstner [Wed, 26 Aug 2015 12:07:39 +0000 (14:07 +0200)]
Build: Define feature test macro _DEFAULT_SOURCE
This basically makes glibc expose the same set of features as
if gcc was invoked without any restricting -std=c* option. Unlike
_GNU_SOURCE however, it does not enable GNU-specific extensions.
So, with this macro defined the behavior of Linux with glibc
should match that of other platforms.
Daniel Elstner [Wed, 26 Aug 2015 11:01:16 +0000 (13:01 +0200)]
Build: Use TESTS prefix instead of CHECK for flag variables
In order to avoid confusion of the flags-gathering pkg-config
result with the actual test for the availability of "check",
change the pkg-config output variable prefix from CHECK to TESTS.
Daniel Elstner [Tue, 25 Aug 2015 01:06:33 +0000 (03:06 +0200)]
Clean up .gitignore
Daniel Elstner [Tue, 25 Aug 2015 00:59:48 +0000 (02:59 +0200)]
Build: Adopt new Autotools magic
Daniel Elstner [Mon, 24 Aug 2015 19:09:47 +0000 (21:09 +0200)]
Build: Reduce autogen.sh to trivial stub
Use autoreconf instead of invoking the various Auto tools
separately. Get rid of the Darwin-specific guesswork -- it does
not make sense to handle this at the level of libsigrokdecode.
People should set up their ACLOCAL_PATH themselves as appropriate
for their own system; just as they already need to set up various
other paths.
Daniel Elstner [Mon, 24 Aug 2015 19:07:42 +0000 (21:07 +0200)]
Build: Add copy of libsigrok Autoconf macro file
Uwe Hermann [Fri, 21 Aug 2015 12:50:04 +0000 (14:50 +0200)]
nunchuk: Fix inverted button press logic.
The buttons are pressed if the respective bit is 0.
Uwe Hermann [Thu, 20 Aug 2015 17:36:12 +0000 (19:36 +0200)]
Pass unitsize per sample chunk.
Don't pass unitsize to srd_inst_channel_set_all(), have that only
set the channel map. Instead, srd_session_send() now has a parameter
for the unitsize which is passed with every new chunk to be decoded.
This is in preparation to fix issues with devices or files which
have a unitsize != 1 and where the "guessed" unitsize based on the
number of channels is not correct.
This also allows for (potential) future changes where every chunk can
indeed have a different unitsize.
This fixes (parts of) bug #352.
Uwe Hermann [Tue, 18 Aug 2015 06:24:29 +0000 (08:24 +0200)]
mrf24j40: Fix a register address typo.
Uwe Hermann [Mon, 17 Aug 2015 20:04:46 +0000 (22:04 +0200)]
tlc5620: Add options for per-DAC Vref, show voltages.
Instead of showing raw values in the annotations, calculate the
actual voltage (based on raw value, gain, and Vref) and use that.
Uwe Hermann [Mon, 17 Aug 2015 20:05:06 +0000 (22:05 +0200)]
tlc5620: Handle the case of less than 11 bits in a command.
Uwe Hermann [Mon, 17 Aug 2015 20:01:37 +0000 (22:01 +0200)]
tlc5620: Properly handle LOAD and LDAC based operations.
- If LOAD goes low *and* LDAC is already low, the voltage is set
immediately.
- If LOAD goes low but LDAC is high, the value is only written into
an internal register, but the voltage is not changed (yet).
- If LDAC goes low, all four DAC voltages (DAC A/B/C/D) are set
according to the respective register values at the same time.
Uwe Hermann [Mon, 17 Aug 2015 19:46:22 +0000 (21:46 +0200)]
tlc5620: Only decode the last 11 bits, ignore the rest.
Uwe Hermann [Mon, 17 Aug 2015 19:28:21 +0000 (21:28 +0200)]
tlc5620: Fix incorrect DAC selection decode, add more annotations.
Uwe Hermann [Fri, 14 Aug 2015 17:01:39 +0000 (19:01 +0200)]
usb_packet: Handle invalid packets more gracefully.
Previously the PD was blindly trying to decode any packet, no matter
whether it was too short (and/or bogus) or not, causing issues like this:
srd: Calling usb_packet decode(): IndexError: list index out of range
Such cases of invalid input are now handled better by emitting "UNKNOWN"
and "Invalid packet" annotations.
This fixes bug #186.
Uwe Hermann [Fri, 14 Aug 2015 11:48:08 +0000 (13:48 +0200)]
usb_packet: Fix incorrect DATA*/MDATA handling.
Thanks to Pavel Sukortsev for the bug report and fix.
This fixes bug #623.
Uwe Hermann [Thu, 6 Aug 2015 17:27:04 +0000 (19:27 +0200)]
Add initial SD card (SD mode) decoder.
In the current state the decoder can decode the following commands:
CMD0, CMD2, CMD3, CMD6, CMD7, CMD8, CMD9, CMD10, CMD13, CMD16, CMD55,
ACMD6, ACMD13, ACMD41, ACMD51.
Other commands (and more details for existing commands) will be added later.
Uwe Hermann [Thu, 23 Jul 2015 15:12:41 +0000 (17:12 +0200)]
Slightly more verbose logging in srd_inst_decode().
Uwe Hermann [Sat, 18 Jul 2015 16:04:08 +0000 (18:04 +0200)]
Bump version to 0.4.0 (the upcoming next major release).
Uwe Hermann [Sat, 18 Jul 2015 15:59:19 +0000 (17:59 +0200)]
Append "-git" to the version string.
This avoids confusion with the released tarballs.
Bart de Waal [Mon, 13 Jul 2015 21:59:55 +0000 (23:59 +0200)]
Add protocol decoder for Modbus RTU.
Josef Gajdusek [Thu, 9 Jul 2015 10:54:28 +0000 (12:54 +0200)]
qi: Add Qi charger protocol decoder
Aurelien Jacobs [Sat, 6 Jun 2015 20:05:06 +0000 (22:05 +0200)]
Add an MDIO/SMI decoder.
Uwe Hermann [Tue, 30 Jun 2015 23:21:53 +0000 (01:21 +0200)]
adns5020: Minor tweak to annotation format.
Uwe Hermann [Tue, 30 Jun 2015 22:59:23 +0000 (00:59 +0200)]
mrf24j40: Factor out register lists to lists.py.
Karl Palsson [Wed, 27 May 2015 01:25:16 +0000 (01:25 +0000)]
Add a Microchip MRF24J40 802.15.4 2.4GHz RF tranceiver decoder.
No interpretation of register bits, nor attempting to decode packet contents,
but all shifted register addresses and long register memory regions are
decoded.
Signed-off-by: Karl Palsson <redacted>
Uwe Hermann [Mon, 22 Jun 2015 13:15:17 +0000 (15:15 +0200)]
adns5020: Add manufacturer name to description.
Karl Palsson [Sat, 16 May 2015 17:14:50 +0000 (17:14 +0000)]
Add Avago ADNS-5020 optical mouse sensor decoder.
Decodes reads/writes of registers. Understands resetting on chip select if
provided. Does not understand burst mode.
Signed-off-by: Karl Palsson <redacted>
Karl Palsson [Sat, 30 May 2015 20:28:55 +0000 (20:28 +0000)]
am23xx: explicitly mention RHTxx devices.
Include their compatibility in the dropdown options too.
Uwe Hermann [Sun, 26 Apr 2015 15:53:24 +0000 (17:53 +0200)]
timing: Shorten annotations (time units).
Baruch Even [Sat, 4 Apr 2015 19:21:34 +0000 (21:21 +0200)]
Add a decoder that calculates timings between transitions.
Uwe Hermann [Sat, 4 Apr 2015 18:41:24 +0000 (20:41 +0200)]
spiflash: Add lists.py and a 'chips' PD option.
Uwe Hermann [Sat, 4 Apr 2015 17:41:44 +0000 (19:41 +0200)]
Rename the 'mx25lxx05d' PD to 'spiflash'.
This is in preparation of making the PD more generic so it can support
a lot more xx25 series SPI (NOR) flash chips.
Uwe Hermann [Sat, 4 Apr 2015 16:34:42 +0000 (18:34 +0200)]
Fix a bunch of typos.
Uwe Hermann [Tue, 7 Apr 2015 00:36:47 +0000 (02:36 +0200)]
autogen.sh: Drop obsolete MinGW/MSYS items.
For Windows builds (which require MinGW-w64) we currently support:
- cross-builds using MXE (mxe.cc) and possibly other cross-compile setups
- native builds using MSYS2 (sf.net/projects/msys2/)
Neither of those require explicitly specifying ACLOCAL_DIR.
Uwe Hermann [Fri, 3 Apr 2015 21:21:59 +0000 (23:21 +0200)]
onewire_link: Fix a bug when the samplerate is too low for the PD.
The code was trying to emit annotations before
self.register(srd.OUTPUT_ANN) was run.
This fixes bug #357.
Uwe Hermann [Fri, 3 Apr 2015 20:50:41 +0000 (22:50 +0200)]
Makefile.am: Use libtool's -no-undefined option.
Andreas Sandberg [Fri, 13 Feb 2015 21:42:01 +0000 (21:42 +0000)]
spi: Don't decode data lines if CS isn't asserted
Avoid decoding and outputting data from the SPI bus if the CS pin
hasn't been asserted. This avoids confusing both users and stacked
decoders which otherwise end up seeing traffic intended for other
chips (or just noise).
Note: The old behavior of decoding all traffic is still in place if
no CS pin has been wired up to the decoder.
This fixes bug #559.
Uwe Hermann [Thu, 2 Apr 2015 20:48:03 +0000 (22:48 +0200)]
Slightly shorten a few PD descriptions.
Petteri Aimonen [Sat, 7 Mar 2015 14:14:19 +0000 (16:14 +0200)]
Add a decoder for stepper motor direction/speed signals.
Petteri Aimonen [Sat, 7 Mar 2015 13:55:18 +0000 (15:55 +0200)]
Fix a few decoding bugs with arm_etmv3.
Fixed:
- wrong address decoding for some branches
- error in annotation lists for exception entry/exit
- exception was being thrown for 0E0N p-header packets
- fixes to objdump output parsing, better function name & source code matching
New features:
- added decoding of IRQ names for branch exception info
- added support for -C option to objdump to decode C++ symbol names
- put branches on the "Exceptions" annotation row when they contain exception info.
Matt Porter [Tue, 31 Mar 2015 03:59:38 +0000 (23:59 -0400)]
pwm: add period annotation
Uwe Hermann [Sat, 7 Mar 2015 18:12:15 +0000 (19:12 +0100)]
Use g_malloc*() consistently, simplify error handling.
Use g_malloc*() for small allocations and assume they always
succeed. Simplify error handling in a few places accordingly.
Document the rules in the README file.
Uwe Hermann [Sat, 28 Feb 2015 13:18:56 +0000 (14:18 +0100)]
unit tests: Drop unneeded check_ filename prefix.
Uwe Hermann [Wed, 25 Mar 2015 08:41:23 +0000 (09:41 +0100)]
mx25lxx05d: Implement FAST READ command.
Petteri Aimonen [Mon, 23 Feb 2015 17:47:56 +0000 (19:47 +0200)]
Fix typo in swd decoder
Petteri Aimonen [Mon, 23 Feb 2015 17:49:06 +0000 (19:49 +0200)]
Add ARM TPIU/ITM/ETMv3 decoders
Uwe Hermann [Tue, 24 Feb 2015 20:46:04 +0000 (21:46 +0100)]
nrf24l01: Change 'xn297_extensions' option to 'chip'.
This allows for easily extending the PD to support other clones or
compatibles of the nRF24L01(+) chip as well.
Mike [Fri, 6 Feb 2015 16:42:32 +0000 (16:42 +0000)]
nrf24l01: Add option to support the XN297's extra registers
Petteri Aimonen [Sun, 15 Feb 2015 17:08:36 +0000 (19:08 +0200)]
Improve uart decoder sample positions at high data rates.
At 3 samples per bit, the uart decoder took the value at the last sample
instead of the middle one. Improve calculations so that sampling is more
accurate at odd number of samples per bit.
Uwe Hermann [Sat, 31 Jan 2015 22:39:02 +0000 (23:39 +0100)]
unit tests: Disable timeout for one of the test cases.
This one can take a while, thus disable the timeout.
Uwe Hermann [Sat, 24 Jan 2015 19:46:18 +0000 (20:46 +0100)]
README: Update build requirements list.
Uwe Hermann [Wed, 19 Nov 2014 17:57:56 +0000 (18:57 +0100)]
Add 24xx I2C EEPROM protocol decoder.
Uwe Hermann [Sun, 28 Dec 2014 13:33:50 +0000 (14:33 +0100)]
spi: Add binary output facilities for MISO/MOSI.
This fixes bug #424.
Bert Vermeulen [Tue, 16 Dec 2014 13:51:47 +0000 (14:51 +0100)]
edid: Add annotation rows.
Bert Vermeulen [Tue, 16 Dec 2014 13:51:19 +0000 (14:51 +0100)]
eded: Add all sections.
Uwe Hermann [Sun, 23 Nov 2014 22:06:45 +0000 (23:06 +0100)]
jitter: Simplify ascii-float binary out.
This also outputs one item of OUT_BINARY per jitter value (not one
item per ASCII character in the ASCII floating point number).
Uwe Hermann [Sun, 23 Nov 2014 21:55:54 +0000 (22:55 +0100)]
jitter: Rename "jitter" binary out to "ascii-float".
Sebastien Bourdelin [Thu, 13 Nov 2014 20:50:43 +0000 (15:50 -0500)]
jitter: add a binary output to report the raw jitter value.
Signed-off-by: Sebastien Bourdelin <redacted>
Sebastien Bourdelin [Wed, 12 Nov 2014 17:42:03 +0000 (12:42 -0500)]
jitter: fixes an error when a miss clock/signal is detected
Signed-off-by: Sebastien Bourdelin <redacted>