/*---------------------------------------------------------------------------------------------------------*/
/* EADC function test */
/*---------------------------------------------------------------------------------------------------------*/
void EADC_FunctionTest()
{
/* Set the ADC internal sampling time, input mode as single-end and enable the A/D converter */
EADC_Open(EADC, EADC_CTL_DIFFEN_SINGLE_END);
EADC_SetInternalSampleTime(EADC, 6);
/* Configure the sample 4 module for analog input channel 0 and enable ADINT0 trigger source */
EADC_ConfigSampleModule(EADC, 4, EADC_ADINT0_TRIGGER, 0);
/* Configure the sample 5 module for analog input channel 1 and enable ADINT0 trigger source */
EADC_ConfigSampleModule(EADC, 5, EADC_ADINT0_TRIGGER, 1);
/* Configure the sample 6 module for analog input channel 2 and enable ADINT0 trigger source */
EADC_ConfigSampleModule(EADC, 6, EADC_ADINT0_TRIGGER, 2);
/* Configure the sample 7 module for analog input channel 3 and enable ADINT0 trigger source */
EADC_ConfigSampleModule(EADC, 7, EADC_ADINT0_TRIGGER, 3);
/* Clear the A/D ADINT0 interrupt flag for safe */
EADC_CLR_INT_FLAG(EADC, 0x1);