]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/cec/pd.py
avr_isp: Add more parts
[libsigrokdecode.git] / decoders / cec / pd.py
index 6e8ddecf44d83981a0a8395d712d0c91d7dadd4a..84166eb0e94e002fd7e354e0cf4197a0e2f87a36 100644 (file)
@@ -55,7 +55,8 @@ class Decoder(srd.Decoder):
     desc = 'HDMI Consumer Electronics Control (CEC) protocol.'
     license = 'gplv2+'
     inputs = ['logic']
-    outputs = ['cec']
+    outputs = []
+    tags = ['Display', 'PC']
     channels = (
         {'id': 'cec', 'name': 'CEC', 'desc': 'CEC bus data'},
     )
@@ -65,11 +66,11 @@ class Decoder(srd.Decoder):
         ('eom-1', 'Message continued'),
         ('nack', 'ACK not set'),
         ('ack', 'ACK set'),
-        ('bits', 'Bits'),
-        ('bytes', 'Bytes'),
-        ('frames', 'Frames'),
-        ('sections', 'Sections'),
-        ('warnings', 'Warnings')
+        ('bit', 'Bit'),
+        ('byte', 'Byte'),
+        ('frame', 'Frame'),
+        ('section', 'Section'),
+        ('warning', 'Warning')
     )
     annotation_rows = (
         ('bits', 'Bits', (0, 1, 2, 3, 4, 5)),
@@ -116,41 +117,41 @@ class Decoder(srd.Decoder):
             return
 
         i = 0
-        str = ''
+        string = ''
         while i < len(self.cmd_bytes):
-            str += '{:02x}'.format(self.cmd_bytes[i]['val'])
+            string += '{:02x}'.format(self.cmd_bytes[i]['val'])
             if i != (len(self.cmd_bytes) - 1):
-                str += ':'
+                string += ':'
             i += 1
 
-        self.put(self.frame_start, self.frame_end, self.out_ann, [7, [str]])
+        self.put(self.frame_start, self.frame_end, self.out_ann, [7, [string]])
 
         i = 0
         operands = 0
-        str = ''
+        string = ''
         while i < len(self.cmd_bytes):
             if i == 0: # Parse header
                 (src, dst) = decode_header(self.cmd_bytes[i]['val'])
-                str = 'HDR: ' + src + ', ' + dst
+                string = 'HDR: ' + src + ', ' + dst
             elif i == 1: # Parse opcode
-                str += ' | OPC: ' + opcodes.get(self.cmd_bytes[i]['val'], 'Invalid')
+                string += ' | OPC: ' + opcodes.get(self.cmd_bytes[i]['val'], 'Invalid')
             else: # Parse operands
                 if operands == 0:
-                    str += ' | OPS: '
+                    string += ' | OPS: '
                 operands += 1
-                str += '0x{:02x}'.format(self.cmd_bytes[i]['val'])
+                string += '0x{:02x}'.format(self.cmd_bytes[i]['val'])
                 if i != len(self.cmd_bytes) - 1:
-                    str += ', '
+                    string += ', '
             i += 1
 
         # Header only commands are PINGS
         if i == 1:
-            str += ' | OPC: PING' if self.eom else ' | OPC: NONE. Aborted cmd'
+            string += ' | OPC: PING' if self.eom else ' | OPC: NONE. Aborted cmd'
 
         # Add extra information (ack of the command from the destination)
-        str += ' | R: NACK' if is_nack else ' | R: ACK'
+        string += ' | R: NACK' if is_nack else ' | R: ACK'
 
-        self.put(self.frame_start, self.frame_end, self.out_ann, [8, [str]])
+        self.put(self.frame_start, self.frame_end, self.out_ann, [8, [string]])
 
     def process(self):
         zero_time = ((self.rise - self.fall_start) / self.samplerate) * 1000.0