Closed xuanwoafei closed 11 months ago
I think this is related to the slave device. In this code, the received data is read on the rising edge of SCL. What device did this error occur in connection with?
You use SW_I2C_Read_8addr
function or directly use SW_I2C_Read_Data
?
The function SW_I2C_Read_Data
not in header file and can't be use directly! standard function is :
SW_I2C_Read_8addr
SW_I2C_Read_16addr
in this functions, we have delay before call SW_I2C_Read_Data in first time.
Problem: The 8th bit cannot be detected Resolve: d->hal_delay_us(SW_I2C_WAIT_TIME) should place before d->hal_io_ctl(HAL_IO_OPT_SET_SCL_HIGH, NULL)