/* Config the ADC peripheral according to the specified parameters in the adcConfig.  */
void ADC_Config(ADC_Config_T *adcConfig)
/* Config the ADC peripheral according to the specified parameters in the adcConfig.  */
void ADC_Config(ADC_Config_T *adcConfig)
{
    ADC->CFG1_B.DATARESCFG = adcConfig->resolution;
    ADC->CFG1_B.DALIGCFG   = adcConfig->dataAlign;
    ADC->CFG1_B.SCANSEQDIR = adcConfig->scanDir;
    ADC->CFG1_B.CMODESEL   = adcConfig->convMode;
    ADC->CFG1_B.EXTPOLSEL  = adcConfig->extTrigEdge;
    ADC->CFG1_B.EXTTRGSEL  = adcConfig->extTrigConv;
}