self.oldsda = None
def start(self, metadata):
- self.output_protocol = self.output_new(1)
- self.output_annotation = self.output_new(0)
+ self.output_protocol = self.add(sigrokdecode.SRD_OUTPUT_PROTOCOL, 'i2c')
+ self.output_annotation = self.add(sigrokdecode.SRD_OUTPUT_ANNOTATION, 'i2c')
def report(self):
pass
self.databyte >>= 1 # Shift out unwanted ACK/NACK bit here.
if self.state == FIND_ADDRESS:
- d = self.databyte & 0xfe
# The READ/WRITE bit is only in address bytes, not data bytes.
- self.wr = 1 if (self.databyte & 1) else 0
+ if self.databyte & 1:
+ self.wr = 0
+ else:
+ self.wr = 1
+ d = self.databyte >> 1
elif self.state == FIND_DATA:
d = self.databyte
else: