X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2cfilter%2Fpd.py;h=a54baab247b88a474db2c08a3649d097ba2c5e52;hb=3f5f3a92889e2f297ee6b94362e587a2994f896b;hp=c3f148fc07e8ae78550b7afb9765cd20a363a04b;hpb=92b7b49f6964f57a7d6fc4473645c993cfa4ba52;p=libsigrokdecode.git diff --git a/decoders/i2cfilter/pd.py b/decoders/i2cfilter/pd.py index c3f148f..a54baab 100644 --- a/decoders/i2cfilter/pd.py +++ b/decoders/i2cfilter/pd.py @@ -23,7 +23,7 @@ import sigrokdecode as srd class Decoder(srd.Decoder): - api_version = 2 + api_version = 3 id = 'i2cfilter' name = 'I²C filter' longname = 'I²C filter' @@ -31,14 +31,18 @@ class Decoder(srd.Decoder): license = 'gplv3+' inputs = ['i2c'] outputs = ['i2c'] + tags = ['Util'] options = ( - {'id': 'address', 'desc': 'Address to filter out of the I²C stream', + {'id': 'address', 'desc': 'Slave address to filter (decimal)', 'default': 0}, {'id': 'direction', 'desc': 'Direction to filter', 'default': 'both', 'values': ('read', 'write', 'both')} ) def __init__(self): + self.reset() + + def reset(self): self.curslave = -1 self.curdirection = None self.packets = [] # Local cache of I²C packets