]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/ddc.py
srd: Drop duplicate SRD_ prefix from ANN/PROTO.
[libsigrokdecode.git] / decoders / ddc.py
index 09f684487e2b8a9fe1ece7810c687e9989bf9c08..36d5c4aee2fcc7b9b3e44fce470747d99a9047cd 100644 (file)
 # and a display device. The stream is output as plain bytes.
 #
 
-import sigrokdecode
+import sigrokdecode as srd
 
 
-class Decoder(sigrokdecode.Decoder):
+class Decoder(srd.Decoder):
     id = 'ddc'
     name = 'DDC'
     longname = 'Display Data Channel'
@@ -37,7 +37,7 @@ class Decoder(sigrokdecode.Decoder):
     license = 'gplv3+'
     inputs = ['i2c']
     outputs = ['ddc']
-    annotation = [
+    annotations = [
         ["Byte stream", "DDC byte stream as read from display."],
     ]
 
@@ -45,7 +45,7 @@ class Decoder(sigrokdecode.Decoder):
         self.state = None
 
     def start(self, metadata):
-        self.output_annotation = self.add(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'ddc')
+        self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc')
 
     def decode(self, start_sample, end_sample, i2c_data):
         try:
@@ -69,6 +69,6 @@ class Decoder(sigrokdecode.Decoder):
             if cmd == 'DATA_READ':
                 # there shouldn't be anything but data reads on this
                 # address, so ignore everything else
-                self.put(start_sample, end_sample, self.output_annotation,
+                self.put(start_sample, end_sample, self.out_ann,
                          [0, ["0x%.2x" % data]])