X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fmxc6225xu%2Fpd.py;h=c236070167a1e69b91f0d3c100062913e10adb39;hp=c139918d0654ab6d226ef783328853d648b15f47;hb=780770f1295b7fdeb4481eb42623bad5da1e19a7;hpb=0eeeb544e1ea3cef9669f98e7c0b19b8f73a9236 diff --git a/decoders/mxc6225xu/pd.py b/decoders/mxc6225xu/pd.py index c139918..c236070 100644 --- a/decoders/mxc6225xu/pd.py +++ b/decoders/mxc6225xu/pd.py @@ -1,5 +1,5 @@ ## -## This file is part of the sigrok project. +## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann ## @@ -18,8 +18,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# MEMSIC MXC6225XU protocol decoder - import sigrokdecode as srd # Definitions of various bits in MXC6225XU registers. @@ -70,24 +68,19 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['i2c'] outputs = ['mxc6225xu'] - probes = [] optional_probes = [ {'id': 'int', 'name': 'INT', 'desc': 'DTOS interrupt output pin'}, ] - options = {} annotations = [ - ['Text', 'Human-readable text'], + ['text', 'Human-readable text'], ] def __init__(self, **kwargs): self.state = 'IDLE' - def start(self, metadata): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'mxc6225xu') - self.out_ann = self.add(srd.OUTPUT_ANN, 'mxc6225xu') - - def report(self): - pass + def start(self): + # self.out_python = self.register(srd.OUTPUT_PYTHON) + self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data): self.put(self.ss, self.es, self.out_ann, data) @@ -167,12 +160,12 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): cmd, databyte = data - # Store the start/end samples of this I2C packet. + # Store the start/end samples of this I²C packet. self.ss, self.es = ss, es # State machine. if self.state == 'IDLE': - # Wait for an I2C START condition. + # Wait for an I²C START condition. if cmd != 'START': return self.state = 'GET SLAVE ADDR'