]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/spi/pd.py
spi: Drop temporary hack for combined MISO/MOSI out.
[libsigrokdecode.git] / decoders / spi / pd.py
index e00235e2a8bff976654d13484c8a569665ec44db..303387e632c3076fef5598ec70c67ab107b60193 100644 (file)
@@ -19,8 +19,6 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-# SPI protocol decoder
-
 import sigrokdecode as srd
 
 '''
@@ -81,10 +79,9 @@ class Decoder(srd.Decoder):
         'format': ['Data format', 'hex'],
     }
     annotations = [
-        ['MISO/MOSI data', 'MISO/MOSI SPI data'],
-        ['MISO data', 'MISO SPI data'],
-        ['MOSI data', 'MOSI SPI data'],
-        ['Warnings', 'Human-readable warnings'],
+        ['miso-data', 'MISO SPI data'],
+        ['mosi-data', 'MOSI SPI data'],
+        ['warnings', 'Human-readable warnings'],
     ]
 
     def __init__(self):
@@ -150,9 +147,8 @@ class Decoder(srd.Decoder):
         self.putpw(['DATA', self.mosidata, self.misodata])
 
         # Annotations
-        self.putw([0, ['%02X/%02X' % (self.mosidata, self.misodata)]])
-        self.putw([1, ['%02X' % self.misodata]])
-        self.putw([2, ['%02X' % self.mosidata]])
+        self.putw([0, ['%02X' % self.misodata]])
+        self.putw([1, ['%02X' % self.mosidata]])
 
         # Meta bitrate
         elapsed = 1 / float(self.samplerate) * (self.samplenum - self.startsample + 1)
@@ -160,7 +156,7 @@ class Decoder(srd.Decoder):
         self.put(self.startsample, self.samplenum, self.out_bitrate, bitrate)
 
         if self.cs_was_deasserted_during_data_word:
-            self.putw([3, ['CS# was deasserted during this data word!']])
+            self.putw([2, ['CS# was deasserted during this data word!']])
 
         # Reset decoder state.
         self.mosidata = self.misodata = self.bitcount = 0