X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=decoders%2Fi2cfilter%2Fpd.py;h=a54baab247b88a474db2c08a3649d097ba2c5e52;hb=7b0f3c78c5cda82b900937f3be2e08b063b84f3c;hp=1a9f43328b6a37c8f09b39695f75b405c4d62e93;hpb=22fc7ace72f3165c98208a8f544156e04a709639;p=libsigrokdecode.git diff --git a/decoders/i2cfilter/pd.py b/decoders/i2cfilter/pd.py index 1a9f433..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, **kwargs): + def __init__(self): + self.reset() + + def reset(self): self.curslave = -1 self.curdirection = None self.packets = [] # Local cache of I²C packets @@ -87,4 +91,3 @@ class Decoder(srd.Decoder): self.packets = [] else: pass # Do nothing, only add the I²C packet to our cache. -