summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-31session: add "terminate and reset" support for protocol stacksGerhard Sittig
Implement routines which terminate currently pending decoder operations and reset internal state (on the C and Python sides) for instances as well as sessions. This allows to re-use previously created stacks for new input data.
2018-03-31Decoder: check for duplicate register() calls in common backend codeGerhard Sittig
Future implementations might call decoders' start() routine several times, which makes them call register() again. It's desirable that the common backend code copes with this condition, such that (the multitude of) decoder implementations need not work around a specific constraint.
2018-03-31decoder: rephrase .has_channel() argument parse logicGerhard Sittig
Have the Python C API check the argument type and do the type conversion already. Raise an IndexError exception when the range check fails.
2018-03-31instance: make sure oldpins array is available after resetGerhard Sittig
Introduce an oldpins_array_seed() helper routine, to make sure that each call site which checks previous pin state will find valid data. This was not always the case after decoder reset, which released the old pin data while applications would not call srd_inst_new() again. Preset newly allocated arrays with the default initial pin state, allow optional application calls to specify differing initial values (when specified by users), and keep the current state after first data was processed.
2018-03-31adns5020: Python style nit, fixup whitespaceGerhard Sittig
2018-03-31max7219: introduce constructor and reset() methodGerhard Sittig
The "max7219" decoder used to have no constructor, which made me miss it when reset() got introduced. Implement those two methods (which do nothing, and thus won't change behaviour).
2018-03-31microwire: introduce constructor and reset() methodGerhard Sittig
The "microwire" decoder used to have no constructor, which made me miss it when reset() got introduced. Implement those two methods (which do nothing, and thus won't change behaviour).
2018-03-18print_searchpaths(): Print decoder and system search paths.Uwe Hermann
2018-03-17Fix part of #1128 by adding a way to retrieve PD search pathsSoeren Apel
As this uses g_slist_copy_deep(), we now require glib 2.34.
2018-03-07Add support for SDA2506 EEPROM serial protocol.Max Weller
2018-03-07Minor whitespace/typo fixes.Uwe Hermann
2018-02-23dali: Avoid CamelCase in most places.Uwe Hermann
2018-02-15ir_nec: optionally accept input signals that include the carrierGerhard Sittig
Introduce optional detection of a carrier signal. Immediately "go active" when edges are seen. "Go inactive" again in the absence of edges in a specified period of time. Cope with input signals that already had the carrier removed. By default carrier detection is disabled, to remain pixel compatible to the previous implementation. When a carrier frequency is specified and thus detection is enabled, edges of already filtered input are shifted by one carrier period, and thus changes the output of the decoder. For unfiltered inputs that still contain the carrier, detection of activity is reliable and immediate, but the active phase is extended by one period of the carrier frequency (which is considered acceptable).
2018-02-13parallel: expand 'wordsize' description (bits vs cycles)Gerhard Sittig
Users may not know which unit the "wordsize" is supposed to get specified in. Especially when it's not a number of bits, but instead the number of bus cycles. Expand the description text accordingly.
2018-02-13stepper_motor: make samplerate meta data optionalGerhard Sittig
Only emit the speed annotations when a sample rate was specified. Cope with the absence of a sample rate for the input stream. Decoding is still possible, it's just that no timing information is available.
2018-02-13i2s: make samplerate meta data optionalGerhard Sittig
Only emit sound samplerate information when an input stream sample rate was specified. Cope with the absence of a sample rate for the input stream. Decoding is still possible, it's just that no timing information is available.
2018-02-13i2c: make input samplerate optionalGerhard Sittig
Absence of a samplerate for the input stream should not be fatal. The protocol decodes fine, we just cannot determine a bitrate for frames. This addresses part of bug 1076.
2018-02-10configure.ac: explicitly require pkg-config related macroGerhard Sittig
Make sure the PKG_PROG_PKG_CONFIG macro has become available before it gets used. This unbreaks configuration in the poky environment (rocko).
2018-01-28graycode, morse, pwm, usb_request, wiegand: cope with absent sample rateGerhard Sittig
Improve robustness of some more protocol decoders. Few of them never checked for the availability of a sample rate in the first place, others checked for the presence of a spec but would not cope with a value of 0. Some checked the value only after processing it, which could result in runtime errors. This change is motivated by bug #1118.
2018-01-28spi: cope when a sample rate of 0 was configuredGerhard Sittig
The explicit test for None was not good enough. Change test conditions such that sample rates only get processed when they got specified _and_ were not zero. This fixes bug #1118.
2018-01-25ac97: introduce first AC'97 decoder implementation (bits, slots, binary)Gerhard Sittig
Introduce an "audio and modem control for PC systems" protocol decoder (referred to as AC'97). This implementation extracts bits and identifies frames, and annotates the slots of a frame with mere integer values. Bit fields get decoded depending on the slot numbers. Bit patterns in audio/modem data slots can get exported as binary streams. Some TODO items remain. Register access (read/write) gets annotated, but neither gets interpreted nor affects the decoding of subsequent frames. The RESET# line status does not get evaluated.
2018-01-13i2c: Drop obsolete 10bit slave address TODO.Uwe Hermann
Nobody has seen any such slave in the wild, yet. In the very unlikely case that someone actually sees or needs this, patches are welcome though (together with sample .sr files).
2018-01-03counter: make 'reset' signal polarity an optionGerhard Sittig
Allow configuration of the 'reset' signal polarity. Reset counters on either falling (default) or rising edges.
2018-01-03counter: Make "word reset" an explicit annotation class+row.Uwe Hermann
Also, add long and short annotation string versions.
2018-01-03Add a trivial "counter" decoderStefan Brüns
This decoder just counts the number of falling and/or rising edges. This is especially useful for diagnosing protocols with a clock signal or a fixed number of transitions per bit, e.g. pulse length coded. It also provides a divider, which can be used to e.g. count the number of words in I²C or SPI transfers.
2018-01-01parallel: implement consistent number formattingGerhard Sittig
Print all annotations for individual data bit items and for the de-multiplexed words in a consistent style with leading zeros and constant width. This shall lend itself better to quick navigation during visual inspection, as well as automatic processing.
2018-01-01parallel: unbreak and improve "word" de-multiplexingGerhard Sittig
The previous implementation prepared but never fully enabled the accumulation of several multi-bit items into words that span multiple bus cycles (think: address or data de-multiplexing on memory busses). Complete the accumulation, and fixup the end samplenumber for word annotations. Fixup the endianess logic (the condition was inverted). Rephrase calculation to be more Python idiomatic. Default to word size zero, and only emit word annotations for non-zero word size specs. This keeps the implementation backwards compatible and still passes the test suite. Default behaviour is most appropriate for interactive use in GUI environments, while automated processing will find consistent behaviour across all setups (non-multiplexed busses, and multiplexed busses with "words" that span one or multiple cycles).
2018-01-01parallel: cope with sparse input mappings, assume zero for not-connected pinsGerhard Sittig
Cope when users only provide e.g. input lines D0 and D2 to the parallel decoder. Assume that not-connected pins are "always zero". Rephrase the .decode() logic which determines .wait() conditions while we are here, to slightly unobfuscate the implementation. This fixes bug #1088.
2018-01-01parallel: address minor style nits, no change in behaviourGerhard Sittig
Remove the redundant .itemcount variable, which exactly corresponds to the length of the .items array. Arrange retrieval of options and their evaluation closer to each other for improved readability. Use common logic to construct "words" from several multi-bit "items". Arrange for endianess support by optionally reversing the array before traversal.
2018-01-01parallel: unify decode() code paths with and without clock signalGerhard Sittig
Instead of implementing two main loops for operation in the presence and in the absence of a clock line, use a common main loop which operates on pre-determined wait conditions.
2017-12-22usb_power_delivery: enforce check order for start-of-packet sequencesGerhard Sittig
The list of a dictionary's keys need not reproduce in identical order everywhere. Make sure to run all start-of-packet sequence checks in the decoder implementation in a specific order on each machine, such that annotations get emitted with identical content and in the same order for each execution of the decoder. This fixes the remaining part of bug #1090.
2017-12-22usb_power_delivery: fixup a Python style nit (dict lookup fallback)Gerhard Sittig
Use the dictionary's .get() method in combination with a default result parameter, instead of an explicit "k in dictvar" test and a conditional assignment.
2017-12-22usb_power_delivery: enforce numerical order of RDO/PDO flag annotationsGerhard Sittig
Annotations of the USB power delivery decoder contain multiple text fragments that correspond to several flags in bit fields. The Python runtime did not guarantee an order of emission and made the test suite fail. Sort the order in which RDO and PDO flags related text fragments get constructed and concatenated. Print text for higher bit positions first as this might feel more intuitive to users. This fixes part of bug #1090.
2017-12-22all decoders: introduce a reset() methodGerhard Sittig
Move initialization code of protocol decoders from the constructor to a new reset() helper method. The libsigrokdecode backend could run this method several times to clear the decoder's internal state, before new data from another acquisition gets fed to decode() calls.
2017-12-22ssi32: rename reset() helper methodGerhard Sittig
The ssi32 decoder implements a reset() method which clears internally accumulated data during decoding. Rename the method before all decoders will grow a new reset() method that will be used for a different purpose.
2017-12-22mrf24j40: rename reset() helper methodGerhard Sittig
The mrf24j40 decoder implements a reset() method which clears internally accumulated data during decoding. Rename the method before all decoders will grow a new reset() method that will be used for a different purpose.
2017-12-22ade77xx: rename reset() helper methodGerhard Sittig
The ade77xx decoder implements a reset() method which clears internally accumulated data during decoding. Rename the method before all decoders will grow a new reset() method that will be used for a different purpose.
2017-12-22sdcard_sd: remove unused .reset() methodGerhard Sittig
The decoder's .reset() method seems to partially implement constructor's assignments, but is not referenced anywhere. There is neither a direct call site in the remainder of pd.py which uses the "reset" name, and runtime computation only references "handle_*()" methods for commands and responses. Drop the unused .reset() method in the individual decoder before the introduction of a common .reset() method approach for all decoders.
2017-12-22am230x: rename reset() helper methodGerhard Sittig
The am230x decoder implements a reset() method which clears internal decoder state. Rename the method before all decoders will grow a new reset() method that will be used for a different purpose.
2017-12-22eeprom 24xx: rename reset() helper methodGerhard Sittig
2017-12-17ir_nec: Make timing margin relativeGrant Miller
This replaces the fixed timing margin with a percentage based tolerance to better allow for timing inaccuracies, especially for longer timings like the Leader and Repeat codes.
2017-12-09graycode: Move bitpack/bitunpack to common/.Uwe Hermann
2017-12-09Add a gray code and rotary encoder protocol decoder.Christoph Rackwitz
2017-12-09Add a morse code protocol decoder.Christoph Rackwitz
2017-12-09i2s: Fix unportable use of struct.packMarcus Comstedt
Using the format string 'I' with the default (implied) prefix '@' results in both word size and endianness being platform dependent. In this case standard size (32 bits) and little endianness is required, so the prefix '<' needs to be used.
2017-12-09maple_bus: Add helpers to make the call sites a bit shorter.Uwe Hermann
2017-12-09Add an initial Maple bus decoder.Marcus Comstedt
2017-11-11instance.c: Removed redundant variableJoel Holdsworth
2017-11-11configure.ac: Added AC_C_BIGENDIAN to autoconfJoel Holdsworth
This is needed so that WORDS_BIGENDIAN is defined on big-endian systems, which is needed by version.c .
2017-11-11i2s: Set file size to 4GbJoel Holdsworth