]> sigrok.org Git - libsigrokdecode.git/log
libsigrokdecode.git
7 years agovalgrind: safely iterate lists
Karl Palsson [Fri, 25 Nov 2016 13:55:56 +0000 (13:55 +0000)]
valgrind: safely iterate lists

Old versions triggered valgrind errors as the API method to remove an
entry modifies the list that was being iterated.

Signed-off-by: Karl Palsson <redacted>
8 years agospiflash: Major refactoring and annotation improvements.
Uwe Hermann [Sun, 6 Nov 2016 19:14:43 +0000 (20:14 +0100)]
spiflash: Major refactoring and annotation improvements.

8 years agospiflash: Use OrderedDict for cmds, more readable annotation indices.
Uwe Hermann [Sun, 6 Nov 2016 17:16:57 +0000 (18:16 +0100)]
spiflash: Use OrderedDict for cmds, more readable annotation indices.

8 years agospiflash: Initial RDSR2 implementation (incomplete).
Uwe Hermann [Sun, 6 Nov 2016 16:55:13 +0000 (17:55 +0100)]
spiflash: Initial RDSR2 implementation (incomplete).

This is not entirely correct yet, will be fixed later.

8 years agospiflash: Implement WRSR command.
Uwe Hermann [Sun, 6 Nov 2016 16:49:28 +0000 (17:49 +0100)]
spiflash: Implement WRSR command.

8 years agospiflash: Add FIDELIX FM25Q32 metadata.
Uwe Hermann [Sun, 30 Oct 2016 10:28:38 +0000 (11:28 +0100)]
spiflash: Add FIDELIX FM25Q32 metadata.

8 years agospiflash: Remove hardcoded Macronix references.
Uwe Hermann [Mon, 24 Oct 2016 00:02:12 +0000 (02:02 +0200)]
spiflash: Remove hardcoded Macronix references.

8 years agospiflash: Implement Release Power-down / Device ID (0xAB) command.
Uwe Hermann [Sun, 23 Oct 2016 22:36:45 +0000 (00:36 +0200)]
spiflash: Implement Release Power-down / Device ID (0xAB) command.

This fixes bug #845.

8 years agops2: Add more detailed per-bit annotations.
Uwe Hermann [Fri, 4 Nov 2016 01:04:03 +0000 (02:04 +0100)]
ps2: Add more detailed per-bit annotations.

8 years agops2: Neither the clock nor the data pin is optional.
Uwe Hermann [Thu, 3 Nov 2016 23:19:51 +0000 (00:19 +0100)]
ps2: Neither the clock nor the data pin is optional.

8 years agoAdd initial version of PS/2 decoder
Daniel Schulte [Sun, 16 Oct 2016 09:51:24 +0000 (11:51 +0200)]
Add initial version of PS/2 decoder

8 years agoPrint error messages when decoders fail load time checks
Gerhard Sittig [Sun, 16 Oct 2016 16:25:29 +0000 (18:25 +0200)]
Print error messages when decoders fail load time checks

Several checks get applied when loading externally provided protocol
decoders. Print error messages when checks fail, so that developers can
better resolve issues.

The sequence of tests terminates upon the first failed check, while
decoders may suffer from several issues at the same time. This is
considered acceptable, as it reduces the commit's size and the code's
complexity. This commit only adds error messages, and does not change
logic/behaviour.

Failed API version checks result in two messages: One specific message
which reflects the decoder's version and what's supported by the loader,
and a generic message that the API version check has failed. This is
done to simplify the logic of a rarely used error code path.

This commit addresses libsigrokdecode Bug 704, and allows to identify
decoders from parallel installations of differing version.

This fixes bug #704.

Signed-off-by: Gerhard Sittig <redacted>
8 years ago.gitattributes: introduce git attributes for improved Python diffs
Gerhard Sittig [Sun, 16 Oct 2016 16:25:25 +0000 (18:25 +0200)]
.gitattributes: introduce git attributes for improved Python diffs

In the absence of respective instructions, git will use a rather generic
approach to generate diffs and patches. Introduce a git attributes file
which results in improved output for Python sources (i.e. all protocol
decoders).

Signed-off-by: Gerhard Sittig <redacted>
8 years agospi: Fix binary output for wordsizes > 8.
Uwe Hermann [Sun, 23 Oct 2016 19:01:08 +0000 (21:01 +0200)]
spi: Fix binary output for wordsizes > 8.

For wordsizes > 8, multiple bytes are used (big-endian).

This fixes bug #686.

8 years agouart: Default to hex format datavalue annotations.
Uwe Hermann [Sun, 23 Oct 2016 16:35:01 +0000 (18:35 +0200)]
uart: Default to hex format datavalue annotations.

This is in almost all cases what the user will want, only rarely ASCII
(the old default) will be the more natural fit.

8 years agouart: Emit 2 bytes for 9-bit UART binary output.
Uwe Hermann [Fri, 23 Sep 2016 20:19:57 +0000 (22:19 +0200)]
uart: Emit 2 bytes for 9-bit UART binary output.

For 5..8 data bits the binary output will be 1 byte, for 9 data bits
it will be 2 bytes (big-endian).

This fixes bug #708.

8 years agouart: skip frames with invalid start bits
Gerhard Sittig [Sun, 16 Oct 2016 16:26:18 +0000 (18:26 +0200)]
uart: skip frames with invalid start bits

When the start bit is not low at its sample point, then stop trying
to interpret the remaining frame -- it's already known to be invalid,
anyway.

Wait for the next start bit instead, assuming that either the falling
edge which started the inspection of the UART frame and its start bit
was a spurious glitch or that the captured signal does not communicate
at the decoder's configured bitrate.

Signed-off-by: Gerhard Sittig <redacted>
8 years agouart: rework text formatting of communicated data values, plus nits
Gerhard Sittig [Sun, 16 Oct 2016 16:25:28 +0000 (18:25 +0200)]
uart: rework text formatting of communicated data values, plus nits

Factor out the code which generates a textual representation for the
numeric values that were communicated via UART bit patterns. Make the
width of the output text depend on the number of bits in the UART frame
(five to nine) instead of assuming bytes of exactly eight bits.

Fix other minor issues while we are here: Nine bits result in a number
range of 0 to 511 (not 512). ASCII codes 30 and 31 are non-printables.
The previous implementation skipped a significant leading digit in the
octal representation.

Signed-off-by: Gerhard Sittig <redacted>
8 years agouart: minor nit, rename the "databyte" variable
Gerhard Sittig [Sun, 16 Oct 2016 16:25:27 +0000 (18:25 +0200)]
uart: minor nit, rename the "databyte" variable

Given the generic nature of UART communication and the supported range
for the data width, "byte" may be a misleading name for the numeric
value that gets communicated in five to nine data bits. Rename the
"databyte" variable to "datavalue".

Signed-off-by: Gerhard Sittig <redacted>
8 years agoAdd an initial GPIB decoder.
Rudolf Reuter [Wed, 12 Oct 2016 00:51:28 +0000 (02:51 +0200)]
Add an initial GPIB decoder.

8 years agomidi: Add missing copyright lines.
Uwe Hermann [Sat, 24 Sep 2016 12:04:05 +0000 (14:04 +0200)]
midi: Add missing copyright lines.

8 years agomidi: Random cosmetic cleanups.
Uwe Hermann [Sat, 24 Sep 2016 11:36:19 +0000 (13:36 +0200)]
midi: Random cosmetic cleanups.

8 years agomidi: Simplify some boolean tests.
Uwe Hermann [Sat, 24 Sep 2016 11:23:49 +0000 (13:23 +0200)]
midi: Simplify some boolean tests.

8 years agomidi: Use "is" or "is not" with None.
Uwe Hermann [Sat, 24 Sep 2016 11:20:39 +0000 (13:20 +0200)]
midi: Use "is" or "is not" with None.

8 years agousb_request: Use "is" or "is not" with None.
Uwe Hermann [Sat, 24 Sep 2016 11:20:16 +0000 (13:20 +0200)]
usb_request: Use "is" or "is not" with None.

8 years agomidi: Add support for complex MIDI message formats (inter-related).
Chris [Mon, 12 Sep 2016 01:14:44 +0000 (18:14 -0700)]
midi: Add support for complex MIDI message formats (inter-related).

 - Handle "Running Status" where status byte can be omitted
 - SysEx message can be terminated by status byte, not just EOX
 - Handle SysReal messages that interrupt in-progress message transmission
 - Identify and print garbage / truncated data
 - Add 2 new annotations: text-sysreal-verbose and text-error

8 years agomidi: chromatic_notes in list.py was off by 1 octave
Chris [Mon, 5 Sep 2016 19:42:42 +0000 (12:42 -0700)]
midi: chromatic_notes in list.py was off by 1 octave

(ex: note 60 is middle C which is C4, not C3)

8 years agouart: Fix a bug in the output for stacked PDs.
Uwe Hermann [Sat, 24 Sep 2016 10:22:57 +0000 (12:22 +0200)]
uart: Fix a bug in the output for stacked PDs.

The UART bit information was not transmitted correctly to stacked PDs
if there was an overlap between RX and TX bytes in the data.

8 years agomidi: Some annotation consistency changes.
Uwe Hermann [Sun, 4 Sep 2016 17:14:10 +0000 (19:14 +0200)]
midi: Some annotation consistency changes.

8 years agoUpdates each annotation with multiple strings ranging from long, medium, and short...
Chris [Sat, 27 Aug 2016 04:35:03 +0000 (21:35 -0700)]
Updates each annotation with multiple strings ranging from long, medium, and short lengths

8 years agousb_power_delivery: Drop problematic exception in us2samples().
Uwe Hermann [Fri, 26 Aug 2016 06:59:07 +0000 (08:59 +0200)]
usb_power_delivery: Drop problematic exception in us2samples().

This causes an issue when running the sigrok-test test-cases, so drop
it for now (the same check already exists in decode()).

This fixes bug #758.

8 years agosrd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0.
Uwe Hermann [Thu, 25 Aug 2016 20:34:55 +0000 (22:34 +0200)]
srd_inst_decode(): Return SRD_ERR_ARG if unitsize is 0.

8 years agosrd_inst_decode(): Make the code API version dependent.
Uwe Hermann [Thu, 25 Aug 2016 20:26:41 +0000 (22:26 +0200)]
srd_inst_decode(): Make the code API version dependent.

8 years agoFactor out srd_decoder_apiver().
Uwe Hermann [Thu, 25 Aug 2016 20:22:07 +0000 (22:22 +0200)]
Factor out srd_decoder_apiver().

8 years agosrd_inst_decode(): Improve comments and log messages.
Uwe Hermann [Thu, 25 Aug 2016 20:01:04 +0000 (22:01 +0200)]
srd_inst_decode(): Improve comments and log messages.

Also, drop @since tag (as the function is not public).

8 years agosrd_session_send(): Improve Doxygen comments.
Uwe Hermann [Thu, 25 Aug 2016 19:57:39 +0000 (21:57 +0200)]
srd_session_send(): Improve Doxygen comments.

8 years agossi32: Slightly more descriptive naming.
Uwe Hermann [Tue, 23 Aug 2016 18:07:54 +0000 (20:07 +0200)]
ssi32: Slightly more descriptive naming.

8 years agomidi: Substantially improve decoding of MIDI messages.
Chris Dreher [Fri, 19 Aug 2016 17:26:02 +0000 (10:26 -0700)]
midi: Substantially improve decoding of MIDI messages.

 * Decode note names and percussion names (ex: 'G2', 'Tambourine').
 * Decode instrument names and drum_kit names (ex: 'Flute', 'GS Orchestra Kit').
 * Handle Polyphonic Pressure / Aftertouch (message 0xAn).
 * Handle Program Change (message 0xCn).
 * Handle Channel Pressure / Aftertouch (message 0xDn).
 * Handle Channel Mode (message 0xBn mm where mm is 120 through 127).
 * Handle System Common messages (message 0xF1 through 0xF6), including
   full time code decoding.
 * SysEx decoding now decodes the 1-3 byte manufacturer field, payload
   is now displayed as hex.
 * 'undefined' fields now display the value (ex: 'undefined 0xf4').
 * Add 'MSB' and 'LSB' to many control_functions entries.
 * Fix "trapped in state X" bug with handle_channel_msg_generic(),
   though this might be dead code.
 * Fix bug in sysex_manufacturer_ids; 1-byte manufacturers were not
   tuples due to missing comma.
 * Fix bug in SysEx decoding state machine; 0xF7 now sent to handle_sysex_msg().

8 years agossi32: Minor cosmetics, add full license header (for consistency).
Uwe Hermann [Sun, 21 Aug 2016 22:16:49 +0000 (00:16 +0200)]
ssi32: Minor cosmetics, add full license header (for consistency).

8 years agoAdd Bosch SSI32 protocol decoder.
Oleksij Rempel [Sun, 21 Aug 2016 21:08:57 +0000 (23:08 +0200)]
Add Bosch SSI32 protocol decoder.

Signed-off-by: Oleksij Rempel <redacted>
Signed-off-by: Oleksij Rempel <redacted>
8 years agoAdd a DMX512 protocol decoder
cbdev [Wed, 29 Jun 2016 16:39:10 +0000 (18:39 +0200)]
Add a DMX512 protocol decoder

8 years agotiming: Add frequency and averaging support.
Uwe Hermann [Tue, 28 Jun 2016 20:23:09 +0000 (22:23 +0200)]
timing: Add frequency and averaging support.

This patch was contributed by James Sleeman <redacted>, thanks!

8 years agospiflash: Add a 'format' option.
Uwe Hermann [Wed, 22 Jun 2016 20:16:09 +0000 (22:16 +0200)]
spiflash: Add a 'format' option.

8 years agospiflash: Perf tweak: Build handler lookup table once per decoder
Angus Gratton [Sun, 22 May 2016 01:47:57 +0000 (11:47 +1000)]
spiflash: Perf tweak: Build handler lookup table once per decoder

8 years agospiflash: Handle "Fast Read Dual I/O"
Angus Gratton [Sun, 22 May 2016 01:43:45 +0000 (11:43 +1000)]
spiflash: Handle "Fast Read Dual I/O"

8 years agospiflash: Handle CS# transitions, allow variable-length transfers
Angus Gratton [Sun, 22 May 2016 01:42:52 +0000 (11:42 +1000)]
spiflash: Handle CS# transitions, allow variable-length transfers

8 years agoConsistency renames of {ss,es}_ variables.
Uwe Hermann [Thu, 19 May 2016 16:38:05 +0000 (18:38 +0200)]
Consistency renames of {ss,es}_ variables.

8 years agoMove common/ directory into decoders/.
Uwe Hermann [Tue, 24 May 2016 19:42:02 +0000 (21:42 +0200)]
Move common/ directory into decoders/.

This simplifies cross-platform handling of the Python/decoder paths
and module installation/dist a bit and also fixes bug #804.

8 years agoAdd decoder for em4305 RFID protocol
Benjamin Larsson [Wed, 11 May 2016 18:40:54 +0000 (20:40 +0200)]
Add decoder for em4305 RFID protocol

8 years agoUse consistent __init__() format across all PDs.
Uwe Hermann [Sun, 15 May 2016 13:42:48 +0000 (15:42 +0200)]
Use consistent __init__() format across all PDs.

The previous **kwargs some PDs had is not actually ever used, so drop it.

8 years agousb_request: Drop hardcoded samplerate.
Uwe Hermann [Wed, 11 May 2016 16:55:13 +0000 (18:55 +0200)]
usb_request: Drop hardcoded samplerate.

The libsigrokdecode backend now passes metadata (e.g. samplerate) to all
PDs, stacked and non-stacked (see bug #664), so this interim solution is no
longer needed.

8 years agoSupply metadata to stacked decoders
Stefan Brüns [Sat, 3 Oct 2015 14:26:23 +0000 (16:26 +0200)]
Supply metadata to stacked decoders

Currently only toplevel decoders receive the samplerate, thus stacked
decoders are not able to derive e.g. timestamps from the sample number.

This fixes bug #664.

8 years agowiegand: Make bitwidth_ms option values integer (not string).
Uwe Hermann [Wed, 11 May 2016 16:39:02 +0000 (18:39 +0200)]
wiegand: Make bitwidth_ms option values integer (not string).

8 years agoAdd wiegand decoder.
Sean Burford [Tue, 10 May 2016 07:25:21 +0000 (17:25 +1000)]
Add wiegand decoder.

8 years agoConsistently use ' instead of " for strings in all PDs.
Uwe Hermann [Wed, 4 May 2016 17:15:06 +0000 (19:15 +0200)]
Consistently use ' instead of " for strings in all PDs.

8 years agoFactor out SD card lists into common/sdcard.
Uwe Hermann [Thu, 5 May 2016 17:56:58 +0000 (19:56 +0200)]
Factor out SD card lists into common/sdcard.

These are used by the sdcard_spi and sdcard_sd decoders.

8 years agoFactor out bcd2int() into common/srdhelper.
Uwe Hermann [Wed, 4 May 2016 17:56:40 +0000 (19:56 +0200)]
Factor out bcd2int() into common/srdhelper.

8 years agoHave one subdirectory per module in common/ as well.
Uwe Hermann [Wed, 4 May 2016 17:35:18 +0000 (19:35 +0200)]
Have one subdirectory per module in common/ as well.

This is consistent with decoders/, conveniently allows for more than one
file per module, and also happens to avoid some import warnings.

8 years agoMove constants out of xfp to common/plugtrx.
Bert Vermeulen [Wed, 20 Apr 2016 23:44:10 +0000 (01:44 +0200)]
Move constants out of xfp to common/plugtrx.

8 years agoAdd common directory for shared modules.
Bert Vermeulen [Wed, 20 Apr 2016 23:33:49 +0000 (01:33 +0200)]
Add common directory for shared modules.

8 years agomdio: Add 'TURNAROUND' long/full annotation.
Uwe Hermann [Wed, 4 May 2016 01:42:24 +0000 (03:42 +0200)]
mdio: Add 'TURNAROUND' long/full annotation.

(useful in GUIs for displaying more useful annotations at certain
zoom levels)

8 years agomdio: Factor out self.putff().
Uwe Hermann [Wed, 27 Apr 2016 20:17:01 +0000 (22:17 +0200)]
mdio: Factor out self.putff().

8 years agoAdd an MDIO protocol decoder.
Elias Oenal [Mon, 18 Apr 2016 15:37:07 +0000 (17:37 +0200)]
Add an MDIO protocol decoder.

This new implementation supports all the features of the old decoder,
and additionally supports Clause 22 and 45.

8 years agoDrop mdio decoder (to be replaced with another implementation).
Uwe Hermann [Wed, 27 Apr 2016 16:50:37 +0000 (18:50 +0200)]
Drop mdio decoder (to be replaced with another implementation).

8 years agopwm: Use self.{ss,es}_block for consistency across PDs.
Uwe Hermann [Wed, 20 Apr 2016 17:31:38 +0000 (19:31 +0200)]
pwm: Use self.{ss,es}_block for consistency across PDs.

8 years agotiming: Use self.samplenum for consistency across PDs.
Uwe Hermann [Wed, 20 Apr 2016 17:31:21 +0000 (19:31 +0200)]
timing: Use self.samplenum for consistency across PDs.

8 years agoAdd initial Renesas Advanced User Debugger (AUD) decoder.
fenugrec [Wed, 9 Mar 2016 20:36:06 +0000 (15:36 -0500)]
Add initial Renesas Advanced User Debugger (AUD) decoder.

8 years agoem4100/t55xx: Fix accidentally broken wording in license header.
Uwe Hermann [Fri, 4 Mar 2016 07:20:08 +0000 (08:20 +0100)]
em4100/t55xx: Fix accidentally broken wording in license header.

The word "version" was accidentally replaced by "data" (sed).

8 years agoFix various incorrect PD license metadata fields.
Uwe Hermann [Fri, 4 Mar 2016 07:13:30 +0000 (08:13 +0100)]
Fix various incorrect PD license metadata fields.

Have the PD 'license' attribute match what the license header of the
respective pd.py file actually says.

8 years agoAdd an rgb_led_ws281x decoder.
Uwe Hermann [Sun, 14 Feb 2016 21:06:38 +0000 (00:06 +0300)]
Add an rgb_led_ws281x decoder.

This decoder handles the WS2812B protocol (and possibly WS2811).

Example dump already exists: led/ws281x/ws281x_4ch_5mhz.sr.

Signed-off-by: Vladimir Ermakov <redacted>
8 years agoAdd decoder for the t55xx RFID protocol
Benjamin Larsson [Sun, 24 Jan 2016 22:49:55 +0000 (23:49 +0100)]
Add decoder for the t55xx RFID protocol

8 years agoconfigure.ac: Bump package version to 0.5.0.
Uwe Hermann [Thu, 3 Mar 2016 17:37:30 +0000 (18:37 +0100)]
configure.ac: Bump package version to 0.5.0.

0.5.0 will be the next major, API-changing release. Bump now, so that
there is no confusion of tarball 0.4.0 and 0.5.0-git snapshots.

8 years agoBump libtool version (not package version) to 3:0:0.
Uwe Hermann [Fri, 29 Jan 2016 22:32:37 +0000 (23:32 +0100)]
Bump libtool version (not package version) to 3:0:0.

The last release (0.3.0) had the libtool version (current:revision:age)
set to 2:0:0. Since this release removes and changes interfaces, the new
version is 3:0:0.

http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info

This changes the library filename (e.g. on Linux) from
libsigrokdecode.so.2.0.0 to libsigrokdecode.so.3.0.0, the SONAME
(+symlink) becomes libsigrokdecode.so.3.

8 years agoNEWS: Update for upcoming 0.4.0 release.
Uwe Hermann [Fri, 29 Jan 2016 20:25:18 +0000 (21:25 +0100)]
NEWS: Update for upcoming 0.4.0 release.

8 years agoconfigure.ac: Also check for Python 3.5.
Martijn van Buul [Tue, 26 Jan 2016 21:13:26 +0000 (22:13 +0100)]
configure.ac: Also check for Python 3.5.

This fixes bug #739.

8 years agouart: Optimize handling of samples when tx and rx are both idle
Daniel Thompson [Fri, 22 Jan 2016 08:29:09 +0000 (08:29 +0000)]
uart: Optimize handling of samples when tx and rx are both idle

Re-enable the fast path for identical samples but only when both
pins are waiting for the start bit. For sparse data sets (I tested
UT61E capture log) the optimization results in a >4x decode
improvement.

8 years agoarm_itm: Use objdump instead of addr2line.
Petteri Aimonen [Sun, 10 Jan 2016 17:23:55 +0000 (19:23 +0200)]
arm_itm: Use objdump instead of addr2line.

This improves speed and fixes bug 564. Code is somewhat
of a copypaste from the arm_etm counterpart, but there
are enough differences that it is easier to keep separate
copy of the objdump parsing in each.

8 years agousb_power_delivery: Raise SamplerateError instead of Exception.
Uwe Hermann [Fri, 25 Dec 2015 15:28:23 +0000 (16:28 +0100)]
usb_power_delivery: Raise SamplerateError instead of Exception.

(for consistency with the other PDs)

8 years agoUse self.out_binary naming consistently across all PDs.
Uwe Hermann [Wed, 23 Dec 2015 19:01:48 +0000 (20:01 +0100)]
Use self.out_binary naming consistently across all PDs.

8 years agoUse a Python list (not tuple) for OUT_BINARY.
Uwe Hermann [Wed, 23 Dec 2015 19:00:45 +0000 (20:00 +0100)]
Use a Python list (not tuple) for OUT_BINARY.

This is more consistent with annotation syntax and looks slightly
better in most cases.

8 years agoDrop obsolete support for annotation tuples (only support lists).
Uwe Hermann [Sun, 20 Dec 2015 16:49:31 +0000 (17:49 +0100)]
Drop obsolete support for annotation tuples (only support lists).

None of the PDs use this.

8 years agoem4100: Simplify the code a bit.
Uwe Hermann [Fri, 18 Dec 2015 16:42:16 +0000 (17:42 +0100)]
em4100: Simplify the code a bit.

8 years agoem4100: Use ss/es naming for consistency across PDs.
Uwe Hermann [Fri, 18 Dec 2015 16:29:10 +0000 (17:29 +0100)]
em4100: Use ss/es naming for consistency across PDs.

8 years agoem4100: Eliminate some unnecessary int()s.
Uwe Hermann [Fri, 18 Dec 2015 16:21:47 +0000 (17:21 +0100)]
em4100: Eliminate some unnecessary int()s.

8 years agoem4100: Change annotation setup a bit, decode more protocol details.
Uwe Hermann [Fri, 18 Dec 2015 17:14:06 +0000 (18:14 +0100)]
em4100: Change annotation setup a bit, decode more protocol details.

8 years agoAdd RFID EM4100 protocol decoding
Benjamin Larsson [Tue, 15 Dec 2015 00:00:01 +0000 (01:00 +0100)]
Add RFID EM4100 protocol decoding

8 years agousb_power_delivery: Use "if not self.samplerate" form.
Uwe Hermann [Wed, 16 Dec 2015 17:14:30 +0000 (18:14 +0100)]
usb_power_delivery: Use "if not self.samplerate" form.

Use the "if not self.samplerate" form, which catches both the case
where self.samplerate is None, as well as the case where it is 0.

This is also consistent with all the other PDs.

8 years agousb_power_delivery: convert double quotes to single quotes
Vincent Palatin [Wed, 25 Nov 2015 17:19:58 +0000 (09:19 -0800)]
usb_power_delivery: convert double quotes to single quotes

For consistency with other decoders, convert all the double quotes around
strings to single quotes.

Signed-off-by: Vincent Palatin <redacted>
8 years agoinit: Don't let Python override signal handlers
Marcus Comstedt [Fri, 4 Dec 2015 21:36:17 +0000 (22:36 +0100)]
init: Don't let Python override signal handlers

This fixes bug #461.

8 years agousb*: Minor cosmetics.
Uwe Hermann [Fri, 4 Dec 2015 21:11:14 +0000 (22:11 +0100)]
usb*: Minor cosmetics.

8 years agousb_signalling: detect PREamble PID
Stefan Brüns [Tue, 1 Dec 2015 05:44:43 +0000 (06:44 +0100)]
usb_signalling: detect PREamble PID

PID decoding is normally done in the packet layer, but the signalling
layer has to switch behaviour on detection of an PREamble PID.

8 years agousb_signalling: add signaling states needed after LS PREamble PID
Stefan Brüns [Tue, 1 Dec 2015 05:48:02 +0000 (06:48 +0100)]
usb_signalling: add signaling states needed after LS PREamble PID

8 years agousb_{packet,request}: handle PREamble transmissions
Stefan Brüns [Tue, 1 Dec 2015 04:53:32 +0000 (05:53 +0100)]
usb_{packet,request}: handle PREamble transmissions

9 years agousb_signalling: fix SOP detection after an error condition
Stefan Brüns [Sun, 29 Nov 2015 23:35:11 +0000 (00:35 +0100)]
usb_signalling: fix SOP detection after an error condition

If the oldsym is not set to 'J' before entering IDLE state, the SOP
detection will never trigger

9 years agousb_packet: handle errors from usb_signalling
Stefan Brüns [Sun, 29 Nov 2015 23:00:03 +0000 (00:00 +0100)]
usb_packet: handle errors from usb_signalling

If a packet had any errors, the usb_signalling PD will not send an EOP
but an ERR message. Wait for the next SOP in both cases.

9 years agousb_request: Handle transmission timeouts
Stefan Brüns [Sun, 29 Nov 2015 22:56:53 +0000 (23:56 +0100)]
usb_request: Handle transmission timeouts

If a device or host did not receive a handshake 18 bit times after the
EOP, there was a transmission error and the host may repeat the
transmission

9 years agousb_signalling: add option to automatically set signalling speed
Stefan Brüns [Fri, 13 Nov 2015 06:15:36 +0000 (07:15 +0100)]
usb_signalling: add option to automatically set signalling speed

In automatic mode, the bus is assumed to be in IDLE state. After a
RESET, the bus state is checked again.

9 years agousb_signalling: decode RESET and Keep-Alive signalling conditions
Stefan Brüns [Fri, 13 Nov 2015 04:39:10 +0000 (05:39 +0100)]
usb_signalling: decode RESET and Keep-Alive signalling conditions

Resets are at least 10ms at the root hub downstream facing port and
2.5us at the device (root hub reset may be shortened by itermediate
hubs).
Keep-alive is a low-speed only signalling condition, as low-speed has no
SOFs to inhibit devices to enter suspend

9 years agousb_signalling: use explicit positions for packet start/end
Stefan Brüns [Fri, 13 Nov 2015 04:20:22 +0000 (05:20 +0100)]
usb_signalling: use explicit positions for packet start/end

Instead of centering the block around the sampleposition, which shows
some visual glitches due to rounding, use the edge positions already
known. Remove unused halfbit symbol.

9 years agousb_signalling: handle symbol errors in EOP state
Stefan Brüns [Fri, 13 Nov 2015 03:55:56 +0000 (04:55 +0100)]
usb_signalling: handle symbol errors in EOP state

Only SE0 and J are valid symbols during EOP