summaryrefslogtreecommitdiff
path: root/decoders/uart
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2013-09-12 09:07:53 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2013-09-12 15:56:06 +0200
commit4cace3b8485ffd04ed5c07ee81be812c7284c37b (patch)
tree179663becebc394872e1d72925cdba6274bd856b /decoders/uart
parent3091f4e048d5baab17863b49f34f7a5b5149d709 (diff)
downloadlibsigrokdecode-4cace3b8485ffd04ed5c07ee81be812c7284c37b.tar.gz
libsigrokdecode-4cace3b8485ffd04ed5c07ee81be812c7284c37b.zip
uart: Move OUTPUT_PROTO format description to pd.py.
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.
Diffstat (limited to 'decoders/uart')
-rw-r--r--decoders/uart/__init__.py19
-rw-r--r--decoders/uart/pd.py21
2 files changed, 21 insertions, 19 deletions
diff --git a/decoders/uart/__init__.py b/decoders/uart/__init__.py
index a8b7303..a0c9cef 100644
--- a/decoders/uart/__init__.py
+++ b/decoders/uart/__init__.py
@@ -38,25 +38,6 @@ the correct place where to probe). Once the data is in digital form and
matches the "UART" description above, this protocol decoder can work with
it though, no matter whether the source was on TTL UART levels, or RS232,
or others.
-
-Protocol output format:
-
-UART packet:
-[<packet-type>, <rxtx>, <packet-data>]
-
-This is the list of <packet-type>s and their respective <packet-data>:
- - 'STARTBIT': The data is the (integer) value of the start bit (0/1).
- - 'DATA': The data is the (integer) value of the UART data. Valid values
- range from 0 to 512 (as the data can be up to 9 bits in size).
- - 'PARITYBIT': The data is the (integer) value of the parity bit (0/1).
- - 'STOPBIT': The data is the (integer) value of the stop bit (0 or 1).
- - 'INVALID STARTBIT': The data is the (integer) value of the start bit (0/1).
- - 'INVALID STOPBIT': The data is the (integer) value of the stop bit (0/1).
- - 'PARITY ERROR': The data is a tuple with two entries. The first one is
- the expected parity value, the second is the actual parity value.
- - TODO: Frame error?
-
-The <rxtx> field is 0 for RX packets, 1 for TX packets.
'''
from .pd import *
diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py
index 5aa3e4a..af2e51c 100644
--- a/decoders/uart/pd.py
+++ b/decoders/uart/pd.py
@@ -22,6 +22,27 @@
import sigrokdecode as srd
+'''
+Protocol output format:
+
+UART packet:
+[<packet-type>, <rxtx>, <packet-data>]
+
+This is the list of <packet-type>s and their respective <packet-data>:
+ - 'STARTBIT': The data is the (integer) value of the start bit (0/1).
+ - 'DATA': The data is the (integer) value of the UART data. Valid values
+ range from 0 to 512 (as the data can be up to 9 bits in size).
+ - 'PARITYBIT': The data is the (integer) value of the parity bit (0/1).
+ - 'STOPBIT': The data is the (integer) value of the stop bit (0 or 1).
+ - 'INVALID STARTBIT': The data is the (integer) value of the start bit (0/1).
+ - 'INVALID STOPBIT': The data is the (integer) value of the stop bit (0/1).
+ - 'PARITY ERROR': The data is a tuple with two entries. The first one is
+ the expected parity value, the second is the actual parity value.
+ - TODO: Frame error?
+
+The <rxtx> field is 0 for RX packets, 1 for TX packets.
+'''
+
# Used for differentiating between the two data directions.
RX = 0
TX = 1