]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/transitioncounter.py
srd: SPI: Support sampling on rising/falling CLK edge.
[libsigrokdecode.git] / decoders / transitioncounter.py
index eaf87389e16908c3c621b8a2a2c36372e34b83d1..ded3a3d1c8361acb6f9b9e3a8066e8e0920e150c 100644 (file)
@@ -31,24 +31,24 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['logic']
     outputs = ['transitioncounts']
-    probes = [
-    ] # TODO?
+    probes = []
     options = {}
+    annotations = [
+        ['TODO', 'TODO'],
+    ]
 
     def __init__(self, **kwargs):
-        self.out_proto = None
-        self.out_ann = None
         self.channels = -1
         self.lastsample = None
 
     def start(self, metadata):
-        # self.out_proto = self.add(srd.SRD_OUTPUT_PROTO, 'transitioncounter')
-        self.out_ann = self.add(srd.SRD_OUTPUT_ANN, 'transitioncounter')
+        # self.out_proto = self.add(srd.OUTPUT_PROTO, 'transitioncounter')
+        self.out_ann = self.add(srd.OUTPUT_ANN, 'transitioncounter')
 
     def report(self):
         pass
 
-    def decode(self, timeoffset, duration, data):
+    def decode(self, ss, es, data):
 
         for (samplenum, s) in data:
 
@@ -98,5 +98,5 @@ class Decoder(srd.Decoder):
 
         if outdata != []:
             # self.put(0, 0, self.out_proto, out_proto)
-            self.put(0, 0, self.out_ann, outdata)
+            self.put(0, 0, self.out_ann, [0, [str(outdata)]])