X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fddc.py;h=2336159d70f84d0f12d24addbf13f6db6604ef30;hb=876f83fd3396ce581e700741e58414c2f4f6277e;hp=9b5bc5fdd525a053892993a8e32362c12305792d;hpb=2b9837d9fc5f9b4eca52327527e18db4bfb730ff;p=libsigrokdecode.git diff --git a/decoders/ddc.py b/decoders/ddc.py index 9b5bc5f..2336159 100644 --- a/decoders/ddc.py +++ b/decoders/ddc.py @@ -16,16 +16,13 @@ ## You should have received a copy of the GNU General Public License ## along with this program; if not, If not, see . ## +""" +This decoder extracts a DDC stream from an I2C session between a computer +and a display device. The stream is output as plain bytes. -# -# DDC protocol decoder -# -# This decoder extracts a DDC stream from an I2C session between a computer -# and a display device. The stream is output as plain bytes. -# -# Details: -# https://en.wikipedia.org/wiki/Display_Data_Channel -# +Details: +https://en.wikipedia.org/wiki/Display_Data_Channel +""" import sigrokdecode as srd @@ -35,8 +32,8 @@ class Decoder(srd.Decoder): longname = 'Display Data Channel' desc = 'A protocol for communication between computers and displays.' longdesc = '' - author = 'Bert Vermeulen ' - email = '' + author = 'Bert Vermeulen' + email = 'bert@biot.com' license = 'gplv3+' inputs = ['i2c'] outputs = ['ddc'] @@ -60,10 +57,10 @@ class Decoder(srd.Decoder): if self.state is None: # Wait for the DDC session to start. - if cmd in ('START', 'START_REPEAT'): + if cmd in ('START', 'START REPEAT'): self.state = 'start' elif self.state == 'start': - if cmd == 'ADDRESS_READ' and data == 80: + if cmd == 'ADDRESS READ' and data == 80: # 80 is the I2C slave address of a connected display, # so this marks the start of the DDC data transfer. self.state = 'transfer' @@ -71,7 +68,7 @@ class Decoder(srd.Decoder): # Got back to the idle state. self.state = None elif self.state == 'transfer': - if cmd == 'DATA_READ': + if cmd == 'DATA READ': # There shouldn't be anything but data reads on this # address, so ignore everything else. self.put(ss, es, self.out_ann, [0, ['0x%.2x' % data]])