Hello,
I am trying to implement a function for acknowledge polling after an EEPROM write or read, in order to avoid using a delay.
Here is the code i am trying to use after some searching:
bool EEPROM_isReady(void) { ROM_I2CMasterSlaveAddrSet((I2C0), EEPROM_ADDRESS, false); // true = read // Try to perform a write operation ROM_I2CMasterDataPut(I2C0, 0x00); ROM_I2CMasterControl(I2C0, I2C_MASTER_CMD_SINGLE_SEND); while (ROM_I2CMasterBusy(I2C0)); // If there is an error, it means the EEPROM is still busy return (I2C_MASTER_ERR_NONE == ROM_I2CMasterErr(I2C0)); }
But this function returns always false.
Is there something wrong in that code? or is there any other way to implement the acknowledge polling?
Thanks in advance if you have any suggestion.