drivers: adc: esp32: adc2 init code calibration

Add call to adc2_init_code_calibration during adc initialization on esp32s2
and esp32c3

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
This commit is contained in:
Marcio Ribeiro 2024-09-26 17:22:55 -03:00 committed by Alberto Escolar
parent e7e7386352
commit b7a4bb3ef9
1 changed files with 6 additions and 0 deletions

View File

@ -654,6 +654,12 @@ static int adc_esp32_init(const struct device *dev)
adc_hw_calibration(conf->unit);
#if CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3
if (conf->unit == ADC_UNIT_2) {
adc2_init_code_calibration();
}
#endif /* CONFIG_SOC_SERIES_ESP32S2 || CONFIG_SOC_SERIES_ESP32C3 */
#if defined(CONFIG_ADC_ESP32_DMA)
if (!device_is_ready(conf->gpio_port)) {
LOG_ERR("gpio0 port not ready");