summaryrefslogtreecommitdiff
path: root/decoders/uart/pd.py
AgeCommit message (Collapse)Author
2017-01-07license: remove FSF postal address from boiler plate license textGerhard Sittig
Remove the FSF postal address as it might change (it did in the past). Reference the gnu.org website instead which is more stable.
2016-10-23uart: Default to hex format datavalue annotations.Uwe Hermann
This is in almost all cases what the user will want, only rarely ASCII (the old default) will be the more natural fit.
2016-10-23uart: Emit 2 bytes for 9-bit UART binary output.Uwe Hermann
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.
2016-10-19uart: skip frames with invalid start bitsGerhard Sittig
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 <gerhard.sittig@gmx.net>
2016-10-19uart: rework text formatting of communicated data values, plus nitsGerhard Sittig
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 <gerhard.sittig@gmx.net>
2016-10-19uart: minor nit, rename the "databyte" variableGerhard Sittig
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 <gerhard.sittig@gmx.net>
2016-09-24uart: Fix a bug in the output for stacked PDs.Uwe Hermann
The UART bit information was not transmitted correctly to stacked PDs if there was an overlap between RX and TX bytes in the data.
2016-05-15Use consistent __init__() format across all PDs.Uwe Hermann
The previous **kwargs some PDs had is not actually ever used, so drop it.
2016-01-29uart: Optimize handling of samples when tx and rx are both idleDaniel Thompson
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.
2015-12-24Use self.out_binary naming consistently across all PDs.Uwe Hermann
2015-12-24Use a Python list (not tuple) for OUT_BINARY.Uwe Hermann
This is more consistent with annotation syntax and looks slightly better in most cases.
2015-10-22UART: Handle framing errors betterElrond
1. Show Frame Error on the Start bit 2. Don't overwrite framing errors with (valid) start/stop bit info
2015-02-17Improve uart decoder sample positions at high data rates.Petteri Aimonen
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.
2014-10-16uart: Fix code comment.Uwe Hermann
2014-10-16uart: Emit databyte and bits list at the same time.Uwe Hermann
This will allow for much simpler code in stacked PDs. Adapt stacked PDs to new API.
2014-09-15uart: Implement signal inversionDavid Barksdale
2014-08-14spi/nrf24l01/uart: Use ChannelError exception.Uwe Hermann
Rename the old MissingDataError to the clearer ChannelError. Also, add ChannelError in the UART decoder.
2014-07-15All PDs: Minor whitespace and consistency fixes.Uwe Hermann
- No newlines at the end of files. - No trailing ';' characters. - Comparison with None: Use 'is None' or 'is not None'. - Comparison with True/False: Use 'if cond:' or 'if not cond:'. - Various minor whitespace fixes.
2014-07-09uart/i2cfilter: Don't check multiple-choice options.Uwe Hermann
For options which only have a limited set of valid values, we don't need to check (in the PD) whether a valid value was supplied, since the backend can do that for us.
2014-07-09Various PDs: Throw SamplerateError instead of Exception.Uwe Hermann
Also, 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.
2014-07-09All PDs: Drop unneeded exceptions.Uwe Hermann
In all current PDs it is not necessary to raise an exception upon invalid states (of the PD's state machine), since we can guarantee that no such invalid state can ever be reached in these PDs.
2014-04-15All PDs: More consistent OUTPUT_PYTHON format docs.Uwe Hermann
2014-04-15All PDs: Bump api_version to 2.Uwe Hermann
Older libsigrokdecode versions are no longer able to use the current versions of the PDs (various changes in syntax etc).
2014-04-13Rename 'probe' to 'channel' everywhere.Uwe Hermann
Variables of type 'struct srd_channel *' are consistently named 'pdch' to make them easily distinguishable from libsigrok's 'struct sr_channel *' variables that are consistently named 'ch'.
2014-03-10Probes, optional probes and annotations now take a tuple.Bert Vermeulen
Annotation entries also consist of a tuple, not a list.
2014-03-10Remove unused probes and optionsBert Vermeulen
2014-03-10Change PD options to be a tuple of dictionaries.Bert Vermeulen
Each option consists of a dictionary with the following keys: id The option id, which is passed in when setting a value. desc A description of the option, suitable for display. def The default value for this option. values (optional) If present, a tuple containing values the option may take. They must be of the same type as the default. Valid types for the options are UTF-8-encoded strings, integers, and floating point values.
2014-02-23uart: Emit per-bit annotations and OUTPUT_PYTHON data.Uwe Hermann
2014-02-01uart: Better annotation row handling of parity errors.Uwe Hermann
2014-01-31uart: Define annotation rows.Uwe Hermann
Also, provide all the required annotation classes for this to work properly.
2014-01-31uart: Allow either RX or TX to be optional.Uwe Hermann
2014-01-30s/out_proto/out_python/.Uwe Hermann
The output type is now called OUTPUT_PYTHON, adapt all PDs to that.
2014-01-30uart: Better fix for ASCII output.Uwe Hermann
This is a temporary thing, later there'll be some facility to let frontends handle any annotations marked as "this is a number" (as opposed to "this is a string") in a generic manner and display them in any supported (by that frontend) format, e.g. ascii, hex, oct, decimal, binary, big-endian vs. little-endian, and so on. This is a fix related to #201.
2014-01-28All PDs: Consistent naming/case for annotation shortnames/IDs.Uwe Hermann
2014-01-28All PDs: Drop unneeded comments.Uwe Hermann
The single comment re-stating the PD's name / description / purpose in each pd.py file is not really needed, that info is available in the Decoder class' attributes already.
2014-01-23uart: Add binaryout/dump support, drop obsolete 'uart_dump' PD.Uwe Hermann
The functionality of the preliminary 'uart_dump' PD is now available in the proper 'uart' PD, via the OUTPUT_BINARY mechanism that frontends can use to dump decoded data (in various formats) to a file, or pipe it into other applications, and so on. Old sigrok-cli example usage: $ sigrok-cli -i foo.sr -P uart:rx=0:tx=1,uart_dump:filename=bootlog.txt New sigrok-cli example usage: $ sigrok-cli -i foo.sr -P uart:rx=0:tx=1 -B uart=rxtx > bootlog.txt New sigrok-cli example usage (piping into other applications): $ sigrok-cli -i foo.sr -P uart:rx=0:tx=1 -B uart=rxtx | grep "whatever"
2013-12-03uart: Display non-ASCII characters properly.Uwe Hermann
We use the [XX] notation for non-printable characters, which is what various other logic analyzer software packages do too, e.g. the CWAV USBee Suite. This fixes bug #201.
2013-11-15Drop obsolete report() method.Bert Vermeulen
2013-11-15Use the new Decoder.register() APIBert Vermeulen
2013-11-07Rename inter-PD output type to SRD_OUTPUT_PYTHONBert Vermeulen
This better reflects what it is: a python object generated and processed by python code.
2013-10-30Receive samplerate via metadata(), not start()Bert Vermeulen
2013-09-12uart: Output data in separate RX and TX annotation types.Uwe Hermann
There is one annotation type for the RX side of the communication/data output now, and another one for the TX side. This allows GUIs to show them in two different traces, and/or show them in the same trace but with different colors. This also has the additional benefit that it is clear which databyte belongs to which direction. Previously the annotations had to look like "RX: 5F" or "TX: 11001011", but the "RX: " and "TX: " prefixes are now no longer required, making the GUI traces (and CLI output too) much more readable.
2013-09-12uart: Use same length for data output in all cases.Uwe Hermann
Until now you could get e.g. "d" or "df" as hex output from the UART PD. This will now be a common-length "0D" and "DF". When all data byte annotations are of the same lengths the readability in GUI traces is a lot better. Also, hardcode hex characters to be upper-case (for now). The same applies to oct ("021" instead of "21") and bin output ("00001001" instead of "1001").
2013-09-12uart: Put annotations into proper annotation types.Uwe Hermann
There are now extra annotation types for data, start/stop/parity bits and for warnings (e.g. "invalid parity" or "frame error" or such). This allows users to select which of the annotation types they want to see (they can select one/multiple/all annotations as needed), and also allows them to use different visual representation for the different annotation types in GUIs (e.g. different colors for the blobs, different fonts, rectangle/round/elliptic blobs, and so on; how the annotation blobs are displayed is entirely up to the GUI and its configuration by the user).
2013-09-12uart: Move OUTPUT_PROTO format description to pd.py.Uwe Hermann
This is information that a user (when viewing PD info in a GUI/CLI) should not see (and doesn't care to see), it is meant for developers only. Thus, make it a comment in pd.py instead.
2013-09-12uart: Make data format selection a PD option.Uwe Hermann
Until now we (ab)used annotation types for outputting the same data (numbers) in different formats (hex, ascii, binary, and so on). Turn this into a proper PD option, since annotation types should rather be used for different _types_ of annotations (e.g. "CRC", "Stop bit", "Preamble", "Sequence counter", "Warnings", and similar things), not different _formats_ for the same annotation type. Old sigrok-cli invocation for hex output: sigrok-cli ... -P uart:rx=0:tx=1 -A uart=hex New: sigrok-cli ... -P uart:rx=0:tx=1:format=hex In GUIs there is now a new "Data format" option where the user can select the output format for UART data (default is 'ascii').
2013-09-12uart: Use T for stop bit, P for parity bit.Uwe Hermann
The short(est) annotations for "Stop bit" and "Parity bit" have both been "P" until now, which is confusing for users (on certain zoom levels in GUIs). Use "T" for stop bits now instead.
2013-09-12uart: Don't prefix databyte output numbers.Uwe Hermann
Previously the output was 0x41 or 0o101 or 0b1000001, now it is 41 or 101 or 1000001. We drop these prefixes, since they decrease the readability of the PD output (especially when displayed in GUIs) and are not needed anyway since the user knowingly selected the number format before running the respective PD.
2013-09-12uart: Fix corner-case that can occur with LA triggers.Uwe Hermann
Assume that the initial pin state is 1/high for the RX and TX lines. This fixes the decode when an LA triggers on e.g. TX=low (the first sample would be low in that case, so the falling edge for the start bit would be missed by the decoder).
2013-09-12uart: Fix start-/end-sample numbers.Uwe Hermann
This now makes the UART decoder suitable for use in GUIs. This fixes bug #148.