mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-11 21:10:20 +00:00
fix(i2c): Fix possible error state in clear the bus,
Closes https://github.com/espressif/esp-idf/issues/13647
This commit is contained in:
@@ -797,16 +797,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return true; // not supported on esp32s3
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set I2C source clock
|
||||
*
|
||||
|
Reference in New Issue
Block a user