/* Select The Timer counter capture detect edge. 
The  */
void xTimerCaptureEdgeSelect(unsigned long ulBase, unsigned long ulChannel, unsigned long ulEdge)
/* Select The Timer counter capture detect edge. 
The  */
void xTimerCaptureEdgeSelect(unsigned long ulBase, unsigned long ulChannel, unsigned long ulEdge)
{
    xASSERT((ulBase == TIMER1_BASE) || (ulBase == TIMER0_BASE));
    xASSERT((ulEdge == xTIMER_CAP_RISING) || 
            (ulEdge == xTIMER_CAP_FALLING));
    xHWREG(ulBase + TIMER_CHPOLR) &= ~(1 << (ulChannel * 2));
    xHWREG(ulBase + TIMER_CHPOLR) |= ulEdge << (ulChannel * 2);
}