mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-19 00:03:19 +00:00
Merge branch 'refactor/rng_ll_c6' into 'master'
refactor(rng): refactor to use hal/ll apis for c6 Closes IDF-12533 See merge request espressif/esp-idf!37319
This commit is contained in:
@@ -660,7 +660,7 @@ static inline void adc_ll_set_calibration_param(adc_unit_t adc_n, uint32_t param
|
||||
__attribute__((always_inline))
|
||||
static inline void adc_ll_set_dtest_param(uint32_t param)
|
||||
{
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_DTEST , param);
|
||||
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_DTEST, param);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,13 +675,13 @@ static inline void adc_ll_set_ent_param(uint32_t param)
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the SAR TOUT bus
|
||||
* Enable/disable the calibration voltage reference for ADC unit.
|
||||
*
|
||||
* @param adc_n ADC index number.
|
||||
* @param en true for enable
|
||||
* @param en true to enable, false to disable
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline void adc_ll_enable_encal_ref(adc_unit_t adc_n, bool en)
|
||||
static inline void adc_ll_enable_calibration_ref(adc_unit_t adc_n, bool en)
|
||||
{
|
||||
//C61 doesn't support ADC2, here is for backward compatibility for RNG
|
||||
if (adc_n == ADC_UNIT_1) {
|
||||
@@ -695,13 +695,13 @@ __attribute__((always_inline))
|
||||
/**
|
||||
* Init regi2c SARADC registers
|
||||
*/
|
||||
static inline void adc_ll_regi2c_adc_init(void)
|
||||
static inline void adc_ll_regi2c_init(void)
|
||||
{
|
||||
adc_ll_set_dtest_param(0);
|
||||
adc_ll_set_ent_param(1);
|
||||
// Config ADC circuit (Analog part) with I2C(HOST ID 0x69) and chose internal voltage as sampling source
|
||||
adc_ll_enable_encal_ref(ADC_UNIT_1, true);
|
||||
adc_ll_enable_encal_ref(ADC_UNIT_2, true);
|
||||
adc_ll_enable_calibration_ref(ADC_UNIT_1, true);
|
||||
adc_ll_enable_calibration_ref(ADC_UNIT_2, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -712,8 +712,8 @@ static inline void adc_ll_regi2c_adc_deinit(void)
|
||||
{
|
||||
adc_ll_set_dtest_param(0);
|
||||
adc_ll_set_ent_param(0);
|
||||
adc_ll_enable_encal_ref(ADC_UNIT_1, false);
|
||||
adc_ll_enable_encal_ref(ADC_UNIT_2, false);
|
||||
adc_ll_enable_calibration_ref(ADC_UNIT_1, false);
|
||||
adc_ll_enable_calibration_ref(ADC_UNIT_2, false);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
|
@@ -129,19 +129,19 @@ static inline void regi2c_ctrl_ll_i2c_periph_disable(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set regi2c reset
|
||||
* @brief Enter / Exit reset state
|
||||
*
|
||||
* @param enter True to reset mode, false to normal working mode
|
||||
*/
|
||||
static inline void regi2c_ctrl_ll_i2c_reset_set(void)
|
||||
static inline void regi2c_ctrl_ll_reset(bool reset_on)
|
||||
{
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear regi2c reset
|
||||
*/
|
||||
static inline void regi2c_ctrl_ll_i2c_reset_clear(void)
|
||||
{
|
||||
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
if (reset_on) {
|
||||
// Reset mode
|
||||
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
} else {
|
||||
// Normal working mode
|
||||
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user