X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2c.py;h=f0a95b79fd334b1dc6d9e2ca875b0dee988694fe;hb=d0a0ed032e0120140a28e93ac42753786bf0087b;hp=e63ab8525454eb48ae10a2b244e01bb0862aa4b1;hpb=87998e973f16206be1391f87ccae7c2756baf353;p=libsigrokdecode.git diff --git a/decoders/i2c.py b/decoders/i2c.py index e63ab85..f0a95b7 100644 --- a/decoders/i2c.py +++ b/decoders/i2c.py @@ -22,6 +22,7 @@ # I2C protocol decoder # +# # The Inter-Integrated Circuit (I2C) bus is a bidirectional, multi-master # bus using two signals (SCL = serial clock line, SDA = serial data line). # @@ -68,28 +69,26 @@ # TODO: Handle multiple different I2C devices on same bus # -> we need to decode multiple protocols at the same time. -""" -I2C protocol output format: - -The protocol output consists of a (Python) list of I2C "packets", each of -which is of the form +''' +Protocol output format: - [ _i2c_command_, _data_, _ack_bit_ ] +I2C packet: +[, , ] -_i2c_command_ is one of: + is one of: - 'START' (START condition) - - 'START_REPEAT' (Repeated START) - - 'ADDRESS_READ' (Address, read) - - 'ADDRESS_WRITE' (Address, write) - - 'DATA_READ' (Data, read) - - 'DATA_WRITE' (Data, write) + - 'START REPEAT' (Repeated START) + - 'ADDRESS READ' (Address, read) + - 'ADDRESS WRITE' (Address, write) + - 'DATA READ' (Data, read) + - 'DATA WRITE' (Data, write) - 'STOP' (STOP condition) -_data_ is the data or address byte associated with the ADDRESS_* and DATA_* -command. For START, START_REPEAT and STOP, this is None. + is the data or address byte associated with the 'ADDRESS*' and 'DATA*' +command. For 'START', 'START REPEAT' and 'STOP', this is None. -_ack_bit_ is either 'ACK' or 'NACK', but may also be None. -""" + is either 'ACK' or 'NACK', but may also be None. +''' import sigrokdecode as srd @@ -122,8 +121,6 @@ class Decoder(srd.Decoder): longname = 'Inter-Integrated Circuit' desc = 'I2C is a two-wire, multi-master, serial bus.' longdesc = '...' - author = 'Uwe Hermann' - email = 'uwe@hermann-uwe.de' license = 'gplv2+' inputs = ['logic'] outputs = ['i2c']