X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fmx25lxx05d%2Fpd.py;h=a6c72d8854e54fbd7034147fe41c045502f62742;hp=754729d4f19d1dc8e2440ad8693dc662afd5a163;hb=12851357e784b893e24880efc6cd22a0cbcc64ce;hpb=9389f2c1b9b74e00d1369e846d4417bf644275d0 diff --git a/decoders/mx25lxx05d/pd.py b/decoders/mx25lxx05d/pd.py index 754729d..a6c72d8 100644 --- a/decoders/mx25lxx05d/pd.py +++ b/decoders/mx25lxx05d/pd.py @@ -55,7 +55,7 @@ device_name = { } def cmd_annotation_classes(): - return [[cmd[0].lower(), cmd[1]] for cmd in cmds.values()] + return tuple([tuple([cmd[0].lower(), cmd[1]]) for cmd in cmds.values()]) def decode_status_reg(data): # TODO: Additional per-bit(s) self.put() calls with correct start/end. @@ -83,25 +83,24 @@ def decode_status_reg(data): return ret class Decoder(srd.Decoder): - api_version = 1 + api_version = 2 id = 'mx25lxx05d' name = 'MX25Lxx05D' longname = 'Macronix MX25Lxx05D' desc = 'SPI (NOR) flash chip protocol.' license = 'gplv2+' - inputs = ['spi', 'logic'] + inputs = ['logic'] outputs = ['mx25lxx05d'] - probes = [] - optional_probes = [ - {'id': 'hold', 'name': 'HOLD#', 'desc': 'Pause device w/o deselecting it'}, - {'id': 'wp_acc', 'name': 'WP#/ACC', 'desc': 'Write protect'}, - ] - options = {} - annotations = cmd_annotation_classes() + [ - ['bits', 'Bits'], - ['bits2', 'Bits2'], - ['warnings', 'Warnings'], - ] + annotations = cmd_annotation_classes() + ( + ('bits', 'Bits'), + ('bits2', 'Bits2'), + ('warnings', 'Warnings'), + ) + annotation_rows = ( + ('bits', 'Bits', (24, 25)), + ('commands', 'Commands', tuple(range(23 + 1))), + ('warnings', 'Warnings', (26,)), + ) def __init__(self, **kwargs): self.state = None @@ -110,7 +109,6 @@ class Decoder(srd.Decoder): self.data = [] def start(self): - # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data):