/* Configures polarity of the Timer channel x. 
The  */
void TimerCHPolarityConfigure(unsigned long ulBase, unsigned long ulChannel, unsigned long ulPolarity)
/* Configures polarity of the Timer channel x. 
The  */
void TimerCHPolarityConfigure(unsigned long ulBase, unsigned long ulChannel, unsigned long ulPolarity)
{
    xASSERT((ulBase == TIMER1_BASE) || (ulBase == TIMER0_BASE));
    xASSERT((ulChannel == TIMER_CH_0) || (ulChannel == TIMER_CH_1) ||
            (ulChannel == TIMER_CH_2) || (ulChannel == TIMER_CH_3)); 
    xASSERT((ulPolarity == TIMER_CHP_NONINVERTED) || 
            (ulPolarity == TIMER_CHP_INVERTED));
    xHWREG(ulBase + TIMER_CHPOLR) &= ~(1 << (ulChannel * 2) );
    xHWREG(ulBase + TIMER_CHPOLR) |= ulPolarity << (ulChannel * 2);
}