drivers: adc: stm32 adc API has a valid internal reference

extend the stm32 adc api to set the ref_internal of 3.3V

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2022-03-15 16:21:31 +01:00 committed by Carles Cufí
commit 29d0660585

View file

@ -40,6 +40,9 @@ LOG_MODULE_REGISTER(adc_stm32);
#endif
#endif
/* reference voltage for the ADC */
#define STM32_ADC_VREF_MV DT_INST_PROP(0, vref_mv)
#if !defined(CONFIG_SOC_SERIES_STM32F0X) && \
!defined(CONFIG_SOC_SERIES_STM32G0X) && \
!defined(CONFIG_SOC_SERIES_STM32L0X) && \
@ -1079,6 +1082,7 @@ static const struct adc_driver_api api_stm32_driver_api = {
#ifdef CONFIG_ADC_ASYNC
.read_async = adc_stm32_read_async,
#endif
.ref_internal = STM32_ADC_VREF_MV, /* VREF is usually connected to VDD */
};
#ifdef CONFIG_ADC_STM32_SHARED_IRQS