slave device using is IQS333触摸传感器。在那里我无法正确地沟通。
以下是代码片段,请解释在就绪字节函数
中工作的
SEND_I2C_COMMAND (0 x0100);//设置R/W位为1(读访问)
WAIT_FOR_RECEIVED_BYTE (); // Wait for received data
and i2c_eeprom_error_code
i2c_eeprom_error_code i2c_wait_until_i2c_eeprom_ready(void)
{
uint16_t ui16tx_abrt_source;
// Check if ACK is received
for (uint32_t ui32Indx = 0; ui32Indx < I2C_MAX_RETRIES; ui32Indx++)
{
SEND_I2C_COMMAND(0x08); // Make a dummy access
WAIT_UNTIL_I2C_FIFO_IS_EMPTY(); // Wait until Tx FIFO is empty
WAIT_UNTIL_NO_MASTER_ACTIVITY(); // Wait until no master activity
ui16tx_abrt_source = GetWord16(I2C_TX_ABRT_SOURCE_REG); // Read the I2C_TX_ABRT_SOURCE_REG register
GetWord16(I2C_CLR_TX_ABRT_REG); // Clear I2C_TX_ABRT_SOURCE register
if ((ui16tx_abrt_source & ABRT_7B_ADDR_NOACK) == 0)
{
return I2C_NO_ERROR;
}
}
return I2C_7B_ADDR_NOACK_ERROR;
}
above attached snippet.
Urgent help need.
Thanks and Regards
Rohit