/* Configure The Timer as a counter and configurate mode and Boundary. 
The  */
void TimerCounterInitConfig(unsigned long ulBase, unsigned long ulConfig, unsigned long ulCounterBound)
/* Configure The Timer as a counter and configurate mode and Boundary. 
The  */
void TimerCounterInitConfig(unsigned long ulBase, unsigned long ulConfig, unsigned long ulCounterBound)
{
    xASSERT((ulBase == TIMER1_BASE) || (ulBase == TIMER0_BASE));
    xASSERT(((ulConfig & 0xE7000000) == TIMER_MODE_ONESHOT) || 
            ((ulConfig & 0xE7000000) == TIMER_MODE_PERIODIC) ||
            ((ulConfig & 0xE7000000) == TIMER_MODE_TOGGLE) ||
            ((ulConfig & 0xE7000000) == TIMER_MODE_CONTINUOUS));
    xASSERT((ulCounterBound > 1) && (ulCounterBound < 1000000));
    xHWREG(ulBase + TIMER_O_TCSR) &= ~TIMER_TCSR_CEN;
    xHWREG(ulBase + TIMER_O_TISR) |= TIMER_TISR_TIF;
    xHWREG(ulBase + TIMER_O_TCMPR) = ulCounterBound;
    xHWREG(ulBase + TIMER_O_TCSR) |= ulConfig | TIMER_TCSR_CTDR_EN; 
}