/* Selects the input trigger to use for starting the counter and/or reloading the counter.  */
void PWMTriggerSelect(unsigned long ulBase, unsigned long ulTrigger)
/* Selects the input trigger to use for starting the counter and/or reloading the counter.  */
void PWMTriggerSelect(unsigned long ulBase, unsigned long ulTrigger)
{
    xASSERT((ulBase == PWMA_BASE) || (ulBase == PWMB_BASE) || 
            (ulBase == PWMC_BASE));
    xASSERT((ulTrigger == PWM_TRGSEL_EXTRGIN) || 
            (ulTrigger == PWM_TRGSEL_HSCMP0) ||
            (ulTrigger == PWM_TRGSEL_PITRG0) || 
            (ulTrigger == PWM_TRGSEL_PITRG1) ||
            (ulTrigger == PWM_TRGSEL_TPM0OF) ||
            (ulTrigger == PWM_TRGSEL_TPM1OF) ||
            (ulTrigger == PWM_TRGSEL_TPM2OF) ||
            (ulTrigger == PWM_TRGSEL_RTCALARM) ||
            (ulTrigger == PWM_TRGSEL_RTCSECONDS) ||
            (ulTrigger == PWM_TRGSEL_LPTMR)); 
    xHWREG(ulBase + TPM_CONF) &= ~TPM_CONF_TRGSEL_M;
    xHWREG(ulBase + TPM_CONF) |= ulTrigger;
}