summaryrefslogtreecommitdiff
path: root/decoders/onewire_link
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-03-09 23:48:27 +0100
committerBert Vermeulen <bert@biot.com>2014-03-10 00:47:30 +0100
commit84c1c0b52820af2418186ac3ecf93a5c6373a22e (patch)
treeae26f32b7c77646179369fcbe089b91e2c236665 /decoders/onewire_link
parentcfe46204d1c91f02d0e2c6679a2d15ff92bb90c8 (diff)
downloadlibsigrokdecode-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/onewire_link')
-rw-r--r--decoders/onewire_link/pd.py41
1 files changed, 29 insertions, 12 deletions
diff --git a/decoders/onewire_link/pd.py b/decoders/onewire_link/pd.py
index 5b5ebd0..38ef8cc 100644
--- a/decoders/onewire_link/pd.py
+++ b/decoders/onewire_link/pd.py
@@ -35,19 +35,36 @@ class Decoder(srd.Decoder):
optional_probes = [
{'id': 'pwr', 'name': 'PWR', 'desc': '1-Wire power supply pin'},
]
- options = {
- 'overdrive': ['Overdrive mode', 'no'],
+ options = (
+ {'id': 'overdrive',
+ 'desc': 'Overdrive mode',
+ 'default': 'no'},
# Time options (specified in microseconds):
- 'cnt_normal_bit': ['Normal mode sample bit time (µs)', 15],
- 'cnt_normal_slot': ['Normal mode data slot time (µs)', 60],
- 'cnt_normal_presence': ['Normal mode sample presence time (µs)', 75],
- 'cnt_normal_reset': ['Normal mode reset time (µs)', 480],
- 'cnt_overdrive_bit': ['Overdrive mode sample bit time (µs)', 2],
- # 'cnt_overdrive_slot': ['Overdrive mode data slot time (µs)', 7.3],
- 'cnt_overdrive_slot': ['Overdrive mode data slot time (µs)', 7],
- 'cnt_overdrive_presence': ['Overdrive mode sample presence time (µs)', 10],
- 'cnt_overdrive_reset': ['Overdrive mode reset time (µs)', 48],
- }
+ {'id': 'cnt_normal_bit',
+ 'desc': 'Normal mode sample bit time (μs)',
+ 'default': 15},
+ {'id': 'cnt_normal_slot',
+ 'desc': 'Normal mode data slot time (μs)',
+ 'default': 60},
+ {'id': 'cnt_normal_presence',
+ 'desc': 'Normal mode sample presence time (μs)',
+ 'default': 75},
+ {'id': 'cnt_normal_reset',
+ 'desc': 'Normal mode reset time (μs)',
+ 'default': 480},
+ {'id': 'cnt_overdrive_bit',
+ 'desc': 'Overdrive mode sample bit time (μs)',
+ 'default': 2},
+ {'id': 'cnt_overdrive_slot',
+ 'desc': 'Overdrive mode data slot time (μs)',
+ 'default': 7.3},
+ {'id': 'cnt_overdrive_presence',
+ 'desc': 'Overdrive mode sample presence time (μs)',
+ 'default': 10},
+ {'id': 'cnt_overdrive_reset',
+ 'desc': 'Overdrive mode reset time (μs)',
+ 'default': 48},
+ )
annotations = [
['bit', 'Bit'],
['warnings', 'Warnings'],