/* Stop the on going conversions for the selected ADC.  */
void ADC_StopOfConversion(ADC_TypeDef *ADCx)
/* Stop the on going conversions for the selected ADC.  */
void ADC_StopOfConversion(ADC_TypeDef *ADCx)
{
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    if ((ADCx->CR & (uint32_t)0x01) == (uint32_t)0x01)
        ADCx->CR |= (uint32_t)ADC_CR_ADSTP;
    else
    {
        ADCx->CR |= (uint32_t)ADC_CR_ADEN;
        while ((ADCx->ISR & ADC_FLAG_ADRDY) != (uint32_t)RESET);
        ADCx->CR |= (uint32_t)ADC_CR_ADSTP;
        ADCx->CR &= (uint32_t)(~ADC_CR_ADEN);
    }
}