srd: Update decoders to changed API.
[libsigrokdecode.git] / decoders / spi.py
index d9891b38cd36bb4bc8921e8504e20fb13158f7d9..a363b5afba3c0f53838229435876d83c0450d2e2 100644 (file)
@@ -31,11 +31,11 @@ def sampleiter(data, unitsize):
     for i in range(0, len(data), unitsize):
         yield(Sample(data[i:i+unitsize]))
 
-class Decoder():
+class Decoder(sigrok.Decoder):
     id = 'spi'
-    name = 'SPI Decoder'
+    name = 'SPI'
     desc = '...desc...'
-    longname = '...longname...'
+    longname = 'Serial Peripheral Interface (SPI) bus'
     longdesc = '...longdesc...'
     author = 'Gareth McMullin'
     email = 'gareth@blacksphere.co.nz'
@@ -89,12 +89,10 @@ class Decoder():
                 'display':('%02X' % self.rxdata),
                 'type':'spi',
             }
-            sigrok.put(outdata)
+            self.put(outdata)
             # Reset decoder state
             self.rxdata = 0
             self.rxcount = 0
             # Keep stats for summary
             self.bytesreceived += 1
 
-sigrok.register(Decoder)
-