import sigrokdecode as srd
class Decoder(srd.Decoder):
- api_version = 2
+ api_version = 3
id = 'i2cfilter'
name = 'I²C filter'
longname = 'I²C filter'
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
self.packets = []
else:
pass # Do nothing, only add the I²C packet to our cache.
-