mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
adc: remove adc_hal_conf.h
Macros inside adc_hal_conf.h are moved to adc_ll.h
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "hal/adc_hal.h"
|
||||
#include "hal/adc_ll.h"
|
||||
#include "hal/adc_types.h"
|
||||
#include "hal/adc_hal_conf.h"
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
#include "esp_pm.h"
|
||||
#endif
|
||||
@@ -235,13 +234,13 @@ esp_err_t adc_i2s_mode_init(adc_unit_t adc_unit, adc_channel_t channel)
|
||||
}
|
||||
adc_common_gpio_init(adc_unit, channel);
|
||||
ADC_ENTER_CRITICAL();
|
||||
adc_ll_digi_set_fsm_time(ADC_HAL_FSM_RSTB_WAIT_DEFAULT, ADC_HAL_FSM_START_WAIT_DEFAULT,
|
||||
ADC_HAL_FSM_STANDBY_WAIT_DEFAULT);
|
||||
adc_ll_set_sample_cycle(ADC_HAL_SAMPLE_CYCLE_DEFAULT);
|
||||
adc_hal_pwdet_set_cct(ADC_HAL_PWDET_CCT_DEFAULT);
|
||||
adc_ll_digi_output_invert(ADC_UNIT_1, ADC_HAL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_1));
|
||||
adc_ll_digi_output_invert(ADC_UNIT_2, ADC_HAL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_2));
|
||||
adc_ll_digi_set_clk_div(ADC_HAL_DIGI_SAR_CLK_DIV_DEFAULT);
|
||||
adc_ll_digi_set_fsm_time(ADC_LL_FSM_RSTB_WAIT_DEFAULT, ADC_LL_FSM_START_WAIT_DEFAULT,
|
||||
ADC_LL_FSM_STANDBY_WAIT_DEFAULT);
|
||||
adc_ll_set_sample_cycle(ADC_LL_SAMPLE_CYCLE_DEFAULT);
|
||||
adc_hal_pwdet_set_cct(ADC_LL_PWDET_CCT_DEFAULT);
|
||||
adc_ll_digi_output_invert(ADC_UNIT_1, ADC_LL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_1));
|
||||
adc_ll_digi_output_invert(ADC_UNIT_2, ADC_LL_DIGI_DATA_INVERT_DEFAULT(ADC_UNIT_2));
|
||||
adc_ll_digi_set_clk_div(ADC_LL_DIGI_SAR_CLK_DIV_DEFAULT);
|
||||
adc_digi_controller_reg_set(&dig_cfg);
|
||||
ADC_EXIT_CRITICAL();
|
||||
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include "hal/adc_types.h"
|
||||
#include "hal/adc_hal.h"
|
||||
#include "hal/adc_hal_common.h"
|
||||
#include "hal/adc_hal_conf.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "driver/adc_types_legacy.h"
|
||||
#include "clk_tree.h"
|
||||
@@ -157,17 +156,17 @@ static void adc_rtc_chan_init(adc_unit_t adc_unit)
|
||||
#if SOC_DAC_SUPPORTED
|
||||
dac_ll_rtc_sync_by_adc(false);
|
||||
#endif
|
||||
adc_oneshot_ll_output_invert(ADC_UNIT_1, ADC_HAL_DATA_INVERT_DEFAULT(ADC_UNIT_1));
|
||||
adc_ll_set_sar_clk_div(ADC_UNIT_1, ADC_HAL_SAR_CLK_DIV_DEFAULT(ADC_UNIT_1));
|
||||
adc_oneshot_ll_output_invert(ADC_UNIT_1, ADC_LL_DATA_INVERT_DEFAULT(ADC_UNIT_1));
|
||||
adc_ll_set_sar_clk_div(ADC_UNIT_1, ADC_LL_SAR_CLK_DIV_DEFAULT(ADC_UNIT_1));
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
adc_ll_hall_disable(); //Disable other peripherals.
|
||||
adc_ll_amp_disable(); //Currently the LNA is not open, close it by default.
|
||||
#endif
|
||||
}
|
||||
if (adc_unit == ADC_UNIT_2) {
|
||||
adc_hal_pwdet_set_cct(ADC_HAL_PWDET_CCT_DEFAULT);
|
||||
adc_oneshot_ll_output_invert(ADC_UNIT_2, ADC_HAL_DATA_INVERT_DEFAULT(ADC_UNIT_2));
|
||||
adc_ll_set_sar_clk_div(ADC_UNIT_2, ADC_HAL_SAR_CLK_DIV_DEFAULT(ADC_UNIT_2));
|
||||
adc_hal_pwdet_set_cct(ADC_LL_PWDET_CCT_DEFAULT);
|
||||
adc_oneshot_ll_output_invert(ADC_UNIT_2, ADC_LL_DATA_INVERT_DEFAULT(ADC_UNIT_2));
|
||||
adc_ll_set_sar_clk_div(ADC_UNIT_2, ADC_LL_SAR_CLK_DIV_DEFAULT(ADC_UNIT_2));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user