- if self.state == FIND_ADDRESS:
- self.state = FIND_DATA
- elif self.state == FIND_DATA:
- # There could be multiple data bytes in a row.
- # So, either find a STOP condition or another data byte next.
- pass
+ def get_ack(self, scl, sda):
+ self.startsample = self.samplenum
+ ack_bit = 'NACK' if (sda == 1) else 'ACK'
+ self.put(self.out_proto, [ack_bit, None])
+ self.put(self.out_ann, [ANN_SHIFTED, [protocol[ack_bit][0]]])
+ self.put(self.out_ann, [ANN_SHIFTED_SHORT, [protocol[ack_bit][1]]])
+ # There could be multiple data bytes in a row, so either find
+ # another data byte or a STOP condition next.
+ self.state = FIND_DATA