X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fdsi%2Fpd.py;h=b5faf6f699b0ed111e87547db9551b135a641398;hb=a32575cd7fc63447f4ba8bdb27e8e73ba5ae3cc0;hp=5b473be2b34bd374800b392f543374a15ebca657;hpb=1b9ef18be867133e721681cbc20272cf5c669504;p=libsigrokdecode.git diff --git a/decoders/dsi/pd.py b/decoders/dsi/pd.py index 5b473be..b5faf6f 100644 --- a/decoders/dsi/pd.py +++ b/decoders/dsi/pd.py @@ -27,10 +27,11 @@ class Decoder(srd.Decoder): id = 'dsi' name = 'DSI' longname = 'Digital Serial Interface' - desc = 'DSI lighting control protocol.' + desc = 'Digital Serial Interface (DSI) lighting protocol.' license = 'gplv2+' inputs = ['logic'] - outputs = ['dsi'] + outputs = [] + tags = ['Embedded/industrial', 'Lighting'] channels = ( {'id': 'dsi', 'name': 'DSI', 'desc': 'DSI data line'}, ) @@ -46,13 +47,15 @@ class Decoder(srd.Decoder): ) annotation_rows = ( ('bits', 'Bits', (0,)), - ('raw', 'Raw data', (3,)), + ('raw-vals', 'Raw data', (3,)), ('fields', 'Fields', (1, 2)), ) def __init__(self): + self.reset() + + def reset(self): self.samplerate = None - self.samplenum = None self.edges, self.bits, self.ss_es_bits = [], [], [] self.state = 'IDLE' @@ -108,6 +111,7 @@ class Decoder(srd.Decoder): raise SamplerateError('Cannot decode without samplerate.') bit = 0 while True: + # TODO: Come up with more appropriate self.wait() conditions. (self.dsi,) = self.wait() if self.options['polarity'] == 'active-high': self.dsi ^= 1 # Invert.