@@ -841,7 +841,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
841
841
AdcHandle.Init .NbrOfConversion = 1 ; /* Specifies the number of ranks that will be converted within the regular group sequencer. */
842
842
#endif
843
843
AdcHandle.Init .DiscontinuousConvMode = DISABLE; /* Parameter discarded because sequencer is disabled */
844
- #if !defined(STM32F0xx) && !defined(STM32G0xx) && !defined(STM32L0xx)
844
+ #if !defined(STM32F0xx) && !defined(STM32G0xx) && !defined(STM32L0xx) && \
845
+ !defined (STM32WLxx)
845
846
AdcHandle.Init .NbrOfDiscConversion = 0 ; /* Parameter discarded because sequencer is disabled */
846
847
#endif
847
848
AdcHandle.Init .ExternalTrigConv = ADC_SOFTWARE_START; /* Software start to trig the 1st conversion manually, without external event */
@@ -923,14 +924,15 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
923
924
#endif
924
925
#if !defined(STM32F0xx) && !defined(STM32F1xx) && !defined(STM32F2xx) && \
925
926
!defined (STM32F4xx) && !defined (STM32F7xx) && !defined (STM32G0xx) && \
926
- !defined (STM32L0xx) && !defined (STM32L1xx) && \
927
+ !defined (STM32L0xx) && !defined (STM32L1xx) && ! defined (STM32WLxx) && \
927
928
!defined (STM32F373xC) && !defined (STM32F378xx)
928
929
AdcChannelConf.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
929
930
AdcChannelConf.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
930
931
#endif
931
932
#if !defined(STM32F0xx) && !defined(STM32F1xx) && !defined(STM32F2xx) && \
932
933
!defined (STM32G0xx) && !defined (STM32L0xx) && !defined (STM32L1xx) && \
933
- !defined (STM32WBxx) && !defined (STM32F373xC) && !defined (STM32F378xx)
934
+ !defined (STM32WBxx) && !defined (STM32WLxx) && \
935
+ !defined (STM32F373xC) && !defined (STM32F378xx)
934
936
AdcChannelConf.Offset = 0 ; /* Parameter discarded because offset correction is disabled */
935
937
#endif
936
938
#if defined (STM32H7xx) || defined(STM32MP1xx)
@@ -947,10 +949,10 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
947
949
#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || \
948
950
defined (STM32G0xx) || defined (STM32G4xx) || defined (STM32H7xx) || \
949
951
defined (STM32L0xx) || defined (STM32L4xx) || defined (STM32MP1xx) || \
950
- defined (STM32WBxx)
952
+ defined (STM32WBxx) || defined (STM32WLxx)
951
953
/* ##-2.1- Calibrate ADC then Start the conversion process ####################*/
952
954
#if defined(STM32F0xx) || defined(STM32G0xx) || defined(STM32F1xx) || \
953
- defined (STM32F373xC) || defined (STM32F378xx)
955
+ defined (STM32WLxx) || defined ( STM32F373xC) || defined (STM32F378xx)
954
956
if (HAL_ADCEx_Calibration_Start (&AdcHandle) != HAL_OK)
955
957
#elif defined (STM32H7xx) || defined(STM32MP1xx)
956
958
if (HAL_ADCEx_Calibration_Start (&AdcHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
0 commit comments