I've a question regarding I2C communication in CY8CKIT-042 pioneer board.
What I want to do is a simple I2C communication; Write a byte and read a value from slave. It could be programmed in Arduino like below.
const int address = 0x40;
// open the serial port
// Start the I2C module
// start a transmission to the slave
// request register 0
// issue the request
// prepare to receive on byte
// wait for the data to be ready
// print the temperature
I started this program with an example project, I2cCommMaster. When I try this project with my commands and slave address, I found that the master couldn't complete write, so my program holds here;
[main.c @ line:85]
while (0u == (I2CM_I2CMasterStatus() & I2CM_I2C_MSTAT_WR_CMPLT))
/* Waits until master completes write transfer */
Could you guys help me to make this code run? I attach all my code below for your information.
Thanks for your help in advance.