From 84c1c0b52820af2418186ac3ecf93a5c6373a22e Mon Sep 17 00:00:00 2001 From: Bert Vermeulen <bert@biot.com> Date: Sun, 9 Mar 2014 23:48:27 +0100 Subject: 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. --- decoders/parallel/pd.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'decoders/parallel') diff --git a/decoders/parallel/pd.py b/decoders/parallel/pd.py index b2903d2..8f2176c 100644 --- a/decoders/parallel/pd.py +++ b/decoders/parallel/pd.py @@ -72,12 +72,14 @@ class Decoder(srd.Decoder): outputs = ['parallel'] probes = [] optional_probes = probe_list(8) - options = { - 'clock_edge': ['Clock edge to sample on', 'rising'], - 'wordsize': ['Word size of the data', 1], - 'endianness': ['Endianness of the data', 'little'], - 'format': ['Data format', 'hex'], - } + options = ( + {'id': 'clock_edge', 'desc': 'Clock edge to sample on', + 'default': 'rising', 'values': ('rising', 'falling')}, + {'id': 'wordsize', 'desc': 'Word size of the data', + 'default': 1}, + {'id': 'endianness', 'desc': 'Endianness of the data', + 'default': 'little', 'values': ('little', 'big')}, + ) annotations = [ ['items', 'Items'], ['words', 'Words'], -- cgit v1.2.3-70-g09d2