X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2c%2Fpd.py;h=a8a222687d9ac8792315acadcbeaf3726a2e4465;hb=12851357e784b893e24880efc6cd22a0cbcc64ce;hp=9cbdd533c4012f01f706f6b5f1f4479f18e11ae4;hpb=84c1c0b52820af2418186ac3ecf93a5c6373a22e;p=libsigrokdecode.git diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py index 9cbdd53..a8a2226 100644 --- a/decoders/i2c/pd.py +++ b/decoders/i2c/pd.py @@ -64,7 +64,7 @@ proto = { } class Decoder(srd.Decoder): - api_version = 1 + api_version = 2 id = 'i2c' name = 'I²C' longname = 'Inter-Integrated Circuit' @@ -72,28 +72,27 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['logic'] outputs = ['i2c'] - probes = [ + channels = ( {'id': 'scl', 'name': 'SCL', 'desc': 'Serial clock line'}, {'id': 'sda', 'name': 'SDA', 'desc': 'Serial data line'}, - ] - optional_probes = [] + ) options = ( {'id': 'address_format', 'desc': 'Displayed slave address format', 'default': 'shifted', 'values': ('shifted', 'unshifted')}, ) - annotations = [ - ['start', 'Start condition'], - ['repeat-start', 'Repeat start condition'], - ['stop', 'Stop condition'], - ['ack', 'ACK'], - ['nack', 'NACK'], - ['bit', 'Data/address bit'], - ['address-read', 'Address read'], - ['address-write', 'Address write'], - ['data-read', 'Data read'], - ['data-write', 'Data write'], - ['warnings', 'Human-readable warnings'], - ] + annotations = ( + ('start', 'Start condition'), + ('repeat-start', 'Repeat start condition'), + ('stop', 'Stop condition'), + ('ack', 'ACK'), + ('nack', 'NACK'), + ('bit', 'Data/address bit'), + ('address-read', 'Address read'), + ('address-write', 'Address write'), + ('data-read', 'Data read'), + ('data-write', 'Data write'), + ('warnings', 'Human-readable warnings'), + ) annotation_rows = ( ('bits', 'Bits', (5,)), ('addr-data', 'Address/Data', (0, 1, 2, 3, 4, 6, 7, 8, 9)),