]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2c/pd.py
Rename 'probe' to 'channel' everywhere.
[libsigrokdecode.git] / decoders / i2c / pd.py
index 2db7d21f6a74ca7bf3d35ed0e8d32995ce6a908d..6bf12b97e525721b149ca3d42a0478f06e3f0906 100644 (file)
@@ -72,27 +72,27 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['logic']
     outputs = ['i2c']
-    probes = [
+    channels = (
         {'id': 'scl', 'name': 'SCL', 'desc': 'Serial clock line'},
         {'id': 'sda', 'name': 'SDA', 'desc': 'Serial data line'},
-    ]
-    optional_probes = []
-    options = {
-        'address_format': ['Displayed slave address format', 'shifted'],
-    }
-    annotations = [
-        ['start', 'Start condition'],
-        ['repeat-start', 'Repeat start condition'],
-        ['stop', 'Stop condition'],
-        ['ack', 'ACK'],
-        ['nack', 'NACK'],
-        ['bit', 'Data/address bit'],
-        ['address-read', 'Address read'],
-        ['address-write', 'Address write'],
-        ['data-read', 'Data read'],
-        ['data-write', 'Data write'],
-        ['warnings', 'Human-readable warnings'],
-    ]
+    )
+    options = (
+        {'id': 'address_format', 'desc': 'Displayed slave address format',
+            'default': 'shifted', 'values': ('shifted', 'unshifted')},
+    )
+    annotations = (
+        ('start', 'Start condition'),
+        ('repeat-start', 'Repeat start condition'),
+        ('stop', 'Stop condition'),
+        ('ack', 'ACK'),
+        ('nack', 'NACK'),
+        ('bit', 'Data/address bit'),
+        ('address-read', 'Address read'),
+        ('address-write', 'Address write'),
+        ('data-read', 'Data read'),
+        ('data-write', 'Data write'),
+        ('warnings', 'Human-readable warnings'),
+    )
     annotation_rows = (
         ('bits', 'Bits', (5,)),
         ('addr-data', 'Address/Data', (0, 1, 2, 3, 4, 6, 7, 8, 9)),