mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-11 02:07:46 +00:00
fix(adc): rename ADC_ATTEN_DB_11 to ADC_ATTEN_DB_12
By design, it's 12 dB. There're errors among chips, so the actual attenuation will be 11dB more or less
This commit is contained in:
@@ -63,7 +63,7 @@ TEST_CASE("ADC oneshot high/low test", "[adc_oneshot]")
|
||||
//-------------ADC1 TEST Channel 0 Config---------------//
|
||||
adc_oneshot_chan_cfg_t config = {
|
||||
.bitwidth = ADC_BITWIDTH_DEFAULT,
|
||||
.atten = ADC_ATTEN_DB_11,
|
||||
.atten = ADC_ATTEN_DB_12,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_config_channel(adc1_handle, ADC1_TEST_CHAN0, &config));
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ TEST_CASE("ADC oneshot fast work with ISR", "[adc_oneshot]")
|
||||
//-------------ADC1 TEST Channel 0 Config---------------//
|
||||
adc_oneshot_chan_cfg_t config = {
|
||||
.bitwidth = ADC_BITWIDTH_DEFAULT,
|
||||
.atten = ADC_ATTEN_DB_11,
|
||||
.atten = ADC_ATTEN_DB_12,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_config_channel(isr_test_ctx.adc_handle, ADC1_TEST_CHAN0, &config));
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ TEST_CASE("ADC oneshot fast work with ISR and Flash", "[adc_oneshot]")
|
||||
//-------------ADC1 TEST Channel 0 Config---------------//
|
||||
adc_oneshot_chan_cfg_t config = {
|
||||
.bitwidth = ADC_BITWIDTH_DEFAULT,
|
||||
.atten = ADC_ATTEN_DB_11,
|
||||
.atten = ADC_ATTEN_DB_12,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_config_channel(oneshot_handle, ADC1_TEST_CHAN0, &config));
|
||||
|
||||
|
||||
@@ -270,29 +270,29 @@ TEST_CASE("ADC1 continuous raw average and std_deviation", "[adc_continuous][man
|
||||
|
||||
TEST_CASE("ADC1 continuous std deviation performance, no filter", "[adc_continuous][performance]")
|
||||
{
|
||||
float std = test_adc_continuous_std(ADC_ATTEN_DB_11, false, 0, true);
|
||||
float std = test_adc_continuous_std(ADC_ATTEN_DB_12, false, 0, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_NO_FILTER, "%.2f", std);
|
||||
}
|
||||
|
||||
#if SOC_ADC_DIG_IIR_FILTER_SUPPORTED
|
||||
TEST_CASE("ADC1 continuous std deviation performance, with filter", "[adc_continuous][performance]")
|
||||
{
|
||||
float std = test_adc_continuous_std(ADC_ATTEN_DB_11, false, 0, true);
|
||||
float std = test_adc_continuous_std(ADC_ATTEN_DB_12, false, 0, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_NO_FILTER, "%.2f", std);
|
||||
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_11, true, ADC_DIGI_IIR_FILTER_COEFF_2, true);
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_12, true, ADC_DIGI_IIR_FILTER_COEFF_2, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_FILTER_2, "%.2f", std);
|
||||
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_11, true, ADC_DIGI_IIR_FILTER_COEFF_4, true);
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_12, true, ADC_DIGI_IIR_FILTER_COEFF_4, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_FILTER_4, "%.2f", std);
|
||||
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_11, true, ADC_DIGI_IIR_FILTER_COEFF_8, true);
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_12, true, ADC_DIGI_IIR_FILTER_COEFF_8, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_FILTER_8, "%.2f", std);
|
||||
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_11, true, ADC_DIGI_IIR_FILTER_COEFF_16, true);
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_12, true, ADC_DIGI_IIR_FILTER_COEFF_16, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_FILTER_16, "%.2f", std);
|
||||
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_11, true, ADC_DIGI_IIR_FILTER_COEFF_64, true);
|
||||
std = test_adc_continuous_std(ADC_ATTEN_DB_12, true, ADC_DIGI_IIR_FILTER_COEFF_64, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_CONTINUOUS_STD_ATTEN3_FILTER_64, "%.2f", std);
|
||||
}
|
||||
#endif //#if SOC_ADC_DIG_IIR_FILTER_SUPPORTED
|
||||
@@ -376,7 +376,7 @@ TEST_CASE("ADC1 oneshot raw average and std_deviation", "[adc_oneshot][manual]")
|
||||
|
||||
TEST_CASE("ADC1 oneshot std_deviation performance", "[adc_oneshot][performance]")
|
||||
{
|
||||
float std = test_adc_oneshot_std(ADC_ATTEN_DB_11, true);
|
||||
float std = test_adc_oneshot_std(ADC_ATTEN_DB_12, true);
|
||||
TEST_PERFORMANCE_LESS_THAN(ADC_ONESHOT_STD_ATTEN3, "%.2f", std);
|
||||
}
|
||||
/*---------------------------------------------------------------
|
||||
|
||||
@@ -170,7 +170,7 @@ __attribute__((unused)) static void adc_work_with_wifi(adc_unit_t unit_id, adc_c
|
||||
//-------------ADC TEST Channel Config---------------//
|
||||
adc_oneshot_chan_cfg_t config = {
|
||||
.bitwidth = ADC_BITWIDTH_DEFAULT,
|
||||
.atten = ADC_ATTEN_DB_11,
|
||||
.atten = ADC_ATTEN_DB_12,
|
||||
};
|
||||
TEST_ESP_OK(adc_oneshot_config_channel(adc_handle, channel, &config));
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ __attribute__((unused)) static const char *TAG = "TEST_ADC";
|
||||
ADC Attenuation
|
||||
---------------------------------------------------------------*/
|
||||
#if CONFIG_IDF_TARGET_ESP32C2
|
||||
adc_atten_t g_test_atten[TEST_ATTEN_NUMS] = {ADC_ATTEN_DB_0, ADC_ATTEN_DB_11};
|
||||
adc_atten_t g_test_atten[TEST_ATTEN_NUMS] = {ADC_ATTEN_DB_0, ADC_ATTEN_DB_12};
|
||||
#else
|
||||
adc_atten_t g_test_atten[TEST_ATTEN_NUMS] = {ADC_ATTEN_DB_0, ADC_ATTEN_DB_2_5, ADC_ATTEN_DB_6, ADC_ATTEN_DB_11};
|
||||
adc_atten_t g_test_atten[TEST_ATTEN_NUMS] = {ADC_ATTEN_DB_0, ADC_ATTEN_DB_2_5, ADC_ATTEN_DB_6, ADC_ATTEN_DB_12};
|
||||
#endif
|
||||
|
||||
#if SOC_ADC_DIG_IIR_FILTER_SUPPORTED
|
||||
|
||||
Reference in New Issue
Block a user