/* Configure RTC interrupt mode. This function can be used to enable/disable rtc time/alarm interrupt.  */
void RTCIntCfg(unsigned long ulCfg)
/* Configure RTC interrupt mode. This function can be used to enable/disable rtc time/alarm interrupt.  */
void RTCIntCfg(unsigned long ulCfg)
{
    unsigned long ulTmpReg = 0;
    xASSERT(ulCfg != 0);
    if(ulCfg & 0x0000FFFF)
    {
        ulTmpReg = xHWREG(RTC_BASE + RTC_CIIR);
        ulTmpReg &= ~((ulCfg >> 8) & 0xFF);
        ulTmpReg |=  ((ulCfg >> 0) & 0xFF);
        xHWREG(RTC_BASE + RTC_CIIR) = ulTmpReg;
    }
    if(ulCfg & 0xFFFF0000)
    {
        ulTmpReg = xHWREG(RTC_BASE + RTC_AMR);
        ulTmpReg &= ~((ulCfg >> 24) & 0xFF);
        ulTmpReg |=  ((ulCfg >> 16) & 0xFF);
        xHWREG(RTC_BASE + RTC_AMR) = ulTmpReg;
    }
}