]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/gpib/pd.py
Add decoder: signature analysis
[libsigrokdecode.git] / decoders / gpib / pd.py
index 01801bc592161009898a64c28249d626012952df..f3497f4c21e06e9176c186602850c37476c54af3 100644 (file)
@@ -24,10 +24,11 @@ class Decoder(srd.Decoder):
     id = 'gpib'
     name = 'GPIB'
     longname = 'General Purpose Interface Bus'
-    desc = 'IEEE-488 GPIB / HPIB protocol.'
+    desc = 'IEEE-488 General Purpose Interface Bus (GPIB / HPIB).'
     license = 'gplv2+'
     inputs = ['logic']
-    outputs = ['gpib']
+    outputs = []
+    tags = ['PC']
     channels = (
         {'id': 'dio1' , 'name': 'DIO1', 'desc': 'Data I/O bit 1'},
         {'id': 'dio2' , 'name': 'DIO2', 'desc': 'Data I/O bit 2'},
@@ -46,9 +47,6 @@ class Decoder(srd.Decoder):
         {'id': 'atn', 'name': 'ATN', 'desc': 'Attention'},
         {'id': 'ren', 'name': 'REN', 'desc': 'Remote enable'},
     )
-    options = (
-        {'id': 'sample_total', 'desc': 'Total number of samples', 'default': 0},
-    )
     annotations = (
         ('items', 'Items'),
         ('gpib', 'DAT/CMD'),
@@ -61,6 +59,9 @@ class Decoder(srd.Decoder):
     )
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.items = []
         self.itemcount = 0
         self.saved_item = None
@@ -162,15 +163,9 @@ class Decoder(srd.Decoder):
 
         # Inspect samples at falling edge of DAV. But make sure to also
         # start inspection when the capture happens to start with low
-        # DAV level. Optionally enforce processing when a user specified
-        # sample number was reached.
+        # DAV level.
         waitcond = [{9: 'l'}]
-        lsn = self.options['sample_total']
-        if lsn:
-            waitcond.append({'skip': lsn})
         while True:
-            if lsn:
-                waitcond[1]['skip'] = lsn - self.samplenum - 1
             pins = self.wait(waitcond)
             self.handle_bits(pins)
             waitcond[0][9] = 'f'