summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
Diffstat (limited to 'decoders')
-rw-r--r--decoders/i2c/__init__.py22
-rw-r--r--decoders/i2c/pd.py23
2 files changed, 23 insertions, 22 deletions
diff --git a/decoders/i2c/__init__.py b/decoders/i2c/__init__.py
index 2442ee1..57309e3 100644
--- a/decoders/i2c/__init__.py
+++ b/decoders/i2c/__init__.py
@@ -23,28 +23,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).
-
-Protocol output format:
-
-I2C packet:
-[<cmd>, <data>]
-
-<cmd> is one of:
- - 'START' (START condition)
- - 'START REPEAT' (Repeated START condition)
- - 'ADDRESS READ' (Slave address, read)
- - 'ADDRESS WRITE' (Slave address, write)
- - 'DATA READ' (Data, read)
- - 'DATA WRITE' (Data, write)
- - 'STOP' (STOP condition)
- - 'ACK' (ACK bit)
- - 'NACK' (NACK bit)
-
-<data> is the data or address byte associated with the 'ADDRESS*' and 'DATA*'
-command. Slave addresses do not include bit 0 (the READ/WRITE indication bit).
-For example, a slave address field could be 0x51 (instead of 0xa2).
-For 'START', 'START REPEAT', 'STOP', 'ACK', and 'NACK' <data> is None.
-
'''
from .pd import *
diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py
index 2500ae4..6beb251 100644
--- a/decoders/i2c/pd.py
+++ b/decoders/i2c/pd.py
@@ -32,6 +32,29 @@
import sigrokdecode as srd
+'''
+Protocol output format:
+
+I2C packet:
+[<cmd>, <data>]
+
+<cmd> is one of:
+ - 'START' (START condition)
+ - 'START REPEAT' (Repeated START condition)
+ - 'ADDRESS READ' (Slave address, read)
+ - 'ADDRESS WRITE' (Slave address, write)
+ - 'DATA READ' (Data, read)
+ - 'DATA WRITE' (Data, write)
+ - 'STOP' (STOP condition)
+ - 'ACK' (ACK bit)
+ - 'NACK' (NACK bit)
+
+<data> is the data or address byte associated with the 'ADDRESS*' and 'DATA*'
+command. Slave addresses do not include bit 0 (the READ/WRITE indication bit).
+For example, a slave address field could be 0x51 (instead of 0xa2).
+For 'START', 'START REPEAT', 'STOP', 'ACK', and 'NACK' <data> is None.
+'''
+
# CMD: [annotation-type-index, long annotation, short annotation]
proto = {
'START': [0, 'Start', 'S'],