/* In order to start the I2CEngine, the all the parameters must be set in advance, including I2CWriteLength, I2CReadLength, I2CCmd, and the I2cMasterBuffer which contains the stream command/data to the I2c slave device. (1) If it's a I2C write only, the number of bytes to be written is I2CWriteLength, I2CReadLength is zero, the content will be filled in the I2CMasterBuffer. (2) If it's a I2C read only, the number of bytes to be read is I2CReadLength, I2CWriteLength is 0, the read value will be filled in the I2CMasterBuffer. (3) If it's a I2C Write/Read with repeated start, specify the I2CWriteLength, fill the content of bytes to be written in I2CMasterBuffer, specify the I2CReadLength, after the repeated start and the device address with RD bit set, the content of the reading will be filled in I2CMasterBuffer index at I2CMasterBuffer[I2CWriteLength+2]. e.g. Start, DevAddr(W), WRByte1...WRByteN, Repeated-Start, DevAddr(R),
RDByte1...RDByteN Stop. The content of the reading will be filled after (I2CWriteLength + two devaddr) bytes. */
![](static/image/smiley/default/smile.gif)
|