X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fddc.py;h=9b5bc5fdd525a053892993a8e32362c12305792d;hb=a10bfc48b04de832a62a474b34b23f8f24662e9a;hp=4b6cf6a7884cbbe6af7798e4b093063250c3739a;hpb=eb7082c98efad727d88e3ebeadcd496fa948475b;p=libsigrokdecode.git diff --git a/decoders/ddc.py b/decoders/ddc.py index 4b6cf6a..9b5bc5f 100644 --- a/decoders/ddc.py +++ b/decoders/ddc.py @@ -36,9 +36,12 @@ class Decoder(srd.Decoder): desc = 'A protocol for communication between computers and displays.' longdesc = '' author = 'Bert Vermeulen ' + email = '' license = 'gplv3+' inputs = ['i2c'] outputs = ['ddc'] + probes = [] + options = {} annotations = [ ['Byte stream', 'DDC byte stream as read from display.'], ] @@ -49,9 +52,9 @@ class Decoder(srd.Decoder): def start(self, metadata): self.out_ann = self.add(srd.OUTPUT_ANN, 'ddc') - def decode(self, start_sample, end_sample, i2c_data): + def decode(self, ss, es, data): try: - cmd, data, ack_bit = i2c_data + cmd, data, ack_bit = data except Exception as e: raise Exception('malformed I2C input: %s' % str(e)) from e @@ -71,6 +74,5 @@ class Decoder(srd.Decoder): if cmd == 'DATA_READ': # There shouldn't be anything but data reads on this # address, so ignore everything else. - self.put(start_sample, end_sample, self.out_ann, - [0, ['0x%.2x' % data]]) + self.put(ss, es, self.out_ann, [0, ['0x%.2x' % data]])