Hi, everyone
i'm trying to use CC3200 as I2C Slave . i set the i2c slave address to #5, and enable I2C_SLAVE_INT_DATA interrupt, but i found that, when i used other MCU to keep writing data to another address , for example, #127, CC3200 will also enter intterrupt and SCSR register shows the cause is I2C_SCSR_TREQ .
below is my code, any help is appreciated greatly.
void I2C_Init(void)
{
PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
PRCMPeripheralReset(PRCM_I2CA0);
I2CSlaveInit(I2CA0_BASE, MASTER_I2C_ADDR);
I2CSlaveFIFODisable(I2CA0_BASE);
I2CSlaveIntEnableEx(I2CA0_BASE, I2C_SLAVE_INT_DATA);
I2CIntRegister(I2CA0_BASE, I2C0_IRQHandler);
//I2CMasterInitExpClk(I2CA0_BASE,80000000,false);
I2CSlaveDataGet(I2CA0_BASE);
IntEnable(INT_I2CA0);
}
void I2C0_IRQHandler(void)
{
uiStatus = I2CSlaveStatus(I2CA0_BASE);
I2CSlaveIntClearEx(I2CA0_BASE, I2C_SLAVE_INT_DATA);
if(uiStatus & I2C_SCSR_DA)
{
...
}
else if(uiStatus & I2C_SCSR_TREQ)
{
//enter here
...
}
}