/* Configures for the selected ADC and its sampling time.  */
void ADC_ChannelConfig(ADC_TypeDef *ADCx, uint32_t ADC_Channel, uint32_t ADC_SampleTime)
/* Configures for the selected ADC and its sampling time.  */
void ADC_ChannelConfig(ADC_TypeDef *ADCx, uint32_t ADC_Channel, uint32_t ADC_SampleTime)
{
    uint32_t tmpreg = 0;
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_CHANNEL(ADC_Channel));
    assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime));
    ADCx->CHSELR |= (uint32_t)ADC_Channel;
    tmpreg &= ~ADC_SMPR1_SMPR;
    tmpreg |= (uint32_t)ADC_SampleTime;
    ADCx->SMPR = tmpreg ;
}