@@ -191,6 +191,7 @@ uint32_t get_adc_channel(PinName pin, uint32_t *bank)
191
191
case 22 :
192
192
channel = ADC_CHANNEL_22;
193
193
break ;
194
+ #ifdef ADC_CHANNEL_23
194
195
case 23 :
195
196
channel = ADC_CHANNEL_23;
196
197
break ;
@@ -222,6 +223,7 @@ uint32_t get_adc_channel(PinName pin, uint32_t *bank)
222
223
break ;
223
224
#endif
224
225
#endif
226
+ #endif
225
227
#endif
226
228
default :
227
229
_Error_Handler (" ADC: Unknown adc channel" , (int )(STM_PIN_CHANNEL (function)));
@@ -873,8 +875,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
873
875
AdcHandle.Init .NbrOfConversion = 1 ; /* Specifies the number of ranks that will be converted within the regular group sequencer. */
874
876
#endif
875
877
AdcHandle.Init .DiscontinuousConvMode = DISABLE; /* Parameter discarded because sequencer is disabled */
876
- #if !defined(STM32F0xx ) && !defined(STM32G0xx ) && !defined(STM32L0xx ) && \
877
- !defined (STM32WLxx) && !defined (ADC_SUPPORT_2_5_MSPS)
878
+ #if !defined(STM32C0xx ) && !defined(STM32F0xx ) && !defined(STM32G0xx ) && \
879
+ !defined (STM32L0xx) && ! defined ( STM32WLxx) && !defined (ADC_SUPPORT_2_5_MSPS)
878
880
AdcHandle.Init .NbrOfDiscConversion = 0 ; /* Parameter discarded because sequencer is disabled */
879
881
#endif
880
882
AdcHandle.Init .ExternalTrigConv = ADC_SOFTWARE_START; /* Software start to trig the 1st conversion manually, without external event */
@@ -898,8 +900,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
898
900
#if defined(STM32F0xx)
899
901
AdcHandle.Init .SamplingTimeCommon = samplingTime;
900
902
#endif
901
- #if defined(STM32G0xx ) || defined(STM32U5xx ) || defined(STM32WLxx ) || \
902
- defined (ADC_SUPPORT_2_5_MSPS)
903
+ #if defined(STM32C0xx ) || defined(STM32G0xx ) || defined(STM32U5xx ) || \
904
+ defined (STM32WLxx) || defined ( ADC_SUPPORT_2_5_MSPS)
903
905
AdcHandle.Init .SamplingTimeCommon1 = samplingTime; /* Set sampling time common to a group of channels. */
904
906
AdcHandle.Init .SamplingTimeCommon2 = samplingTime; /* Set sampling time common to a group of channels, second common setting possible.*/
905
907
#endif
@@ -961,9 +963,9 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
961
963
AdcChannelConf.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
962
964
AdcChannelConf.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
963
965
#endif
964
- #if !defined(STM32F0xx ) && !defined(STM32F1xx ) && !defined(STM32F2xx ) && \
965
- !defined (STM32G0xx ) && !defined (STM32L0xx ) && !defined (STM32L1xx ) && \
966
- !defined (STM32WBxx) && !defined (STM32WLxx) && \
966
+ #if !defined(STM32C0xx ) && !defined(STM32F0xx ) && !defined(STM32F1xx ) && \
967
+ !defined (STM32F2xx ) && !defined (STM32G0xx ) && !defined (STM32L0xx ) && \
968
+ !defined (STM32L1xx) && ! defined ( STM32WBxx) && !defined (STM32WLxx) && \
967
969
!defined (ADC1_V2_5)
968
970
AdcChannelConf.Offset = 0 ; /* Parameter discarded because offset correction is disabled */
969
971
#endif
0 commit comments