mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_adc: add adc ulp mode disable enum
Prior to this commit, adc ulp is disabled by setting adc_oneshot_unit_init_cfg_t::ulp_mode to false. After this commit, a new enum `ADC_ULP_MODE_DISABLE` is added. So setting `ulp_mode` to `ADC_ULP_MODE_DISABLE`, instead of `false`, to disable the ulp mode.
This commit is contained in:
parent
e80d4c8f76
commit
5e31d4bb2b
@ -44,7 +44,7 @@ TEST_CASE("ADC oneshot high/low test", "[adc_oneshot]")
|
||||
adc_oneshot_unit_handle_t adc1_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config1 = {
|
||||
.unit_id = ADC_UNIT_1,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config1, &adc1_handle));
|
||||
|
||||
@ -53,7 +53,7 @@ TEST_CASE("ADC oneshot high/low test", "[adc_oneshot]")
|
||||
adc_oneshot_unit_handle_t adc2_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config2 = {
|
||||
.unit_id = ADC_UNIT_2,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config2, &adc2_handle));
|
||||
#endif //#if (SOC_ADC_PERIPH_NUM >= 2)
|
||||
@ -135,7 +135,7 @@ static void s_adc_oneshot_with_sleep(adc_unit_t unit_id, adc_channel_t channel)
|
||||
adc_oneshot_unit_handle_t adc_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config = {
|
||||
.unit_id = unit_id,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config, &adc_handle));
|
||||
|
||||
|
@ -72,7 +72,7 @@ TEST_CASE("ADC oneshot fast work with ISR", "[adc_oneshot]")
|
||||
//-------------ADC1 Init---------------//
|
||||
adc_oneshot_unit_init_cfg_t init_config1 = {
|
||||
.unit_id = ADC_UNIT_1,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config1, &isr_test_ctx.adc_handle));
|
||||
|
||||
|
@ -78,7 +78,7 @@ TEST_CASE("ADC oneshot fast work with ISR and Flash", "[adc_oneshot]")
|
||||
//-------------ADC1 Init---------------//
|
||||
adc_oneshot_unit_init_cfg_t init_config1 = {
|
||||
.unit_id = ADC_UNIT_1,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config1, &oneshot_handle));
|
||||
|
||||
|
@ -134,7 +134,7 @@ TEST_CASE("ADC1 oneshot raw average / std_deviation", "[adc_oneshot][ignore][man
|
||||
adc_oneshot_unit_handle_t adc1_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config1 = {
|
||||
.unit_id = ADC_UNIT_1,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config1, &adc1_handle));
|
||||
|
||||
@ -254,7 +254,7 @@ static void s_adc_cali_speed(adc_unit_t unit_id, adc_channel_t channel)
|
||||
adc_oneshot_unit_handle_t adc_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config = {
|
||||
.unit_id = unit_id,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_new_unit(&init_config, &adc_handle));
|
||||
|
||||
|
@ -55,8 +55,9 @@ typedef enum {
|
||||
} adc_bitwidth_t;
|
||||
|
||||
typedef enum {
|
||||
ADC_ULP_MODE_FSM = 1, ///< ADC is controlled by ULP FSM
|
||||
ADC_ULP_MODE_RISCV = 2, ///< ADC is controlled by ULP RISCV
|
||||
ADC_ULP_MODE_DISABLE = 0, ///< ADC ULP mode is disabled
|
||||
ADC_ULP_MODE_FSM = 1, ///< ADC is controlled by ULP FSM
|
||||
ADC_ULP_MODE_RISCV = 2, ///< ADC is controlled by ULP RISCV
|
||||
} adc_ulp_mode_t;
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ Create an ADC Unit Handle under Normal Oneshot Mode
|
||||
adc_oneshot_unit_handle_t adc1_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config1 = {
|
||||
.unit_id = ADC_UNIT_1,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
ESP_ERROR_CHECK(adc_oneshot_new_unit(&init_config1, &adc1_handle));
|
||||
|
||||
|
@ -70,7 +70,7 @@ void app_main(void)
|
||||
adc_oneshot_unit_handle_t adc2_handle;
|
||||
adc_oneshot_unit_init_cfg_t init_config2 = {
|
||||
.unit_id = ADC_UNIT_2,
|
||||
.ulp_mode = false,
|
||||
.ulp_mode = ADC_ULP_MODE_DISABLE,
|
||||
};
|
||||
ESP_ERROR_CHECK(adc_oneshot_new_unit(&init_config2, &adc2_handle));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user