]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/i2c/pd.py
Rename inter-PD output type to SRD_OUTPUT_PYTHON
[libsigrokdecode.git] / decoders / i2c / pd.py
index 6beb251442ef0d7f6b22864bf4b10068175119b3..da8056702b0f0d5ef766e7e569629a818e6fe7b3 100644 (file)
 # I2C protocol decoder
 
 # TODO: Look into arbitration, collision detection, clock synchronisation, etc.
-# TODO: Handle clock stretching.
-# TODO: Handle combined messages / repeated START.
-# TODO: Implement support for 7bit and 10bit slave addresses.
+# TODO: Implement support for 10bit slave addresses.
 # TODO: Implement support for inverting SDA/SCL levels (0->1 and 1->0).
 # TODO: Implement support for detecting various bus errors.
-# TODO: I2C address of slaves.
-# TODO: Handle multiple different I2C devices on same bus
-#       -> we need to decode multiple protocols at the same time.
 
 import sigrokdecode as srd
 
@@ -83,7 +78,6 @@ class Decoder(srd.Decoder):
     ]
     optional_probes = []
     options = {
-        'addressing': ['Slave addressing (in bits)', 7], # 7 or 10
         'address_format': ['Displayed slave address format', 'shifted'],
     }
     annotations = [
@@ -111,8 +105,8 @@ class Decoder(srd.Decoder):
         self.oldsda = 1
         self.oldpins = [1, 1]
 
-    def start(self, metadata):
-        self.out_proto = self.add(srd.OUTPUT_PROTO, 'i2c')
+    def start(self):
+        self.out_proto = self.add(srd.OUTPUT_PYTHON, 'i2c')
         self.out_ann = self.add(srd.OUTPUT_ANN, 'i2c')
 
     def report(self):