/* Configure the compare data of an ADC digital comparator. 
This function will configure a comparator condition. When the internal counter reaches the value (CMPMATCNT+1), the CMPF bit will be set. */
void ADCCompConditionSet(unsigned long ulBase, unsigned long ulComp, unsigned long ulCompCondition)
/* Configure the compare data of an ADC digital comparator. 
This function will configure a comparator condition. When the internal counter reaches the value (CMPMATCNT+1), the CMPF bit will be set. */
void ADCCompConditionSet(unsigned long ulBase, unsigned long ulComp, unsigned long ulCompCondition)
{
    xASSERT(ulBase == ADC_BASE);
    xASSERT((ulComp >= 0) && (ulComp < 2));
    xHWREG(ulBase + ADC_CMPR0 + (4 * ulComp)) &= ~ADC_CMPR01_CMPCOND;
    xHWREG(ulBase + ADC_CMPR0 + (4 * ulComp)) |= ulCompCondition;
}