]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/uart/__init__.py
uart: Drop extensive protocol info (moved to wiki).
[libsigrokdecode.git] / decoders / uart / __init__.py
index 4267d83b915acc688da19e171d4313baed8b379b..a8b73039916b505ad0e0b46aecb281943833d7e8 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## This file is part of the sigrok project.
+## This file is part of the libsigrokdecode project.
 ##
 ## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
 ##
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-from .uart import *
+'''
+UART protocol decoder.
+
+Universal Asynchronous Receiver Transmitter (UART) is a simple serial
+communication protocol which allows two devices to talk to each other.
+
+This decoder should work on all "UART-like" async protocols with one
+start bit (0), 7-9 databits, an (optional) parity bit, and one or more
+stop bits (1), in this order.
+
+It can be run on one signal line (RX or TX) only, or on two lines (RX + TX).
+
+There are various standards for the physical layer specification of the
+signals, including RS232, (TTL) UART, RS485, and others. However, the logic
+level of the respective pins is only relevant when acquiring the data via
+a logic analyzer (you have to select the correct logic analyzer and/or
+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 *