/* Returns the last ADCx conversion result data for regular channel.  */
uint16_t ADC_GetConversionValue(ADC_TypeDef *ADCx)
/* Returns the last ADCx conversion result data for regular channel.  */
uint16_t ADC_GetConversionValue(ADC_TypeDef *ADCx)
{
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    if(((ADCx->ADCFG&0x000000380)>>7)==0)
        return (uint16_t) ADCx->ADDATA;
    else if(((ADCx->ADCFG&0x000000380)>>7)==1)
        return (uint16_t) (ADCx->ADDATA>>1);
    else if(((ADCx->ADCFG&0x000000380)>>7)==2)
        return (uint16_t) (ADCx->ADDATA>>2);
    else if(((ADCx->ADCFG&0x000000380)>>7)==3)
        return (uint16_t) (ADCx->ADDATA>>3);
    else if(((ADCx->ADCFG&0x000000380)>>7)==4)
        return (uint16_t) (ADCx->ADDATA>>4);
    return (uint16_t) ADCx->ADDATA;
}