]> sigrok.org Git - libsigrokdecode.git/log
libsigrokdecode.git
4 years agods1307: Consistently use _ instead of - for various IDs.
Uwe Hermann [Wed, 1 Jan 2020 15:27:20 +0000 (16:27 +0100)]
ds1307: Consistently use _ instead of - for various IDs.

4 years agocc1101: Use SrdIntEnum for annotation classes.
Uwe Hermann [Wed, 1 Jan 2020 14:36:47 +0000 (15:36 +0100)]
cc1101: Use SrdIntEnum for annotation classes.

4 years agoamulet_ascii: Use SrdIntEnum for annotation classes.
Uwe Hermann [Wed, 1 Jan 2020 13:50:12 +0000 (14:50 +0100)]
amulet_ascii: Use SrdIntEnum for annotation classes.

Also, automate construction of the Ann SrdIntEnum.
This avoids having to remember to manually keep two lists in sync.

4 years agosrdhelper: Add SrdIntEnum with various helper methods.
Uwe Hermann [Wed, 1 Jan 2020 17:59:13 +0000 (18:59 +0100)]
srdhelper: Add SrdIntEnum with various helper methods.

4 years agocjtag: Drop no longer needed _real variable name suffix.
Uwe Hermann [Wed, 8 Jan 2020 23:19:45 +0000 (00:19 +0100)]
cjtag: Drop no longer needed _real variable name suffix.

4 years agocjtag: Give each cJTAG state its own annotation class.
Uwe Hermann [Wed, 8 Jan 2020 23:10:41 +0000 (00:10 +0100)]
cjtag: Give each cJTAG state its own annotation class.

4 years agocjtag: Use correct TCKC/TMSC channel names.
Uwe Hermann [Wed, 8 Jan 2020 22:34:16 +0000 (23:34 +0100)]
cjtag: Use correct TCKC/TMSC channel names.

4 years agocjtag: Drop some unused method arguments.
Uwe Hermann [Wed, 8 Jan 2020 22:32:40 +0000 (23:32 +0100)]
cjtag: Drop some unused method arguments.

4 years agocjtag: Drop non-existing channels from the decoder.
Uwe Hermann [Wed, 8 Jan 2020 22:21:54 +0000 (23:21 +0100)]
cjtag: Drop non-existing channels from the decoder.

cJTAG only has two wires/channels.

4 years agocjtag: Use ternary operator where possible.
Uwe Hermann [Wed, 8 Jan 2020 21:52:53 +0000 (22:52 +0100)]
cjtag: Use ternary operator where possible.

4 years agocjtag: Use += operator where possible.
Uwe Hermann [Wed, 8 Jan 2020 21:50:16 +0000 (22:50 +0100)]
cjtag: Use += operator where possible.

4 years agocjtag: Drop various unneeded parenthesis.
Uwe Hermann [Wed, 8 Jan 2020 21:49:33 +0000 (22:49 +0100)]
cjtag: Drop various unneeded parenthesis.

4 years agocjtag: Use plural for annotation row IDs/names.
Uwe Hermann [Wed, 8 Jan 2020 21:41:08 +0000 (22:41 +0100)]
cjtag: Use plural for annotation row IDs/names.

4 years agocjtag: Add cJTAG OSCAN1 decoder.
Kongou Hikari [Thu, 5 Dec 2019 10:37:05 +0000 (18:37 +0800)]
cjtag: Add cJTAG OSCAN1 decoder.

[Note: This is a commit from Kongou Hikari ("diodep" on GitHub) that was
"rebased" by Uwe Hermann on top of the current libsigrokdecode mainline JTAG
decoder. There are various reasons for this, including avoiding non-mainline
or outdated decoder changes, as well as making it easily visible what the
changes vs. the current JTAG decoder are, in case we later need to apply some
changes to both decoders or in case both decoders might be merged later on.
Minor cosmetic and naming changes were also squashed in (no functional
changes, though).]

4 years agocjtag: Use an exact copy of the jtag PD as basis for cjtag.
Uwe Hermann [Wed, 8 Jan 2020 21:18:16 +0000 (22:18 +0100)]
cjtag: Use an exact copy of the jtag PD as basis for cjtag.

4 years agospiflash: Don't use ambiguous annotation class names.
Uwe Hermann [Sun, 5 Jan 2020 14:49:18 +0000 (15:49 +0100)]
spiflash: Don't use ambiguous annotation class names.

This is not technically a bug since (at least some) datasheets refer
to this command as "Chip erase", it just happens to have two different
command codes (0x60 and 0xc7).

In order to not confuse users with two annotation classes with the
same name, we'll call the second one "Chip erase 2" to match the
"CE2" short name.

This fixes bug #1482.

4 years agodmx512: stack DMX512 on top of UART and improve usability
Gerhard Sittig [Wed, 27 Nov 2019 20:54:11 +0000 (21:54 +0100)]
dmx512: stack DMX512 on top of UART and improve usability

It was unfortunate that the previous DMX512 decoder implementation
re-invented UART decoder features and introduced new issues in the
process. Automatic polarity detection is just impossible when the full
set of valid DMX timings is to get supported. Sample numbers suffered
from floating point rounding errors.

Introduce a stacked decoder on top of UART which exclusively deals with
DMX512 details, and transparently benefits from all available UART
features (adjustable polarity, robust and correct sampling, data byte
accumulation, BREAK detection while silencing false STOP violations). On
one hand this requires users to specify the bitrate (250kbps), on the
other hand it results in reliable operation for all captures that have
become available so far.

Provide Python output for stacked decoders which can process protocol
extensions like RDM. Prepare the DMX512 decoder itself to handle simple
cases of protocol extensions (start codes other than 0). Add support for
additional constraint checks, emit warnings when user specified limits
are violated: short BREAK, long MARK, long RESET to RESET and short
BREAK to BREAK intervals. This shall speedup the identification of bus
health issues (data loss or corruption) or improper controller timing.

Also hide all-zero values by default, to make used channels visually
stand out, and help users focus their attention. For special cases (like
16bit data, or zero being a valid set-point for the channels) users can
enforce the display of all values. Provide an option to present byte
values to users in the most appropriate format for the use case.

This resolves bug #1442.

4 years agodmx512: remove previous implementation before replacing it
Gerhard Sittig [Fri, 3 Jan 2020 21:59:47 +0000 (22:59 +0100)]
dmx512: remove previous implementation before replacing it

The existing DMX512 decoder implementation duplicates UART specific
knowledge, and implements some of the redundant logic in ways which fail
to interpret correct input data. See bug #1442 for details.

This commit removes the previous decoder implementation before adding a
more recent version, to gain a more readable history across that decoder
replacement.

4 years agops2: end data byte at rising clock edge of the stop bit
Gerhard Sittig [Sat, 21 Dec 2019 16:02:50 +0000 (17:02 +0100)]
ps2: end data byte at rising clock edge of the stop bit

Data byte transmission is complete when the STOP bit was communicated.
End the STOP bit at the rising CLOCK edge of the 11th bit time, do not
rely on the host's clock inhibit after data transmission. This avoids
the unexpected expansion of a STOP bit well into the next data byte.

This fixes bug #1460, where absence of host activity after the first
data byte loses synchronization to the input stream.

Rephrase pin level sampling while we are here. Reflect that the clock
line is used for .wait() conditions, but its level is not evaluated.
Only data line levels get processed.

Comment on the implementation's assumption of specific input data (the
device as transmitter, host transmit may not be supported, or can result
in unexpected output). Which may be acceptable yet maintainers need to
remain aware.

4 years agoflexray: fix annotation for 'frame end sequence'
Stephan Thiele [Thu, 2 Jan 2020 19:46:23 +0000 (20:46 +0100)]
flexray: fix annotation for 'frame end sequence'

4 years agoamulet_ascii: Minor consistency fix.
Uwe Hermann [Wed, 1 Jan 2020 13:29:21 +0000 (14:29 +0100)]
amulet_ascii: Minor consistency fix.

4 years agoxfp: Add annotation rows.
Uwe Hermann [Tue, 31 Dec 2019 23:18:09 +0000 (00:18 +0100)]
xfp: Add annotation rows.

4 years agomodbus: Add missing annotation class names.
Uwe Hermann [Tue, 31 Dec 2019 22:20:12 +0000 (23:20 +0100)]
modbus: Add missing annotation class names.

4 years agomlx90614: Add annotation rows.
Uwe Hermann [Tue, 31 Dec 2019 22:09:29 +0000 (23:09 +0100)]
mlx90614: Add annotation rows.

Previously there were two different annotation classes with 100% overlap.

4 years agocc1101: Add missing annotation class.
Uwe Hermann [Tue, 31 Dec 2019 21:03:53 +0000 (22:03 +0100)]
cc1101: Add missing annotation class.

This was causing incorrect annotation class indices to be used.

4 years agoAll PDs: Consistently use singular/plural for annotation classes/rows.
Uwe Hermann [Mon, 30 Dec 2019 17:33:32 +0000 (18:33 +0100)]
All PDs: Consistently use singular/plural for annotation classes/rows.

4 years agox2444m: Eliminate duplicate annotation class ID.
Uwe Hermann [Mon, 30 Dec 2019 15:55:30 +0000 (16:55 +0100)]
x2444m: Eliminate duplicate annotation class ID.

4 years agosrd_decoder_load(): Error out upon various duplicate IDs.
Uwe Hermann [Mon, 30 Dec 2019 15:31:25 +0000 (16:31 +0100)]
srd_decoder_load(): Error out upon various duplicate IDs.

4 years agoHACKING: Add some Python coding style hints, fix incorrect docs.
Uwe Hermann [Mon, 30 Dec 2019 16:04:17 +0000 (17:04 +0100)]
HACKING: Add some Python coding style hints, fix incorrect docs.

4 years agouart: Use human-readable names for binary classes.
Uwe Hermann [Mon, 30 Dec 2019 11:26:19 +0000 (12:26 +0100)]
uart: Use human-readable names for binary classes.

4 years agouart: Fix incorrect stop bit annotation class.
Uwe Hermann [Mon, 30 Dec 2019 11:35:02 +0000 (12:35 +0100)]
uart: Fix incorrect stop bit annotation class.

This fixes bug #1474.

4 years agouart: Use human-readable names for annotation classes.
Uwe Hermann [Mon, 30 Dec 2019 11:20:45 +0000 (12:20 +0100)]
uart: Use human-readable names for annotation classes.

Using human-readable names for annotation classes (instead of numeric
indices) improves readability and maintainability of the decoder, and can
also prevent bugs due to incorrect indices.

4 years agouart: sample position nits, fix typo, float calculation awareness
Gerhard Sittig [Tue, 17 Dec 2019 10:48:23 +0000 (11:48 +0100)]
uart: sample position nits, fix typo, float calculation awareness

This commit amends bd50ceb314e4. Fix a typo in a comment. Rephrase the
bit width percentage calculation such that readers remain aware of the
necessity for floating point math in sample position calculations. This
commit does not change behaviour, Python 3 always yields float results
for divisions. It's about raising awareness.

4 years agouart: allow arbitrary sample positions for UART bit values (1-99%)
Gerhard Sittig [Wed, 4 Dec 2019 20:21:03 +0000 (21:21 +0100)]
uart: allow arbitrary sample positions for UART bit values (1-99%)

The previous implementation of the UART decoder used to sample bit values
strictly at the center position within a bit time. This commit introduces
support to sample bit values at arbitrary positions in the range of 1-99%
of the bit time. This allows to work around glitches in existing captures
as well as using the decoder for UART like protocols which don't sample
bit values at the center position (like EIB aka KNX).

This implementation is incomplete (on purpose). Although this version
improves the ability to extract data from captures, it also introduces
inaccuracies in the annotation positions for non-default values of the
sample point position. Addressing this issue is left for later, assuming
that it'll be a byproduct of another commit series that is being worked
on (general annotation position adjustment and stop bits support).

4 years agocan: Drop an unused method.
Uwe Hermann [Thu, 12 Dec 2019 21:19:58 +0000 (22:19 +0100)]
can: Drop an unused method.

4 years agosignature: increase compatibility across Python versions
Gerhard Sittig [Thu, 12 Dec 2019 09:39:57 +0000 (10:39 +0100)]
signature: increase compatibility across Python versions

Underscores in number literals are a recent Python feature which only
was introduced in version 3.6. The sigrok project claims compatibility
with previous Python versions, but the signature decoder fails to load
with this error:

  $ pulseview
  srd: SyntaxError: Failed to load decoder signature: import by name failed: invalid syntax (pd.py, line 138)
  srd: Traceback (most recent call last):
    File "/home/user/share/libsigrokdecode/decoders/signature/__init__.py", line 25, in <module>
      from .pd import Decoder
    File "/home/user/share/libsigrokdecode/decoders/signature/pd.py", line 138
      incoming = (bin(shiftreg & 0b0000_0010_1001_0001).count('1') + data) & 1
                                                     ^
  SyntaxError: invalid syntax

Use the more compact hex presentation for a magic binary pattern. This
obsoletes the necessity to separate groups of bits for readability.

4 years agoac97/lin: Remove some unneeded code snippets.
Uwe Hermann [Tue, 10 Dec 2019 21:05:51 +0000 (22:05 +0100)]
ac97/lin: Remove some unneeded code snippets.

4 years agostruct srd_decoder: Fix/improve some documentation comments.
Uwe Hermann [Tue, 10 Dec 2019 21:00:05 +0000 (22:00 +0100)]
struct srd_decoder: Fix/improve some documentation comments.

4 years agoi2cfilter: Improve description of the "address" option.
Uwe Hermann [Mon, 9 Dec 2019 20:22:07 +0000 (21:22 +0100)]
i2cfilter: Improve description of the "address" option.

4 years agodsi: Add a TODO comment for proper self.wait() usage.
Uwe Hermann [Mon, 9 Dec 2019 20:21:00 +0000 (21:21 +0100)]
dsi: Add a TODO comment for proper self.wait() usage.

All PDs where "trivial" self.wait() conversion was used now have this
specific comment, so it's easy to grep for.

4 years agosrd_decoder_doc_get(): Add an additional sanity check.
Uwe Hermann [Tue, 12 Nov 2019 21:47:41 +0000 (22:47 +0100)]
srd_decoder_doc_get(): Add an additional sanity check.

4 years agodecoders: Don't set self.samplenum.
Uwe Hermann [Sat, 7 Dec 2019 18:11:27 +0000 (19:11 +0100)]
decoders: Don't set self.samplenum.

This is managed by the backend and should be read-only for PDs.

4 years agohdcp: Add missing spaces.
Uwe Hermann [Sat, 7 Dec 2019 16:29:14 +0000 (17:29 +0100)]
hdcp: Add missing spaces.

4 years agohdcp: Reduce nesting level.
Uwe Hermann [Sat, 7 Dec 2019 15:34:46 +0000 (16:34 +0100)]
hdcp: Reduce nesting level.

4 years agohdcp: Simplify some code snippets.
Uwe Hermann [Sat, 7 Dec 2019 15:31:25 +0000 (16:31 +0100)]
hdcp: Simplify some code snippets.

4 years agohdcp: Add tags.
Uwe Hermann [Sat, 7 Dec 2019 15:17:43 +0000 (16:17 +0100)]
hdcp: Add tags.

4 years agoAdd HDCP traffic decoder to stack on i2c
Dave Craig [Wed, 2 Jan 2019 13:36:11 +0000 (13:36 +0000)]
Add HDCP traffic decoder to stack on i2c

This decoder annotates i2c traffic to indicate the type of HDCP
message contained. It includes HDCP2.2 and HDCP1.4. Useful for
analysing HDCP negotiation failures.

4 years agoieee488: flush upper layer payload data when IFC asserts
Gerhard Sittig [Sat, 7 Dec 2019 07:58:34 +0000 (08:58 +0100)]
ieee488: flush upper layer payload data when IFC asserts

Also flush previously accumulated payload data when the IFC signal
asserts (interface clear, a controller requests ownership of the bus).
This is in line with EOI (end of message) and ATN (start of a command,
including change of "connected" peers or direction of communication).

4 years agoieee488: introduce 'delim' option for improved text output
Gerhard Sittig [Sat, 7 Dec 2019 07:51:16 +0000 (08:51 +0100)]
ieee488: introduce 'delim' option for improved text output

When a capture contains output from a talking device, but neither
contains EOI (end of transmission) nor ATN (new commands, including
changes in the set of communicating peers or communication direction),
then lower layer data bytes would be shown but accumulated runs of upper
layer payload data would not. The hp53131a-ton.sr capture demonstrates
this behaviour.

Add transparent support for the typical case of communicating SCPI over
GPIB. Do emit upper layer payload data annotations when termination
sequences for text lines were seen. Allow users to disable this feature
when it's not appropriate for binary content.

It's an internal implementation detail that accumulated data gets flushed.
Communicate the user visible option as "payload data separation", which
should most appropriately reflect the resulting behaviour. The specific
implementation of this feature can also support different kinds of payload
chunk separation.

4 years agoObsolete gpib and iec PDs in favor of ieee488.
Uwe Hermann [Fri, 6 Dec 2019 21:35:30 +0000 (22:35 +0100)]
Obsolete gpib and iec PDs in favor of ieee488.

4 years agoieee488: Mention more relevant keywords in longname.
Uwe Hermann [Fri, 6 Dec 2019 21:33:45 +0000 (22:33 +0100)]
ieee488: Mention more relevant keywords in longname.

This can be used by frontends for decoder search features.

4 years agoieee488: Simplify _get_raw_byte() a bit.
Uwe Hermann [Fri, 6 Dec 2019 21:25:55 +0000 (22:25 +0100)]
ieee488: Simplify _get_raw_byte() a bit.

4 years agoieee488: introduce unified IEEE-488 decoder (supports GPIB and IEC)
Gerhard Sittig [Thu, 3 Oct 2019 02:38:01 +0000 (04:38 +0200)]
ieee488: introduce unified IEEE-488 decoder (supports GPIB and IEC)

Introduce an 'ieee488' protocol decoder which handles both the 16 lines
parallel GPIB variant as well as the serial IEC bus variant. Which kind
of supersedes the 'gpib' and 'iec' decoders.

This implementation increases maintainability because only the extraction
of raw bytes from the parallel or serial bus is separate, and all GPIB
related command/address/data interpretation is shared. This decoder extends
the feature set of the previous versions: Visual annotations are more fine
grained (more classes, additional rows, various text lengths to maintain
usability during zoom). There is binary output for communicated data,
as well as Python output for stacked decoders. Consecutive runs of
talker data gets accumulated, and is made available in binary form as well
as text (with escapes for non-printables). The terse single-letter format
(character codes '0' to 'O' for addresses) is kept for compatibility for
those users who are accustomed to it. The implemented logic also copes
with captures of low samplerate, where edges happen to fall onto the same
sample number which at higher samplerates shall be perceived as distant
and should get processed in their respective order of appearance.

This implementation tracks the most recent configuration of "peers" (the
set of talkers and listeners). A future implementation might support the
isolation of a single conversation out of a busy chat on the bus.

Some optional support for Commodore peripherals is included (currently
limited to disk channels), while it's recommended to move this logic to
a stacked decoder if it grows more complex.

4 years agoir_rc6: Reduce nesting level.
Uwe Hermann [Tue, 3 Dec 2019 20:37:53 +0000 (21:37 +0100)]
ir_rc6: Reduce nesting level.

4 years agoir_rc6: Initial commit
BenediktO [Sun, 1 Dec 2019 11:32:12 +0000 (12:32 +0100)]
ir_rc6: Initial commit

4 years agoir_rc5: improved performance
BenediktO [Sat, 30 Nov 2019 17:57:32 +0000 (18:57 +0100)]
ir_rc5: improved performance

4 years agoflexray: Use bit/s instead of Mbit/s for bitrate.
Uwe Hermann [Sat, 30 Nov 2019 14:17:50 +0000 (15:17 +0100)]
flexray: Use bit/s instead of Mbit/s for bitrate.

This avoids floating point number option values, which makes things
a bit easier/clearer on the command-line and also matches what other
decoders do.

Also, use numbers instead of strings for the option values.

4 years agoflexray: add basic decoder
Stephan Thiele [Tue, 5 Mar 2019 23:15:27 +0000 (00:15 +0100)]
flexray: add basic decoder

4 years agones_gamepad: implement and add decoder
Stephan Thiele [Sun, 27 Oct 2019 20:59:17 +0000 (21:59 +0100)]
nes_gamepad: implement and add decoder

4 years agouart: Drop question mark from two option names.
Uwe Hermann [Fri, 29 Nov 2019 23:36:53 +0000 (00:36 +0100)]
uart: Drop question mark from two option names.

4 years agouart: Shorten various decoder option names.
Uwe Hermann [Fri, 29 Nov 2019 22:51:19 +0000 (23:51 +0100)]
uart: Shorten various decoder option names.

This makes the decoder a lot nicer to use from the command-line.

 * num_data_bits -> data_bits
 * parity_type -> parity
 * num_stop_bits -> stop_bits
 * rx_packet_delimiter -> rx_packet_delim
 * tx_packet_delimiter -> tx_packet_delim

4 years agouart: rephrase check for required input signals, reword error message
Gerhard Sittig [Fri, 29 Nov 2019 21:02:51 +0000 (22:02 +0100)]
uart: rephrase check for required input signals, reword error message

Rephrase the test for the availability of at least one of several
optional input signals, and reword the corresponding error message.

4 years agouart: support 'ignore' parity type, remove unsupported 'check_parity' option
Gerhard Sittig [Fri, 29 Nov 2019 20:15:48 +0000 (21:15 +0100)]
uart: support 'ignore' parity type, remove unsupported 'check_parity' option

The previous UART decoder implementation announced a 'check_parity'
option which took no effect (support code was missing). Remove it. Add
another 'ignore' parity choice instead, which consumes the parity bit's
position yet always passes the check.

4 years agoRemove left-over FSF postal address from boiler plate license text.
Uwe Hermann [Fri, 29 Nov 2019 22:18:54 +0000 (23:18 +0100)]
Remove left-over FSF postal address from boiler plate license text.

4 years agodecoders: Use a slightly more consistent/logical annotation row setup.
Uwe Hermann [Fri, 29 Nov 2019 21:49:04 +0000 (22:49 +0100)]
decoders: Use a slightly more consistent/logical annotation row setup.

Generally show "bits" and other smaller annotations in rows that come
before "larger" annotations (in later rows).

4 years agoir_nec: fix #1243, multiple capture frames.
Philipp Marek [Wed, 4 Jul 2018 12:41:17 +0000 (14:41 +0200)]
ir_nec: fix #1243, multiple capture frames.

4 years agows281x: Check for "None" before subtracting.
Philipp Marek [Wed, 6 Nov 2019 18:26:49 +0000 (19:26 +0100)]
ws281x: Check for "None" before subtracting.

4 years agocan: more robust sample point position for low sample rates
Gerhard Sittig [Thu, 10 Oct 2019 07:01:01 +0000 (09:01 +0200)]
can: more robust sample point position for low sample rates

Do more of the calculation with floating point, only trim precision and
enforce integers at the end of the determination of the next sample
point. This shall increase robustness at low capture sample rates.

4 years agocan: implement bit rate switch support for CAN-FD frames
Stephan Thiele [Wed, 13 Nov 2019 22:24:31 +0000 (23:24 +0100)]
can: implement bit rate switch support for CAN-FD frames

4 years agocan: annotate classic CAN CRC as CRC-15
Stephan Thiele [Wed, 13 Nov 2019 22:14:16 +0000 (23:14 +0100)]
can: annotate classic CAN CRC as CRC-15

4 years agolin: calculate checksum on two consecutive UART idle frames
Stephan Thiele [Sun, 10 Nov 2019 16:11:34 +0000 (17:11 +0100)]
lin: calculate checksum on two consecutive UART idle frames

4 years agomodbus: Ignore unknown/unsupported types.
Uwe Hermann [Fri, 29 Nov 2019 18:47:35 +0000 (19:47 +0100)]
modbus: Ignore unknown/unsupported types.

Without this, e.g. the recently added 'IDLE' ptype of the UART decoder
would cause issues.

4 years agouart: Document the new 'IDLE' ptype for OUTPUT_PYTHON output.
Uwe Hermann [Fri, 29 Nov 2019 18:51:36 +0000 (19:51 +0100)]
uart: Document the new 'IDLE' ptype for OUTPUT_PYTHON output.

4 years agouart: communicate periods of idle frames to stacked decoders
Gerhard Sittig [Sat, 20 Oct 2018 18:48:46 +0000 (20:48 +0200)]
uart: communicate periods of idle frames to stacked decoders

Detect periods of a frame's length with idle level, and communicate
these time spans to stacked decoders by means of PYTHON output. Do *not*
display these idle frames in regular annotations, for backwards compat.

4 years agosignature: Fix license metadata field to match pd.py license header.
Uwe Hermann [Thu, 28 Nov 2019 19:54:23 +0000 (20:54 +0100)]
signature: Fix license metadata field to match pd.py license header.

4 years agosignature: Use more human-readable option values.
Uwe Hermann [Thu, 28 Nov 2019 19:52:20 +0000 (20:52 +0100)]
signature: Use more human-readable option values.

4 years agosignature: Minor consistency fixes.
Uwe Hermann [Thu, 28 Nov 2019 19:51:39 +0000 (20:51 +0100)]
signature: Minor consistency fixes.

4 years agosignature: Add self.reset().
Uwe Hermann [Thu, 28 Nov 2019 19:50:17 +0000 (20:50 +0100)]
signature: Add self.reset().

4 years agoAdd decoder: signature analysis
sharow [Mon, 7 Oct 2019 00:34:33 +0000 (09:34 +0900)]
Add decoder: signature analysis

4 years agogpib: drop obscure "total number of samples" option
Gerhard Sittig [Sun, 24 Nov 2019 18:45:01 +0000 (19:45 +0100)]
gpib: drop obscure "total number of samples" option

The gpib decoder tried to "flush" input data at a user specified sample
number when the input data lacked the respective edge which triggers the
processing during regular operation.

This is rather obscure a feature, not seen in any other decoder, perhaps
a workaround for bug #292, rather unaccessible to users (units of sample
numbers not times nor automatic detection of the EOF condition), highly
confusing according to user reports, and not covered by existing tests.

The mere presence of this option caused severe issues in application
code (see bug #1444). While there is no apparent fix that won't affect
other decoders. So let's drop this questionable feature. Valid and
complete captures should contain all relevent edges and thus decode
properly.

4 years agodecoder: accept skip count 0 (onewire_link, usb_signalling)
Gerhard Sittig [Sun, 24 Nov 2019 18:37:49 +0000 (19:37 +0100)]
decoder: accept skip count 0 (onewire_link, usb_signalling)

A recent commit tightened the check for acceptable 'skip' sample counts.
This broke the onewire_link and usb_signalling decoders' test sequences,
which no longer pass with a minimum count of one. Relax the condition
and accept a count of zero. This breaks gpib again for low total sample
count option values, but this needs to get addressed differently.

4 years agodecoder: internal 'always false' term, handle invalid skip and channel
Gerhard Sittig [Sun, 24 Nov 2019 08:52:42 +0000 (09:52 +0100)]
decoder: internal 'always false' term, handle invalid skip and channel

Introduce an "always false" type for .wait() terms. Map invalid counts
of skip conditions (zero or negative numbers) as well as invalid channel
references for level/edge conditions to this type which never matches.
Keep this "always false" term type an internal detail of the common
support code.

This is most robust and least intrusive at the same time, it keeps the
existing API, and simplifies the implementation of Python decoders for
rare edge cases (optional input signals or optional features, handling
of initial samples at the very start of a capture).

This commit passes sample counts internally in a signed data type. This
is essential for proper operation, and the loss of one bit out of 64
shall not be considered a severe limitation.

This fixes bug #1444.

4 years agotdm_audio: Place each channel on its own annotation row.
Uwe Hermann [Sun, 24 Nov 2019 18:18:28 +0000 (19:18 +0100)]
tdm_audio: Place each channel on its own annotation row.

4 years agotdm_audio: Add initial decoder
Ben Dooks [Tue, 23 Apr 2019 16:47:04 +0000 (17:47 +0100)]
tdm_audio: Add initial decoder

4 years agoamulet_ascii: Drop unneeded rxtx_channels.
Uwe Hermann [Sun, 24 Nov 2019 15:33:32 +0000 (16:33 +0100)]
amulet_ascii: Drop unneeded rxtx_channels.

4 years agoamulet_ascii: Drop a few unneeded parenthesis.
Uwe Hermann [Sun, 24 Nov 2019 15:30:47 +0000 (16:30 +0100)]
amulet_ascii: Drop a few unneeded parenthesis.

4 years agoInitial Amulet LCD ASCII PD
Vesa-Pekka Palmu [Fri, 19 Jul 2019 12:08:26 +0000 (15:08 +0300)]
Initial Amulet LCD ASCII PD

This is a protocol decoder for the 'ASCII' protocol used by
Amulet Technologies LCDs.

Currently some commands are not implemented yet. I also lack capture data
from a display that will use replies other than ACK and NACK.

Reads are untested as I have no suitable captures.

The PD copes with bus errors (there is an actual bug in the device I'm
reverse engineering) and most of the commands are implemented.

The unimplemented commands should generally consume the correct
number of bytes from the bus, the exception to this are the drawing
commands, because there are actually at least two revisions of them
with different payloads, that are really hard to detect in greedy
algorithm.

4 years agoFix three -fsanitize=undefined issues.
Uwe Hermann [Sat, 23 Nov 2019 16:45:23 +0000 (17:45 +0100)]
Fix three -fsanitize=undefined issues.

  instance.c:62:2: runtime error: null pointer passed as argument 1, which is declared to never be null
  instance.c:858:45: runtime error: shift exponent -1 is negative
  instance.c:836:45: runtime error: shift exponent -1 is negative

4 years agoAvoid using Py_IncRef/Py_DecRef for consistency.
Uwe Hermann [Sat, 23 Nov 2019 15:42:44 +0000 (16:42 +0100)]
Avoid using Py_IncRef/Py_DecRef for consistency.

We currently use a mix of Py_IncRef/Py_DecRef and Py_XINCREF/Py_XDECREF
or Py_INCREF/Py_DECREF in the code-base. Only use the latter variants
for the time being (for consistency).

4 years agosrd_inst_option_set(): Fix multiple memory leaks.
Uwe Hermann [Sat, 23 Nov 2019 15:16:35 +0000 (16:16 +0100)]
srd_inst_option_set(): Fix multiple memory leaks.

These were reported when compiling with "-fsanitize=address" and running
"PYTHONMALLOC=malloc make check":

  =================================================================
  ==42879==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 317 byte(s) in 6 object(s) allocated from:
      #0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
      #1 0x7f08e3f37622 in PyUnicode_New ../Objects/unicodeobject.c:1365

  Direct leak of 28 byte(s) in 1 object(s) allocated from:
      #0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
      #1 0x7f08e3f7e1a5 in _PyLong_New ../Objects/longobject.c:275

  Direct leak of 24 byte(s) in 1 object(s) allocated from:
      #0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
      #1 0x7f08e3f91521 in PyFloat_FromDouble ../Objects/floatobject.c:122

  SUMMARY: AddressSanitizer: 369 byte(s) leaked in 8 allocation(s).
   session

4 years agospiflash: lists.py: Use None for unsupported features.
Uwe Hermann [Sat, 23 Nov 2019 15:15:55 +0000 (16:15 +0100)]
spiflash: lists.py: Use None for unsupported features.

4 years agospiflash: Minor fixes for Atmel AT25 chips.
Uwe Hermann [Sat, 23 Nov 2019 15:11:27 +0000 (16:11 +0100)]
spiflash: Minor fixes for Atmel AT25 chips.

4 years agospiflash: Add support for Atmel AT25xxx
Soeren Apel [Wed, 20 Nov 2019 18:56:27 +0000 (19:56 +0100)]
spiflash: Add support for Atmel AT25xxx

4 years agoFix multiple PyObject_SetAttrString() related leaks.
Uwe Hermann [Tue, 19 Nov 2019 21:32:25 +0000 (22:32 +0100)]
Fix multiple PyObject_SetAttrString() related leaks.

This fixes bug #1374.

4 years agocondition_list_free(): Fix a memory leak.
Uwe Hermann [Sat, 16 Nov 2019 21:49:30 +0000 (22:49 +0100)]
condition_list_free(): Fix a memory leak.

4 years agouart: Add [rx|tx]_packet_len options.
Uwe Hermann [Tue, 12 Nov 2019 21:20:45 +0000 (22:20 +0100)]
uart: Add [rx|tx]_packet_len options.

Similar to the recently added [rx|tx]_packet_delimiter options, these
emit summary annotations ("packets") when a certain number of data values
have been decoded.

This is a convenience feature which can be useful when a user wants to
view data which doesn't have a specified delimiter value (as last data
value in the "packet"), but rather fixed-length "packets".

This is just an (intentionally very simple) helper/convenience improvement
and is NOT meant to replace "proper" stacked decoders for UART-based protocols.

4 years agouart: Add [rx|tx]_packet_delimiter options.
Uwe Hermann [Tue, 12 Nov 2019 21:03:21 +0000 (22:03 +0100)]
uart: Add [rx|tx]_packet_delimiter options.

This is a convenience feature that emits summary annotations ("packets")
that comprise all data values that were decoded until a specified delimiter
value is seen (as last data value of the "packet").

Example use-cases include ASCII data where it can be convenient to
"packetize" whenever a 10/0x0A value (newline) is seen, or some
protocols which have a fixed "marker" value (e.g. 0x55) as last
value in the "packet".

The annotations are affected by the selected 'format' option, i.e. the
user can get summaries in ASCII or hex or other formats.

This is just an (intentionally very simple) helper/convenience improvement
and is NOT meant to replace "proper" stacked decoders for UART-based protocols.

4 years agoconfigure.ac: Add support for Python 3.8.
Uwe Hermann [Tue, 12 Nov 2019 20:58:23 +0000 (21:58 +0100)]
configure.ac: Add support for Python 3.8.

This fixes bug #1438.

4 years agoeeprom93xx: Use fixed-width hex output.
Uwe Hermann [Sat, 9 Nov 2019 14:48:36 +0000 (15:48 +0100)]
eeprom93xx: Use fixed-width hex output.

This improves readability a bit in most cases.

4 years agoeeprom93xx: Add OUTPUT_BINARY support.
Uwe Hermann [Sat, 9 Nov 2019 14:25:47 +0000 (15:25 +0100)]
eeprom93xx: Add OUTPUT_BINARY support.