@@ -841,7 +841,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
841841 AdcHandle.Init .NbrOfConversion = 1 ; /* Specifies the number of ranks that will be converted within the regular group sequencer. */
842842#endif
843843 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)
845846 AdcHandle.Init .NbrOfDiscConversion = 0 ; /* Parameter discarded because sequencer is disabled */
846847#endif
847848 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)
923924#endif
924925#if !defined(STM32F0xx) && !defined(STM32F1xx) && !defined(STM32F2xx) && \
925926 !defined (STM32F4xx) && !defined (STM32F7xx) && !defined (STM32G0xx) && \
926- !defined (STM32L0xx) && !defined (STM32L1xx) && \
927+ !defined (STM32L0xx) && !defined (STM32L1xx) && ! defined (STM32WLxx) && \
927928 !defined (STM32F373xC) && !defined (STM32F378xx)
928929 AdcChannelConf.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
929930 AdcChannelConf.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
930931#endif
931932#if !defined(STM32F0xx) && !defined(STM32F1xx) && !defined(STM32F2xx) && \
932933 !defined (STM32G0xx) && !defined (STM32L0xx) && !defined (STM32L1xx) && \
933- !defined (STM32WBxx) && !defined (STM32F373xC) && !defined (STM32F378xx)
934+ !defined (STM32WBxx) && !defined (STM32WLxx) && \
935+ !defined (STM32F373xC) && !defined (STM32F378xx)
934936 AdcChannelConf.Offset = 0 ; /* Parameter discarded because offset correction is disabled */
935937#endif
936938#if defined (STM32H7xx) || defined(STM32MP1xx)
@@ -947,10 +949,10 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
947949#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || \
948950 defined (STM32G0xx) || defined (STM32G4xx) || defined (STM32H7xx) || \
949951 defined (STM32L0xx) || defined (STM32L4xx) || defined (STM32MP1xx) || \
950- defined (STM32WBxx)
952+ defined (STM32WBxx) || defined (STM32WLxx)
951953 /* ##-2.1- Calibrate ADC then Start the conversion process ####################*/
952954#if defined(STM32F0xx) || defined(STM32G0xx) || defined(STM32F1xx) || \
953- defined (STM32F373xC) || defined (STM32F378xx)
955+ defined (STM32WLxx) || defined ( STM32F373xC) || defined (STM32F378xx)
954956 if (HAL_ADCEx_Calibration_Start (&AdcHandle) != HAL_OK)
955957#elif defined (STM32H7xx) || defined(STM32MP1xx)
956958 if (HAL_ADCEx_Calibration_Start (&AdcHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
0 commit comments