]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/parallel/pd.py
Probes, optional probes and annotations now take a tuple.
[libsigrokdecode.git] / decoders / parallel / pd.py
index b2903d20e4b41425a4edc2163d990f095d1ee0e8..cae269f8d524c5bf403164f8ac0e048ee28edf34 100644 (file)
@@ -59,7 +59,7 @@ def probe_list(num_probes):
     for i in range(num_probes):
         d = {'id': 'd%d' % i, 'name': 'D%d' % i, 'desc': 'Data line %d' % i}
         l.append(d)
-    return l
+    return tuple(l)
 
 class Decoder(srd.Decoder):
     api_version = 1
@@ -70,18 +70,19 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['logic']
     outputs = ['parallel']
-    probes = []
     optional_probes = probe_list(8)
-    options = {
-        'clock_edge': ['Clock edge to sample on', 'rising'],
-        'wordsize': ['Word size of the data', 1],
-        'endianness': ['Endianness of the data', 'little'],
-        'format': ['Data format', 'hex'],
-    }
-    annotations = [
-        ['items', 'Items'],
-        ['words', 'Words'],
-    ]
+    options = (
+        {'id': 'clock_edge', 'desc': 'Clock edge to sample on',
+            'default': 'rising', 'values': ('rising', 'falling')},
+        {'id': 'wordsize', 'desc': 'Word size of the data',
+            'default': 1},
+        {'id': 'endianness', 'desc': 'Endianness of the data',
+            'default': 'little', 'values': ('little', 'big')},
+    )
+    annotations = (
+        ('items', 'Items'),
+        ('words', 'Words'),
+    )
 
     def __init__(self):
         self.oldclk = None