1. Power-on sequence, omitted directly
2. waitclock sends two bytes of 0x00 to the I2C bus. The specific method is to write a byte 0x0 to the address 0.
3. Run the "0xb8 00 00 0x0a" command to directly return the command and data.
The rule of at88 is to send commands before reading and writing data each time. Therefore, reading and writing data must contain commands.
The Data Writing operation is very simple. The first byte of the command is used as the address, and the rest of the command and data are used as the general data transmission.
Read operations are a little more complex. The timing of at88 is not standard I2C, but is generally compatible. I2C cannot implement the normal read sequence described in at88, but it can be replaced by the random read operation. The specific implementation is to first send the write data command "0xb4 xx N", where "xx n" represents the address and Data Length. At this time, nack should be used. Then use "0xb1" as the address to read.
For example, to read data, run the "0xbx bb cc n" command to read n bytes of data. perform the following operations using I2C: write three bytes to I2C with the address "0xb4" and the last three bytes of the command "bb cc n". Therefore, the I2C should ignore nack. Then read n bytes of data with the address "0xbx.