Add regi2c enable/disable reference count

This commit is contained in:
Cao Sen Miao
2022-06-20 17:56:16 +08:00
parent 3a820462ac
commit 2c0651a671
10 changed files with 116 additions and 23 deletions
@@ -39,16 +39,22 @@ static inline void regi2c_ctrl_ll_i2c_apll_enable(void)
}
/**
* @brief Enable I2C_SAR
* @brief Enable the I2C internal bus to do I2C read/write operation to the SAR_ADC register
*/
static inline void regi2c_ctrl_ll_i2c_saradc_enable(void)
{
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_SAR_I2C_FORCE_PD_M);
SET_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_SAR_I2C_FORCE_PU_M);
CLEAR_PERI_REG_MASK(ANA_CONFIG_REG, I2C_SAR_M);
SET_PERI_REG_MASK(ANA_CONFIG2_REG, ANA_SAR_CFG2_M);
}
/**
* @brief Disable the I2C internal bus to do I2C read/write operation to the SAR_ADC register
*/
static inline void regi2c_ctrl_ll_i2c_saradc_disable(void)
{
CLEAR_PERI_REG_MASK(ANA_CONFIG2_REG, ANA_SAR_CFG2_M);
}
#ifdef __cplusplus
}
#endif