www.ti.com |
If the command is sent with no problem, the returning byte [0] is the same as the sent one logically ORed with 0x20 - in the preceding first example, the returning packet is:
[0]0x31
[1]0xA0
[2]0x02
[3]0x05
[4]0xAA
[5]0x55
If for some reason the interface fails (for example, the I2C device does not acknowledge), it comes back as:
[0]0x51
[1]0xA0
[2]0x02
[3]0x05
[4]0xAA
[5]0x55
If the request is malformed, that is, the interface byte (byte [0]) takes on a value which is not as preciously described, the return packet is:
[0]0x93
[1]0xA0
[2]0x02
[3]0x05
[4]0xAA
[5]0x55
The preceding examples used writes. Reading is similar:
Read two bytes from device starting at register 5 of an I2C device with address A0:
[0]0x01
[1]0xA0
[2]0x02
[3]0x05
The return packet is:
[0]0x21
[1]0xA0
[2]0x02
[3]0x05
[4]0xAA
[5]0x55
assuming that the preceding values starting at Register 5 were actually written to the device.
48 |
Submit Documentation Feedback