summaryrefslogtreecommitdiff
path: root/decoders
AgeCommit message (Collapse)Author
2020-07-18caliper: fixup boilerplate (and some coding style and whitespace)Gerhard Sittig
The caliper decoder was written against an older version of the library and failed to load in recent environments. Fixup the decoder boilerplate (eliminate ambiguous annotation class/row names, drop the IC tag) and address other style nits while we are here (rephrase user visible text, break a few long lines, adjust some of the indentation and whitespace issues, drop dead code). Remaining issues get addressed later.
2020-07-18caliper: introduce decoder for cheap generic calipersTomas Mudrunka
2020-07-18ir_irmp: enforce "one instance" limitation for IRMP libraryGerhard Sittig
The IRMP core library is not prepared for threading or interleaved use by multiple call sites for different data streams, internal state is kept in global vars (MCU project heritage). Adjust the Python wrapper, create one usable instance, and several more which fail to execute. Fail late such that users see error messages. The approach isn't pretty, but avoids segfaults when re-loaded sessions assign multiple decoder instances, and raises user's awareness of the "one instance" limitation by established means: "decoder error" bar, and log messages, with a description to point out the cause. This commit implements a dirty modification of a singleton. It's a pity that Python appears to lack reliable destruction, hence the whole class remains blocked even if the instance is released. Move all library use into pd.py:decode() in the hope that Python's 'with' could help in a future implementation. Prepare to either present a generic message that is generated by pd.py, or pass on a text that originates in the Python wrapper for the C library.
2020-07-18ir_irmp: add support for button "release" flagGerhard Sittig
Recent upstream IRMP core versions introduced a "release" flag in addition to the "repeat" flag. Prepare the decoder to present these flags when libraries should pass them in results. The flags' being orthogonal slightly complicates the logic which constructs annotation texts. Do provide text variants for all previously supported zoom levels, yet try to keep the implementation as simple as possible: Match list lengths for simplified folding. Always print the flags field even if none of the flags is active (kind of was done before this change as well, just not visible). This approach easily accepts more flags as needed in future versions.
2020-07-18ir_irmp: touch up the IRMP based decoder implementation (Python side)Gerhard Sittig
Address Python and sigrok project coding style nits in the IRMP based decoder for infrared signals. Re-add the attribution which was lost in a previous copy and forgotten in the recent submission. Eliminate camel case identifiers and adjust to the simplified Python binding API. Drop remaining diagnostics from development and dead code (unused carrier detection). Reword the boilerplate text to match other decoders. Avoid Python f-strings since they are not portable. Prefer slightly less cryptic variable names in the construction of annotation texts. Defer the creation of the library instance until actual decoder use. Start inspecting the input data at the very first samples in the input stream.
2020-07-18ir_irmp: introduce IRMP based decoder for infrared signalsGerhard Sittig
Commit the decoder as it was provided by Rene Staffen. Which appears to be a slightly modified version of one of the other IR decoders, though the boilerplate doesn't say so.
2020-07-18irmp: add 'Darwin' case for DLL filename lookupGerhard Sittig
Detect the MacOS platform by checking for 'Darwin' with the Python platform(3) module, and use the 'lib<stem>.dylib' filename scheme.
2020-07-18irmp: rework the Python language binding for the shared libraryGerhard Sittig
Rename the Python language binding's source file and identifiers to eliminate camel case (most of it, stick with camel case in Python class names as is the convention). Adjust whitespace and arrange tables such that their indentation will last during maintenance. Re-add the license text which was missing in the original submission's copy of another decoder. Add copyright information for this submission. Don't "import *" from ctypes(3), use explicit references instead. Avoid double underscores as single leading underscore is already bad enough. Adjust the Python side to the C library's renamed API routines. Create a result data structure layout that only has a single level of nesting, which better represents the C library's interface. Only flags "get unfolded" in the Python binding, to eliminate magic numbers. Prepare to support more platforms than Linux (detected) and Windows (the default when nothing else got detected).
2020-07-18irmp: introduce Python language binding for shared libraryGerhard Sittig
Commit the IrmpPythonWrap.py file as it was provided by Rene Staffen.
2020-07-17pjon: comment nits, typo fixGerhard Sittig
2020-07-17pjdl: support PAD bit adjacent to last HIGH DATA bit (no LOW)Gerhard Sittig
The PJDL decoder's previous implementation was incomplete. It assumed that PAD bits always start with a rising edge. Which made the decoder miss the next byte when a previous byte's MSB is set, and the last DATA bit and the next PAD bit kept the signal HIGH between them (no LOW phase was seen between these symbols). Keep the check for the LOW level after the byte's last DATA bit within the bit times' tolerance. But accept when the level remains HIGH, and check for the HIGH bit's width starting from the end of the last DATA bit. Also start the PAD bit's annotation from that "virtual" edge. This patch is based on a fix that was Submitted-By: Julio Aguirre <jcallano@gmail.com>
2020-07-17pjon: unbreak CRC32 check, adjust data lengthGerhard Sittig
The previous implementation unconditionally assumed a CRC width of one byte when it calculated the checksum for received frame data. Do reflect on the CRC8/CRC32 choice instead. This patch is based on a fix that was Submitted-By: Julio Aguirre <jcallano@gmail.com>
2020-07-13eeprom24xx: Add ST M24C32Thomas Hebb
2020-07-10xy2-100: Add status signalSoeren Apel
2020-07-10xy2-100: Rewrite PD for XY2-100E compatibility and featuresSoeren Apel
2020-07-10xy2-100: Initial implementationUli Huber
2020-07-07timing: user selected scale and sample count for terse displayGerhard Sittig
Optionally let users pick the scale for terse timing annotation text. Which potentially makes numbers show up earlier (at zoom levels of a further distance). And drops the unit to present mere numbers, which could speed up navigation during inspection. Keep providing automatic scaling which then includes the unit text, as it did before. Extend the automatic scaling to include picoseconds. Which avoids the fallback to unit-less floating point with uncertain decimals when the samplerate was 1GHz or higher. Optionally present distances in terms of sample counts. This supports decoder development, and can help users spot and judge glitches. All "terse" presentation so far exclusively affects the 'time' row. It remains an option for later to migrate averages and deltas as well. For now it's assumed that high(er) precision and fine grained details are more important for these rows.
2020-07-07timing: break long options lines, rename samples identifierGerhard Sittig
Break text lines in the options declarations which have become rather long. Rename 'samples' in the main loop to just 'sa', which better matches the other 'ss', 'es', 't', etc identifers. Separate the code for unconditional 'time' classes from optional averaging and deltas.
2020-07-07timing: only queue when averaging, rephrase put callsGerhard Sittig
Reduce the amount of work which the timing decoder needs to do. Only keep the deque() filled when averaging is active. Rephrase .put() calls to reduce text line lengths (and for consistency with a pending change). Move another options lookup for deltas out of the main loop.
2020-07-07timing: optional terse format for timing annoationsGerhard Sittig
In some situations (inspecting a dense run of pulses in a burst of data communication) it takes a lot of zooming before the 'timing' decoder's 'time' annotations start revealing numbers. Which limits the number of pulses which can fit in the visible trace area. This is a stab at improving the usability of the timing decoder for similar "crowded pulses" scenarios. Try to come up with an annotation text that is shorter yet communicates the very details which the user needs in this situation. Drop the frequency, avoid umlauts in the unit text, don't use decimal places (use all integers within a scale). Even offer to drop the unit text, assuming that a dense run of pulses results in all times sharing their scale. Make the terse presentation optional and off by default, and use a separate annotation class for maximum backwards compatibility.
2020-07-07timing: use ss/es for consistencyGerhard Sittig
Consistently use ss and es identifiers for annotation emission to match other decoders, as well as counting distances between sample points to increase readability. This also dramatically reduces text line length.
2020-07-07timing: reduce "state", most action is local to .decode()Gerhard Sittig
Reduce the number of self members, use local variables instead for data which is strictly kept within a method and need not remain across calls. Move options dictionary lookups out of the main loop, as the previous implementation already did with 'edge'.
2020-07-07timing: eliminate magic numbers, remove unused variablesGerhard Sittig
Use symbolic identifiers for pin numbers and annotation classes. Remove unused variables.
2020-07-07pjon: fixup PD category for PJDL and PJONGerhard Sittig
2020-07-07sae_j1850_vpw: drop the part which duplicates the timing decoderGerhard Sittig
The SAE J1850 Variable Pulse Width decoder used to track and annotate the width of pulses between edges, which duplicates existing features of the 'timing' decoder. Remove this part from J1850, users can always connect the input signal to multiple decoders as needed.. Also sort annotation rows while we are here. Top to bottom represents raw wire bits to highest interpretation layer, as in other decoders.
2020-07-07sae_j1850_vpw: eliminate magic numbers for annotation class referencesGerhard Sittig
Use symbolic identifiers for annotation classes, to improve readability and maintainability.
2020-07-07sae_j1850_vpw: update for API v3, adjust to recent requirementsGerhard Sittig
IRC user pman92 reported that this decoder exists, and started migration to the v3 API. This commit completes the migration, and adds missing decoder infrastructure which has become mandatory recently. Adjust the boilerplate: Drop FSF postal address. No Python output, add category tag, unambiguous annotation class and row names. Add reset() method. Use common code for edge detection. This commit also addresses minor style nits. Pass the most recent pulse's edges as ss and es to the data bit handling routine. Adjust whitespace to unbreak editor navigation and to improve readability. Use a more verbose name for the decoder, "vpw" appears a little short and collision happy, and is not found when users search for "j1850". [ Indentation changed, see whitespace ignoring diff for the essence. ] Reported-By: pman92 <dpriestley92@hotmail.com>
2020-07-07vpw: introduce SAE J1850 (VPW) decoderAnthony Symons
Introduce a protocol decoder for the GM VPW 1x and 4x Vehicle Bus (SAE J1850, or VPW for variable pulse width).
2020-07-02pjon: show "communication relations", and nitsGerhard Sittig
Do track the RX and TX information, including their bus IDs. Present bus numbers as dotted quads. Emit another summary annotation for completed frames which presents receiver, transmitter, payload, and ACK details at even higher zoom levels. Rename the last remaining "init CRC" instance for consistency.
2020-07-02pjdl: prepare for "stretched" timingsGerhard Sittig
Since the spec is vague on the subject, and real world captures were found to occassionally run on odd clocks, internally prepare to inspect traffic and interpret its content although the input data is invalid in the strictest sense. Keep this hack internal, don't suggest to users that invalid traffic would be perfectly acceptable.
2020-07-02pjon: use underscore in input/output names for stacked decodersGerhard Sittig
Rename 'pjon-link' to 'pjon_link' for consistency with other decoders.
2020-06-24pjon: introduce decoder for PJON frame inspectionGerhard Sittig
Introduce a protocol decoder which accepts 'pjon-link' Python input and interprets PJON frames. The implementation is assumed to be operational but most of the protocol's flexibility (optionally present and variable width fields) has not yet been tested due to lack of example captures. During development of the PJON decoder only the PJDL link layer decoder was available, other link layers were not tested.
2020-06-24pjdl: introduce decoder for PJON single wire serial link layerGerhard Sittig
Introduce a protocol decoder which generates 'pjon-link' output from 'logic' input by interpreting the PJDL single wire serial communication link layer of the PJON protocol stack. This decoder extracts frame markers, data bytes, as well as their pad/sync decoration. Inspection of data values, or checks for frame validity remain the responsibility of a stacked decoder which is shared among several link layer types. This implementation "violates" the PJDL spec in those places where the spec is incomplete or vague, and real world traffic would not decode at all when the strict letter of the spec is applied instead of its spirit. When in doubt, the decoder implementation errs to the usability side. Carrier sense detection is incomplete in this version. Data extraction works for all currently available captures. Recovery from synchronization loss after glitches is acceptable. Glitch filtering is missing (the spec is silent on this subject).
2020-06-23jtag: Use list.append instead of insertKonrad Beckmann
Improve processing time by appending bits instead of inserting them to the lists.
2020-05-26nrf905: Drop non-existent OUTPUT_PYTHON output.Uwe Hermann
2020-05-26nrf905: More readable annotation byte values.Uwe Hermann
Drop the 0x prefix for each byte in annotations (for improved readability). Also, use 02X instead of 02x (printf-style formats).
2020-05-26nrf905: Drop all print() calls.Uwe Hermann
If those are useful for the decoder user, they should be annotations using the Ann.WARN annotation class.
2020-05-26nrf905: Simplify a few code snippets.Uwe Hermann
2020-05-26nrf905: Use SrdIntEnum for annotation classes.Uwe Hermann
2020-05-26nrf905: Add missing 'tags' item.Uwe Hermann
2020-05-26ntf905: Add/rename required self.reset() method.Uwe Hermann
2020-05-26Add decoder for Nordic Semiconductor nRF905 chipJorge Solla
2020-05-21adxl345: Update register meaning for 0x21, 0x22, 0x23 regs.Teo Perisanu
On the Data row, the content of the single-byte registers is decoded as follows: '<Meaning> <Value> <Unit>'. Initially, the meaning for these registers was misplaced. This commit updates these meanings as they really are. Signed-off-by: Teo Perisanu <Teo.Perisanu@analog.com>
2020-04-11ad79x0: Rename the 'ref' option to 'vref'.Uwe Hermann
2020-04-11ad79x0: Reduce unnecessarily many voltage formats.Uwe Hermann
2020-04-11ad79x0: Fix the tags metadata item.Uwe Hermann
2020-04-11ad79x0: Avoid duplicated annotation class/row IDs.Uwe Hermann
2020-04-11Add AD79x0 decoder.Teo Perisanu
Signed-off-by: Teo Perisanu <Teo.Perisanu@analog.com>
2020-04-11ad5626: Always use the same number of decimal places.Uwe Hermann
2020-04-11ad5626: Rename an annotation class.Uwe Hermann