## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
-import sigrokdecode
+import sigrokdecode as srd
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
id = 'transitioncounter'
name = 'Transition counter'
longname = '...'
license = 'gplv2+'
inputs = ['logic']
outputs = ['transitioncounts']
- probes = [
- ] # TODO?
+ probes = []
options = {}
+ annotations = [
+ ['TODO', 'TODO'],
+ ]
def __init__(self, **kwargs):
- self.output_protocol = None
- self.output_annotation = None
self.channels = -1
self.lastsample = None
def start(self, metadata):
- # self.output_protocol = self.add(2)
- self.output_annotation = self.add(1)
+ # 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:
outdata += [[self.transitions[i], self.rising[i], self.falling[i]]]
if outdata != []:
- # self.put(0, 0, self.output_protocol, out_proto)
- self.put(0, 0, self.output_annotation, outdata)
+ # self.put(0, 0, self.out_proto, out_proto)
+ self.put(0, 0, self.out_ann, [0, [str(outdata)]])