X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fsignature%2Fpd.py;h=f5183c03130a4a8a57d50b0f1420c1ed4868c789;hb=540c0552f71dc2ce74a07aacf5f8f6b8fa568790;hp=a86878f21f3409aa49a15dbb4f3b3f4910d55b35;hpb=112a2644fdadf17e077a84f63dbbccc87e649a0f;p=libsigrokdecode.git diff --git a/decoders/signature/pd.py b/decoders/signature/pd.py index a86878f..f5183c0 100644 --- a/decoders/signature/pd.py +++ b/decoders/signature/pd.py @@ -51,20 +51,20 @@ class Decoder(srd.Decoder): outputs = [] tags = ['Debug/trace', 'Util', 'Encoding'] channels = ( - dict(id='start', name='START', desc='START channel'), - dict(id='stop', name='STOP', desc='STOP channel'), - dict(id='clk', name='CLOCK', desc='CLOCK channel'), - dict(id='data', name='DATA', desc='DATA channel') + {'id': 'start', 'name': 'START', 'desc': 'START channel'}, + {'id': 'stop', 'name': 'STOP', 'desc': 'STOP channel'}, + {'id': 'clk', 'name': 'CLOCK', 'desc': 'CLOCK channel'}, + {'id': 'data', 'name': 'DATA', 'desc': 'DATA channel'}, ) options = ( - dict(id='start_edge', desc='Edge-selection for START channel', - default='r', values=('r', 'f')), - dict(id='stop_edge', desc='Edge-selection for STOP channel', - default='r', values=('r', 'f')), - dict(id='clk_edge', desc='Edge-selection for CLOCK channel', - default='f', values=('r', 'f')), - dict(id='annbits', desc='Enable bit level annotation', - default='no', values=('yes', 'no')) + {'id': 'start_edge', 'desc': 'START edge polarity', + 'default': 'rising', 'values': ('rising', 'falling')}, + {'id': 'stop_edge', 'desc': 'STOP edge polarity', + 'default': 'rising', 'values': ('rising', 'falling')}, + {'id': 'clk_edge', 'desc': 'CLOCK edge polarity', + 'default': 'falling', 'values': ('rising', 'falling')}, + {'id': 'annbits', 'desc': 'Enable bit level annotations', + 'default': 'no', 'values': ('yes', 'no')}, ) annotations = ( ('bit0', 'Bit0'), @@ -79,6 +79,9 @@ class Decoder(srd.Decoder): ) def __init__(self): + self.reset() + + def reset(self): pass def start(self): @@ -96,8 +99,8 @@ class Decoder(srd.Decoder): def decode(self): opt = self.options - start_edge_mode_rising = opt['start_edge'] == 'r' - stop_edge_mode_rising = opt['stop_edge'] == 'r' + start_edge_mode_rising = opt['start_edge'] == 'rising' + stop_edge_mode_rising = opt['stop_edge'] == 'rising' annbits = opt['annbits'] == 'yes' gate_is_open = False sample_start = None