X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fmx25lxx05d.py;h=8055c638668413f29c73d3aced9b563f16af8284;hp=0f2f73b8cbcbe43eeab62ef986a60874bef4953b;hb=2b9837d9fc5f9b4eca52327527e18db4bfb730ff;hpb=958f394e13a2f34f3451e10ec0a85743d6cde70a diff --git a/decoders/mx25lxx05d.py b/decoders/mx25lxx05d.py index 0f2f73b..8055c63 100644 --- a/decoders/mx25lxx05d.py +++ b/decoders/mx25lxx05d.py @@ -30,7 +30,7 @@ # http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf # -import sigrokdecode +import sigrokdecode as srd # States IDLE = -1 @@ -157,9 +157,9 @@ miso_packets = [ {'type': 'D', 'range': (10, 11), 'data': 0xff, 'ann': ''}, ] -class Decoder(sigrokdecode.Decoder): +class Decoder(srd.Decoder): id = 'mx25lxx05d' - name = 'Macronix MX25Lxx05D' + name = 'MX25Lxx05D' longname = 'Macronix MX25Lxx05D SPI flash chip decoder' desc = 'Macronix MX25Lxx05D SPI flash chip decoder' longdesc = 'TODO' @@ -170,17 +170,16 @@ class Decoder(sigrokdecode.Decoder): outputs = ['mx25lxx05d'] probes = [] # TODO: HOLD#, WP#/ACC options = {} # TODO + annotations = [] def __init__(self, **kwargs): - self.output_protocol = None - self.output_annotation = None self.state = IDLE self.cmdstate = 1 # TODO self.out = [] def start(self, metadata): - # self.output_protocol = self.output_new(2) - self.output_annotation = self.output_new(1) + # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mx25lxx05d') + self.out_ann = self.add(srd.OUTPUT_ANN, 'mx25lxx05d') def report(self): pass @@ -311,7 +310,7 @@ class Decoder(sigrokdecode.Decoder): self.out += o - def decode(self, timeoffset, duration, data): + def decode(self, ss, es, data): self.out = [] # Iterate over all SPI MISO/MOSI packets. TODO: HOLD#, WP#/ACC? @@ -351,6 +350,6 @@ class Decoder(sigrokdecode.Decoder): pass if self.out != []: - # self.put(0, 0, self.output_protocol, out_proto) - self.put(0, 0, self.output_annotation, self.out) + # self.put(0, 0, self.out_proto, out_proto) + self.put(0, 0, self.out_ann, self.out)