/* Get the PWM duty of the PWM module. 
The  */
unsigned long PWMDutyGet(unsigned long ulBase, unsigned long ulChannel)
/* Get the PWM duty of the PWM module. 
The  */
unsigned long PWMDutyGet(unsigned long ulBase, unsigned long ulChannel)
{
    unsigned long ulCMRData;
    unsigned long ulCNRData;
    xASSERT((ulBase == PWMA_BASE) || (ulBase == PWMB_BASE) ||
            (ulBase == PWMC_BASE));
    if(ulBase == PWMA_BASE)
    {
        xASSERT((ulChannel >= 0) && (ulChannel <= 5));
    }
    else
    {
        xASSERT((ulChannel >= 0) && (ulChannel <= 1));
    }
    ulCNRData = PWMMODGet(ulBase);
    ulCMRData = xHWREG(ulBase + TPM_C0V + ulChannel * 8);
    return ((ulCMRData + 1) * 100 / (ulCNRData + 1));
}