drivers: adc: driver setting the oversampling for stm32wl

RM 0453: the sw is allowed to write the Oversampling
ratio or shift of the ADC Config.Reg.2 only when ADSTART = 0
(no conversion is on-going). So disabling it will be stopped.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2021-12-21 16:08:36 +01:00 committed by Christopher Friedt
parent c918c4f1d9
commit e9b9e4c6ad

View file

@ -516,7 +516,8 @@ static int start_read(const struct device *dev,
LL_ADC_SetResolution(adc, resolution);
#endif
#ifdef CONFIG_SOC_SERIES_STM32L0X
#if defined(CONFIG_SOC_SERIES_STM32L0X) || \
defined(CONFIG_SOC_SERIES_STM32WLX)
/*
* setting OVS bits is conditioned to ADC state: ADC must be disabled
* or enabled without conversion on going : disable it, it will stop