]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/mxc6225xu/pd.py
rfm12: Cosmetics.
[libsigrokdecode.git] / decoders / mxc6225xu / pd.py
index 4a7e666f38ad673bd04c24957f022be43f2168c7..2f09488d2e2d5746e69139b1f84505e61f721291 100644 (file)
@@ -18,8 +18,6 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-# MEMSIC MXC6225XU protocol decoder
-
 import sigrokdecode as srd
 
 # Definitions of various bits in MXC6225XU registers.
@@ -62,7 +60,7 @@ status = {
 }
 
 class Decoder(srd.Decoder):
-    api_version = 1
+    api_version = 2
     id = 'mxc6225xu'
     name = 'MXC6225XU'
     longname = 'MEMSIC MXC6225XU'
@@ -70,20 +68,14 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['i2c']
     outputs = ['mxc6225xu']
-    probes = []
-    optional_probes = [
-        {'id': 'int', 'name': 'INT', 'desc': 'DTOS interrupt output pin'},
-    ]
-    options = {}
-    annotations = [
-        ['Text', 'Human-readable text'],
-    ]
+    annotations = (
+        ('text', 'Human-readable text'),
+    )
 
     def __init__(self, **kwargs):
         self.state = 'IDLE'
 
     def start(self):
-        # self.out_proto = self.register(srd.OUTPUT_PYTHON)
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
     def putx(self, data):
@@ -221,6 +213,3 @@ class Decoder(srd.Decoder):
                 self.state = 'IDLE'
             else:
                 pass # TODO?
-        else:
-            raise Exception('Invalid state: %s' % self.state)
-