/* Configures external clock mode of the GPTM . Used CHx as the clock source. 
The  */
void TimerCHExtClkConfigure(unsigned long ulBase, unsigned long ulSelect, unsigned long ulPolarity, unsigned char ucFilter)
/* Configures external clock mode of the GPTM . Used CHx as the clock source. 
The  */
void TimerCHExtClkConfigure(unsigned long ulBase, unsigned long ulSelect, unsigned long ulPolarity, unsigned char ucFilter)
{
    xASSERT((ulBase == TIMER1_BASE) || (ulBase == TIMER0_BASE));
    xASSERT((ulSelect == TIMER_TRSEL_TI0BED) || (ulSelect == TIMER_TRSEL_TI0S0) ||
            (ulSelect == TIMER_TRSEL_TI1S1));
    xASSERT((ulPolarity == TIMER_CHP_NONINVERTED) || 
            (ulPolarity == TIMER_CHP_INVERTED));
    if(ulSelect == TIMER_TRSEL_TI1S1)
    {
        TimerChannelConfigure(ulBase, TIMER_CH_1, ulPolarity, TIMER_CHCCS_DIRECT,
                              ucFilter);  
    }
    else
    {
        TimerChannelConfigure(ulBase, TIMER_CH_0, ulPolarity, TIMER_CHCCS_DIRECT,
                              ucFilter);  
    }
    TimerSTIConfigure(ulBase, ulSelect);
    xHWREG(ulBase + TIMER_MDCFR) |= TIMER_MDCFR_SMSEL_STIED;
}