]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/mx25lxx05d/mx25lxx05d.py
srd: spi: Document output protocol, send CS# changes.
[libsigrokdecode.git] / decoders / mx25lxx05d / mx25lxx05d.py
index 4139fcb6e57d7ba6ecb885c76d3198f86f5eeff8..eb0e798403ba64ccaf1d62ef1b6971124526a964 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-#
-# Macronix MX25Lxx05D SPI (NOR) flash chip decoder.
-# Works for MX25L1605D/MX25L3205D/MX25L6405D.
-#
+# Macronix MX25Lxx05D SPI (NOR) flash chip protocol decoder
 
-#
-# TODO: Description
-#
-# Details:
-# http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/3F21BAC2E121E17848257639003A3146/$File/MX25L1605D-3205D-6405D-1.5.pdf
-#
+# Note: Works for MX25L1605D/MX25L3205D/MX25L6405D.
 
 import sigrokdecode as srd
 
@@ -106,19 +98,18 @@ class Decoder(srd.Decoder):
     id = 'mx25lxx05d'
     name = 'MX25Lxx05D'
     longname = 'Macronix MX25Lxx05D'
-    desc = 'Macronix MX25Lxx05D SPI flash chip decoder'
-    longdesc = 'TODO'
+    desc = 'SPI (NOR) flash chip protocol.'
     license = 'gplv2+'
     inputs = ['spi', 'logic']
     outputs = ['mx25lxx05d']
     probes = []
-    extra_probes = [
+    optional_probes = [
         {'id': 'hold', 'name': 'HOLD#', 'desc': 'TODO.'},
         {'id': 'wp_acc', 'name': 'WP#/ACC', 'desc': 'TODO.'},
     ]
     options = {} # TODO
     annotations = [
-        ['TODO', 'TODO'],
+        ['Text', 'Human-readable text'],
     ]
 
     def __init__(self, **kwargs):
@@ -133,7 +124,7 @@ class Decoder(srd.Decoder):
         pass
 
     def putx(self, data):
-        # Simplification, most annotations span extactly one SPI byte/packet.
+        # Simplification, most annotations span exactly one SPI byte/packet.
         self.put(self.ss, self.es, self.out_ann, data)
 
     def handle_wren(self, mosi, miso):
@@ -218,7 +209,7 @@ class Decoder(srd.Decoder):
             self.putx([0, ['%s ID' % d]])
         elif self.cmdstate == 6:
             # Byte 6: Slave sends device ID (or manufacturer ID).
-            self.ids += [miso]
+            self.ids.append(miso)
             d = 'Manufacturer' if self.manufacturer_id_first else 'Device'
             self.putx([0, ['%s ID' % d]])
         else:
@@ -241,7 +232,7 @@ class Decoder(srd.Decoder):
 
         ptype, mosi, miso = data
 
-        if ptype != 'data':
+        if ptype != 'DATA':
             return
 
         cmd = mosi