}
class Decoder(srd.Decoder):
- api_version = 1
+ api_version = 2
id = 'mxc6225xu'
name = 'MXC6225XU'
longname = 'MEMSIC MXC6225XU'
license = 'gplv2+'
inputs = ['i2c']
outputs = ['mxc6225xu']
- probes = []
- optional_probes = [
- {'id': 'int', 'name': 'INT', 'desc': 'DTOS interrupt output pin'},
- ]
- options = {}
- annotations = [
- ['Text', 'Human-readable text'],
- ]
+ annotations = (
+ ('text', 'Human-readable text'),
+ )
def __init__(self, **kwargs):
self.state = 'IDLE'
def start(self):
- # self.out_proto = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putx(self, data):
if cmd != 'START':
return
self.state = 'GET SLAVE ADDR'
- self.block_start_sample = ss
elif self.state == 'GET SLAVE ADDR':
# Wait for an address write operation.
# TODO: We should only handle packets to the slave(?)
self.state = 'IDLE'
else:
pass # TODO?
- else:
- raise Exception('Invalid state: %s' % self.state)
-