Hi All,
I am the colleague of Dario working on this project, we used the following code to test:
int main(void)
{
int tmp;
int xflag = 0;
static I2C_XFER_T xfer;
/* Generic Initialization */
SystemCoreClockUpdate();
Board_Init();
i2c_app_init(I2C0, SPEED_100KHZ);
/* Simulate an EEPROM slave in I2C0 */
i2c_eeprom_init(I2C_EEPROM_BUS);
xfer.slaveAddr = 0x34;
xfer.rxBuff = 0;
xfer.txBuff = 0;
xfer.txSz = 0;
xfer.rxSz = 2;
tmp = Chip_I2C_MasterRead(i2cDev, xfer.slaveAddr, xfer.rxBuff, xfer.rxSz);
return 0;
}
I2C pull-up resistors are in place but we still cannot see any activity on the I2C lines , any idea ?
Also about this i2c_eeprom_init(I2C_EEPROM_BUS); this is used for EEPROM read as follows ,
I just modified I2C_SLAVE_EEPROM_ADDR to be our TFA98XX address, anything else must be also changed ?
static void i2c_eeprom_init(I2C_ID_T id)
{
memset(&seep_data[1], 0xFF, I2C_SLAVE_EEPROM_SIZE);
seep_xfer.slaveAddr = (I2C_SLAVE_EEPROM_ADDR << 1);
seep_xfer.txBuff = &seep_data[1];
seep_xfer.rxBuff = seep_data;
seep_xfer.txSz = seep_xfer.rxSz = sizeof(seep_data);
Chip_I2C_SlaveSetup(id, I2C_SLAVE_0, &seep_xfer, i2c_eeprom_events, 0);
}
Thanks in advance.
Mehdi