/* Deinitializes the ADCx peripheral registers to their default reset values.  */
void ADC_DeInit(ADC_TypeDef *ADCx)
/* Deinitializes the ADCx peripheral registers to their default reset values.  */
void ADC_DeInit(ADC_TypeDef *ADCx)
{
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    switch (*(uint32_t*)&ADCx)
    {
    case ADC1_BASE:
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, ENABLE);
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, DISABLE);
        break;
    case ADC2_BASE:
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, ENABLE);
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, DISABLE);
        break;
    default:
        break;
    }
}