diff options
author | Bert Vermeulen <bert@biot.com> | 2014-03-09 23:48:27 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2014-03-10 00:47:30 +0100 |
commit | 84c1c0b52820af2418186ac3ecf93a5c6373a22e (patch) | |
tree | ae26f32b7c77646179369fcbe089b91e2c236665 /decoders/lm75/pd.py | |
parent | cfe46204d1c91f02d0e2c6679a2d15ff92bb90c8 (diff) | |
download | libsigrokdecode-84c1c0b52820af2418186ac3ecf93a5c6373a22e.tar.gz libsigrokdecode-84c1c0b52820af2418186ac3ecf93a5c6373a22e.zip |
Change PD options to be a tuple of dictionaries.
Each option consists of a dictionary with the following keys:
id The option id, which is passed in when setting a value.
desc A description of the option, suitable for display.
def The default value for this option.
values (optional) If present, a tuple containing values the option
may take. They must be of the same type as the default.
Valid types for the options are UTF-8-encoded strings, integers, and
floating point values.
Diffstat (limited to 'decoders/lm75/pd.py')
-rw-r--r-- | decoders/lm75/pd.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/decoders/lm75/pd.py b/decoders/lm75/pd.py index 58c2c89..84cc26a 100644 --- a/decoders/lm75/pd.py +++ b/decoders/lm75/pd.py @@ -55,10 +55,11 @@ class Decoder(srd.Decoder): {'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 - } + 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'], |