Hi
device/slave address is send automatically as first byte for each Send/Receive function, so it is not needed to include it in buffer. Repeated start will be used if previous transmission does not trigger stop; SendStop parameter in function is FALSE.
So to read device register/memory you need...
- send device register address to be read with SendStop=False. The txBuffer include register address, transfer size is 1 or 2 depending of address width
Lpi2c_Ip_MasterSendDataBlocking(LPI2C_CHANNEL_0, txBuffer, TRANSFER_SIZE, FALSE, timeout);
- receive number of desired bytes from register address send above, generate STOP at the end
Lpi2c_Ip_MasterReceiveDataBlocking(LPI2C_CHANNEL_0, rxBuffer, TRANSFER_SIZE, TRUE, timeout);
Non-blocking transfer can be used as well, but you need to check end of transfer in that case.
BR, Petr