X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fds1307%2Fpd.py;h=48649bf325f2b0f9fae7e5c853e0911a2eb625da;hp=8652d1b8fc6426644f20a486496e0d01ca17e1fd;hb=da9bcbd9f45b0153465c55ec726a0d76f6d7f01e;hpb=be465111b552c7c2a2262ac49758a30a8bf1b1d5 diff --git a/decoders/ds1307/pd.py b/decoders/ds1307/pd.py index 8652d1b..48649bf 100644 --- a/decoders/ds1307/pd.py +++ b/decoders/ds1307/pd.py @@ -19,8 +19,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# Dallas DS1307 RTC protocol decoder - import sigrokdecode as srd days_of_week = [ @@ -46,12 +44,9 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['i2c'] outputs = ['ds1307'] - probes = [] - optional_probes = [] - options = {} - annotations = [ - ['Text', 'Human-readable text'], - ] + annotations = ( + ('text', 'Human-readable text'), + ) def __init__(self, **kwargs): self.state = 'IDLE' @@ -66,9 +61,6 @@ class Decoder(srd.Decoder): def start(self): self.out_ann = self.register(srd.OUTPUT_ANN) - def report(self): - pass - def putx(self, data): self.put(self.ss, self.es, self.out_ann, data) @@ -106,12 +98,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'