X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Flm75%2Fpd.py;h=1fe03a6609d9ac14be113a7dafffc05a3721c6a5;hb=00962e763e610d8535dd9df1ac97377b3fb727a7;hp=473d7f8f1e15b897edee3beebe6153b37e8d0fc1;hpb=1db7e477b3a63a837e478dc12f7a8026dcca4ef1;p=libsigrokdecode.git diff --git a/decoders/lm75/pd.py b/decoders/lm75/pd.py index 473d7f8..1fe03a6 100644 --- a/decoders/lm75/pd.py +++ b/decoders/lm75/pd.py @@ -18,8 +18,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# National LM75 (and compatibles) temperature sensor protocol decoder - # TODO: Better support for various LM75 compatible devices. import sigrokdecode as srd @@ -50,24 +48,24 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['i2c'] outputs = ['lm75'] - probes = [] - optional_probes = [ + optional_probes = ( {'id': 'os', 'name': 'OS', 'desc': 'Overtemperature shutdown'}, {'id': 'a0', 'name': 'A0', 'desc': 'I²C slave address input 0'}, {'id': 'a1', 'name': 'A1', 'desc': 'I²C slave address input 1'}, {'id': 'a2', 'name': 'A2', 'desc': 'I²C slave address input 2'}, - ] - options = { - 'sensor': ['Sensor type', 'lm75'], - 'resolution': ['Resolution', 9], # 9-12 bit, sensor/config dependent - } - annotations = [ - ['Celsius', 'Temperature in degrees Celsius'], - ['Kelvin', 'Temperature in Kelvin'], - ['Text (verbose)', 'Human-readable text (verbose)'], - ['Text', 'Human-readable text'], - ['Warnings', 'Human-readable warnings'], - ] + ) + options = ( + {'id': 'sensor', 'desc': 'Sensor type', 'default': 'lm75'}, + {'id': 'resolution', 'desc': 'Resolution', 'default': 9, + 'values': (9, 10, 11, 12)}, + ) + annotations = ( + ('celsius', 'Temperature in degrees Celsius'), + ('kelvin', 'Temperature in Kelvin'), + ('text-verbose', 'Human-readable text (verbose)'), + ('text', 'Human-readable text'), + ('warnings', 'Human-readable warnings'), + ) def __init__(self, **kwargs): self.state = 'IDLE' @@ -75,7 +73,7 @@ class Decoder(srd.Decoder): self.databytes = [] def start(self): - # self.out_proto = self.register(srd.OUTPUT_PYTHON) + # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data):