]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2s/pd.py
Probes, optional probes and annotations now take a tuple.
[libsigrokdecode.git] / decoders / i2s / pd.py
index c934b5dbd9f0aa0ce228b3d1d6029650acbdd167..af2af4170f5bc2e72bde7378898c423cc17a5cbb 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-# I²S protocol decoder
-
 import sigrokdecode as srd
 
 '''
-Protocol output format:
+OUTPUT_PYTHON format:
 
 Packet:
 [<ptype>, <pdata>]
@@ -44,18 +42,16 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['logic']
     outputs = ['i2s']
-    probes = [
+    probes = (
         {'id': 'sck', 'name': 'SCK', 'desc': 'Bit clock line'},
         {'id': 'ws', 'name': 'WS', 'desc': 'Word select line'},
         {'id': 'sd', 'name': 'SD', 'desc': 'Serial data line'},
-    ]
-    optional_probes = []
-    options = {}
-    annotations = [
-        ['left', 'Left channel'],
-        ['right', 'Right channel'],
-        ['warnings', 'Warnings'],
-    ]
+    )
+    annotations = (
+        ('left', 'Left channel'),
+        ('right', 'Right channel'),
+        ('warnings', 'Warnings'),
+    )
     binary = (
         ('wav', 'WAV file'),
     )
@@ -73,7 +69,7 @@ class Decoder(srd.Decoder):
         self.wrote_wav_header = False
 
     def start(self):
-        self.out_proto = self.register(srd.OUTPUT_PYTHON)
+        self.out_python = self.register(srd.OUTPUT_PYTHON)
         self.out_bin = self.register(srd.OUTPUT_BINARY)
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
@@ -82,7 +78,7 @@ class Decoder(srd.Decoder):
             self.samplerate = value
 
     def putpb(self, data):
-        self.put(self.start_sample, self.samplenum, self.out_proto, data)
+        self.put(self.start_sample, self.samplenum, self.out_python, data)
 
     def putbin(self, data):
         self.put(self.start_sample, self.samplenum, self.out_bin, data)