1 of 1 people found this helpful
When your PSoC5 is the master then you need to act differently:
When you want to read from a device you use (example for reading two bytes
I2C_MasterSendStart(DeviceAddress,I2C_WRITE_XFER_MODE); // Initialize a transaction for writing
I2C_MasterWrite(Register); // Indicate which register you want to write to
I2C_MasterReadByte(I2C_ACK_DATA); // Read first byte from register
I2C_MasterReadByte(I2C_NAK_DATA); // Read second byte from register, last byte is NAKed
I2C_MasterSendStop(); // End of transaction
Not too difficult. Keep in mind that most of the APIs (except those for reading a byte) return a status byte which, when non-zero indicate an error condition.
Thanks for response, I've successfully implement the function in the demo board.