]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/ad79x0/pd.py
avr_isp: Extend decoder, add locks, eeprom, program memory commands.
[libsigrokdecode.git] / decoders / ad79x0 / pd.py
index 9f3a1677aaa015d1642bfe8b42dc7de0ea611ddb..3d7ab7315b5479ed06d87288b383a4630a5e50ed 100644 (file)
@@ -25,7 +25,7 @@ modes = {
     2: ['Power Up Mode', 'Power Up', 'PU'],
 }
 
-input_voltage_format = ['%fV', '%fV', '%.6fV', '%.2fV']
+input_voltage_format = ['%.6fV', '%.2fV']
 
 validation = {
     'invalid': ['Invalid data', 'Invalid', 'N/A'],
@@ -42,19 +42,19 @@ class Decoder(srd.Decoder):
     license = 'gplv2+'
     inputs = ['spi']
     outputs = []
-    tags = ['Display']
+    tags = ['IC', 'Analog/digital']
     annotations = (
         ('mode', 'Mode'),
-        ('data', 'Data'),
+        ('voltage', 'Voltage'),
         ('validation', 'Validation'),
     )
     annotation_rows = (
-        ('mode', 'Mode', (0,)),
-        ('data', 'Converted data', (1,)),
+        ('modes', 'Modes', (0,)),
+        ('voltages', 'Voltages', (1,)),
         ('data_validation', 'Data validation', (2,)),
     )
     options = (
-        {'id': 'ref', 'desc': 'Reference voltage', 'default': 1.5},
+        {'id': 'vref', 'desc': 'Reference voltage (V)', 'default': 1.5},
     )
 
     def __init__(self,):
@@ -108,7 +108,7 @@ class Decoder(srd.Decoder):
                             self.put_validation([self.start_sample, es], 'complete')
                         elif nb_bits < 16:
                             self.put_validation([self.start_sample, es], 'incomplete')
-                        vin = (self.data / ((2**12) - 1)) * self.options['ref']
+                        vin = (self.data / ((2**12) - 1)) * self.options['vref']
                         self.put_data([self.start_sample, es], vin)
                 elif nb_bits < 10:
                     self.put_mode([self.start_sample, es], 1)