refactor(i2c): rename some LL functions according to TRM descriptions

This commit is contained in:
morris
2024-11-20 18:16:34 +08:00
parent 5c9e7670f2
commit 3fb7461eb0
17 changed files with 162 additions and 144 deletions

View File

@@ -280,7 +280,7 @@ static inline void i2c_ll_get_intr_mask(i2c_dev_t *hw, uint32_t *intr_status)
*
* @return None
*/
static inline void i2c_ll_slave_set_fifo_mode(i2c_dev_t *hw, bool fifo_mode_en)
static inline void i2c_ll_enable_fifo_mode(i2c_dev_t *hw, bool fifo_mode_en)
{
hw->fifo_conf.nonfifo_en = fifo_mode_en ? 0 : 1;
}
@@ -299,7 +299,7 @@ static inline void i2c_ll_set_tout(i2c_dev_t *hw, int tout)
}
/**
* @brief Configure I2C slave broadcasting mode.
* @brief Enable the I2C slave to respond to broadcast address
*
* @param hw Beginning address of the peripheral registers
* @param broadcast_en Set true to enable broadcast, else, set it false
@@ -509,7 +509,7 @@ static inline void i2c_ll_get_tout(i2c_dev_t *hw, int *timeout)
* @return None
*/
__attribute__((always_inline))
static inline void i2c_ll_master_trans_start(i2c_dev_t *hw)
static inline void i2c_ll_start_trans(i2c_dev_t *hw)
{
hw->ctr.trans_start = 1;
}
@@ -708,7 +708,6 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw)
ctrl_reg.sda_force_out = 1;
ctrl_reg.scl_force_out = 1;
hw->ctr.val = ctrl_reg.val;
hw->fifo_conf.fifo_addr_cfg_en = 0;
}
/**
@@ -770,12 +769,12 @@ static inline void i2c_ll_reset_register(int i2c_port)
#define i2c_ll_reset_register(...) do {(void)__DECLARE_RCC_ATOMIC_ENV; i2c_ll_reset_register(__VA_ARGS__);} while(0)
/**
* @brief Set whether slave should auto start, or only start with start signal from master
* @brief Enable I2C slave to automatically send data when addressed by the master
*
* @param hw Beginning address of the peripheral registers
* @param slv_ex_auto_en 1 if slave auto start data transaction, otherwise, 0.
*/
static inline void i2c_ll_slave_tx_auto_start_en(i2c_dev_t *hw, bool slv_ex_auto_en)
static inline void i2c_ll_slave_enable_auto_start(i2c_dev_t *hw, bool slv_ex_auto_en)
{
;// ESP32 do not support
}