/* Get the PWM interrupt flag of the PWM module. 
The  */
xtBoolean PWMIntFlagGet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntType)
/* Get the PWM interrupt flag of the PWM module. 
The  */
xtBoolean PWMIntFlagGet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntType)
{
    unsigned long ulChannelTemp;
    ulChannelTemp = (ulBase == PWMA_BASE) ? ulChannel : (ulChannel - 4);
    xASSERT(ulBase == PWMA_BASE);
    xASSERT(((ulChannelTemp >= 0) || (ulChannelTemp <= 3)));
    if (ulIntType == PWM_INT_PWM)
    {
        return ((xHWREG(ulBase + PWM_PIIR) & (PWM_PIIR_PWMIF0 << ulChannelTemp))
                ? xtrue : xfalse);
    }
    else if (ulIntType == PWM_INT_DUTY)
    {
        return ((xHWREG(ulBase + PWM_PIIR) & (PWM_PIIR_PWMDIF0 << ulChannelTemp))
                ? xtrue : xfalse);
    }
    else
    {
        return ((xHWREG(ulBase + PWM_CCR0 + (ulChannelTemp << 1)) & 
        (PWM_CCR0_CAPIF0 << ((ulChannel % 2) ? 16 : 0))) ? xtrue : xfalse);
    }
}