/* Config the ADC peripheral according to the specified parameters in the adcConfig.  */
void ADC_Config(ADC_T *adc, ADC_Config_T *adcConfig)
/* Config the ADC peripheral according to the specified parameters in the adcConfig.  */
void ADC_Config(ADC_T *adc, ADC_Config_T *adcConfig)
{
    adc->CTRL1_B.RESSEL = adcConfig->resolution;
    adc->CTRL1_B.SCANEN = adcConfig->scanConvMode;
    adc->CTRL2_B.REGEXTTRGEN = adcConfig->extTrigEdge;
    adc->CTRL2_B.REGEXTTRGSEL = adcConfig->extTrigConv;
    adc->CTRL2_B.DALIGNCFG = adcConfig->dataAlign;
    adc->CTRL2_B.CONTCEN = adcConfig->continuousConvMode;
    adc->REGSEQ1_B.REGSEQLEN = adcConfig->nbrOfChannel - 1;
}