I2C Read/Write with ack answer:
The answer sequence is the following one:
Byte#
Number of bits
Example
0x00 I2CReadAnswer (0x0008) 16 bits
0x0008
0x02 TransactionID (same as
demand)
16 bits
0x1254
0x04 Number of bytes in answer 16 bits
0x0005
0x06 Answer bytes
Y bytes
0x1A25…
…
Ack state of the I2C com.
1 byte
0x87
If the same or other I2C slave have been accessed in the command, the answer bytes and ack
state is added here.
…
Checksum
16 bits
0x…
The "Ack state" byte is composed of the following bits:
0
Address ack in write sequence
0 = No answer to this address
1 = ack received
1
Bytes written ack (each byte was acked)
0 = Bytes not acknowledged
1 = ack received
2
Address ack in read sequence
0 = No answer to this address
1 = ack received
3-6
Reserved
-
7
Must be always 1
1
The user can use these bits to check for the presence of his I2C devices and
monitor hardware issues.
I2C Read/Write with ack error answer:
If an error occurred, the answer sequence is the following one:
Byte#
Number of bits
Example
0x00 I2CRWwithAckError
(0x0009)
16 bits
0x0009
0x02 TransactionID (same as
demand)
16 bits
0x1254
0x04 Number of bytes in answer 16 bits
0x0001
0x06 Error code
1 byte
0x01
0x07 Checksum
16 bits
0x…
The error code can be:
0x01 The I2C bus is not ready.
0x02 A timeout occurred when waiting answer from the I2C slave.
0x03 2X + 3Y > 240 in I2CRWwithAck received.