/* Get timer capture value. This function is used to get capture time value.  */
unsigned long TimerCapValueGet(unsigned long ulBase, unsigned long ulChs)
/* Get timer capture value. This function is used to get capture time value.  */
unsigned long TimerCapValueGet(unsigned long ulBase, unsigned long ulChs)
{
    xASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
            (ulBase == TIMER2_BASE) || (ulBase == TIMER3_BASE) );
    xASSERT( (ulChs & ~( TIMER_CAP_CH_0 | TIMER_CAP_CH_1 )) == 0 );
    switch(ulChs)
    {
        case TIMER_CAP_CH_0:
            {
                return xHWREG(ulBase + TIMER_CR0);
            }
        case TIMER_CAP_CH_1:
            {
                return xHWREG(ulBase + TIMER_CR1);
            }
        default:
            {
                while(1);
            }
    }
}