标题: BSP包,I2C_EEROM出现:I2C_MasterTx 0xf8 is NOT processed [打印本页] 作者: 匿名 时间: 2025-1-10 13:21 标题: BSP包,I2C_EEROM出现:I2C_MasterTx 0xf8 is NOT processed 请问出现这个问题,是什么原因引起的?
在测试赛普拉斯和富士通的EEROMX64的IIC-EEROM出现了这个情况;
但是写入和回读的数据,也是争取的;这种情况是什么引起的?
作者: 匿名 时间: 2025-1-10 13:23
提升出现在了:
/*---------------------------------------------------------------------------------------------------------*/
/* I2C Tx Callback Function */
/*---------------------------------------------------------------------------------------------------------*/
void I2C_MasterTx(uint32_t u32Status)
{
if (u32Status == 0x08) /* START has been transmitted */
{
I2C_SET_DATA(I2C2, g_u8DeviceAddr << 1); /* Write SLA+W to Register I2CDAT */
I2C_SET_CONTROL_REG(I2C2, I2C_CTL_SI);
}
else if (u32Status == 0x18) /* SLA+W has been transmitted and ACK has been received */
{
I2C_SET_DATA(I2C2, g_au8TxData[g_u8DataLen++]);
I2C_SET_CONTROL_REG(I2C2, I2C_CTL_SI);
}
else if (u32Status == 0x20) /* SLA+W has been transmitted and NACK has been received */
{
I2C_SET_CONTROL_REG(I2C2, I2C_CTL_STA | I2C_CTL_STO | I2C_CTL_SI);
}
else if (u32Status == 0x28) /* DATA has been transmitted and ACK has been received */
{
if (g_u8DataLen != 3)
{
I2C_SET_DATA(I2C2, g_au8TxData[g_u8DataLen++]);
I2C_SET_CONTROL_REG(I2C2, I2C_CTL_SI);
}
else
{
I2C_SET_CONTROL_REG(I2C2, I2C_CTL_STO | I2C_CTL_SI);
g_u8EndFlag = 1;
}
}
else
{
/* TO DO */
printf("I2C_MasterTx 0x%x is NOT processed\n", u32Status);
}
}