X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Frtc8564%2Fpd.py;h=728cae6500c98f45e2e51be98863f40a679b8a63;hp=a2d8a1a2e601b29baf2c7c0581295f4a3117f5a5;hb=847e488b37fe5c85c4d1aa4930ced34c24ca5b03;hpb=0eeeb544e1ea3cef9669f98e7c0b19b8f73a9236 diff --git a/decoders/rtc8564/pd.py b/decoders/rtc8564/pd.py index a2d8a1a..728cae6 100644 --- a/decoders/rtc8564/pd.py +++ b/decoders/rtc8564/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 ## -# Epson RTC-8564 JE/NB protocol decoder - import sigrokdecode as srd # Return the specified BCD number (max. 8 bits) as integer. @@ -37,13 +35,13 @@ class Decoder(srd.Decoder): outputs = ['rtc8564'] probes = [] optional_probes = [ - {'id': 'clkout', 'name': 'CLKOUT', 'desc': 'TODO.'}, - {'id': 'clkoe', 'name': 'CLKOE', 'desc': 'TODO.'}, - {'id': 'int', 'name': 'INT#', 'desc': 'TODO.'}, + {'id': 'clkout', 'name': 'CLKOUT', 'desc': 'Clock output'}, + {'id': 'clkoe', 'name': 'CLKOE', 'desc': 'Clock output enable'}, + {'id': 'int', 'name': 'INT#', 'desc': 'Interrupt'}, ] options = {} annotations = [ - ['Text', 'Human-readable text'], + ['text', 'Human-readable text'], ] def __init__(self, **kwargs): @@ -55,12 +53,9 @@ class Decoder(srd.Decoder): self.months = -1 self.years = -1 - def start(self, metadata): - # self.out_proto = self.add(srd.OUTPUT_PROTO, 'rtc8564') - self.out_ann = self.add(srd.OUTPUT_ANN, 'rtc8564') - - 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) @@ -147,12 +142,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'