]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/mlx90614/pd.py
mlx90614: Add annotation rows.
[libsigrokdecode.git] / decoders / mlx90614 / pd.py
index c2b37c7bcf9c33a4688c3bac2d85ad13d3a0168a..908f40a62eb70bb392f23e664ce9581c351de88e 100644 (file)
 import sigrokdecode as srd
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'mlx90614'
     name = 'MLX90614'
     longname = 'Melexis MLX90614'
-    desc = 'Infrared Thermometer protocol.'
+    desc = 'Melexis MLX90614 infrared thermometer protocol.'
     license = 'gplv2+'
     inputs = ['i2c']
-    outputs = ['mlx90614']
+    outputs = []
+    tags = ['IC', 'Sensor']
     annotations = (
-        ('celsius', 'Temperature in degrees Celsius'),
-        ('kelvin', 'Temperature in Kelvin'),
+        ('celsius', 'Temperature / °C'),
+        ('kelvin', 'Temperature / K'),
+    )
+    annotation_rows = (
+        ('temps-celsius', 'Temperature / °C', (0,)),
+        ('temps-kelvin', 'Temperature / K', (1,)),
     )
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.state = 'IGNORE START REPEAT'
         self.data = []