I am developing witch the TM4C123HE6PZ, and use I2C0 to interface with the AST2500, and it works in slave mode.
Data will incorrect when the master using repected start to do read action.
It works well when I manually issue command without repected start.
int I2C0IntHandler() {
unsigned char i2cData = 0;
unsigned long ulAct = 0;
I2CSlaveIntClear(I2C0_BASE);
ulAct = I2CSlaveStatus(I2C0_SLAVE_BASE);
switch (ulAct) {
case I2C_SLAVE_ACT_NONE:
break;
case I2C_SLAVE_ACT_RREQ_FBR:
case I2C_SLAVE_ACT_RREQ:
i2cData = I2CSlaveDataGet(I2C0_SLAVE_BASE);
ProcRecvData(i2cData);
break;
case I2C_SLAVE_ACT_TREQ:
if(getDataPos < getDateLen){
I2CSlaveDataPut(I2C0_SLAVE_BASE, getDataBuf[getDataPos]);
getDataPos++;
}
else{
I2CSlaveDataPut(I2C0_SLAVE_BASE, 0xE0);
}
break;
default:
break;
}
}