summaryrefslogtreecommitdiff
path: root/decoders/i2c.py
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2012-01-15 04:02:21 +0100
committerBert Vermeulen <bert@biot.com>2012-01-15 04:05:32 +0100
commit87998e973f16206be1391f87ccae7c2756baf353 (patch)
tree80620830945c5eab992052f0462c99de3ed38efc /decoders/i2c.py
parent451680f192b97d652fb02186f5201efa0d668a2a (diff)
downloadlibsigrokdecode-87998e973f16206be1391f87ccae7c2756baf353.tar.gz
libsigrokdecode-87998e973f16206be1391f87ccae7c2756baf353.zip
CLI: when invoked with only -a <pd>, the PD's documentation is shown.
Diffstat (limited to 'decoders/i2c.py')
-rw-r--r--decoders/i2c.py43
1 files changed, 22 insertions, 21 deletions
diff --git a/decoders/i2c.py b/decoders/i2c.py
index 0044190..e63ab85 100644
--- a/decoders/i2c.py
+++ b/decoders/i2c.py
@@ -22,7 +22,6 @@
# I2C protocol decoder
#
-#
# The Inter-Integrated Circuit (I2C) bus is a bidirectional, multi-master
# bus using two signals (SCL = serial clock line, SDA = serial data line).
#
@@ -69,26 +68,28 @@
# TODO: Handle multiple different I2C devices on same bus
# -> we need to decode multiple protocols at the same time.
-#
-# Protocol output format:
-#
-# I2C packet:
-# [<i2c_command>, <data>, <ack_bit>]
-#
-# <i2c_command> is one of:
-# - 'START' (START condition)
-# - 'START REPEAT' (Repeated START)
-# - 'ADDRESS READ' (Slave address, read)
-# - 'ADDRESS WRITE' (Slave address, write)
-# - 'DATA READ' (Data, read)
-# - 'DATA WRITE' (Data, write)
-# - 'STOP' (STOP condition)
-#
-# <data> is the data or address byte associated with the 'ADDRESS*' and 'DATA*'
-# command. For 'START', 'START REPEAT' and 'STOP', this is None.
-#
-# <ack_bit> is either 'ACK' or 'NACK', but may also be None.
-#
+"""
+I2C protocol output format:
+
+The protocol output consists of a (Python) list of I2C "packets", each of
+which is of the form
+
+ [ _i2c_command_, _data_, _ack_bit_ ]
+
+_i2c_command_ is one of:
+ - 'START' (START condition)
+ - 'START_REPEAT' (Repeated START)
+ - 'ADDRESS_READ' (Address, read)
+ - 'ADDRESS_WRITE' (Address, write)
+ - 'DATA_READ' (Data, read)
+ - 'DATA_WRITE' (Data, write)
+ - 'STOP' (STOP condition)
+
+_data_ is the data or address byte associated with the ADDRESS_* and DATA_*
+command. For START, START_REPEAT and STOP, this is None.
+
+_ack_bit_ is either 'ACK' or 'NACK', but may also be None.
+"""
import sigrokdecode as srd