The RTC supports two types of interrupts:
- ALARM interrupt. This interrupt is generated when the configured date or time in the corresponding ALARM registers is reached. This interrupt is enabled and disabled by setting the IT_ALARM bit. It is important to set the IT_ALARM = 0 to disable the alarm interrupt prior to configuring the ALARM registers to prevent the interrupt from mis-firing.
- TIMER interrupt. This interrupt is generated when
the periodic time (day, hour, minute, second) set in the EVERY bits of the
RTC_INTERRUPTS register is reached. The first of the periodic interrupt
occurs when the RTC counter reaches the next day, hour, minute, or second
counter value. For example, if a timer interrupt is set for every hour at
2:59 AM, the first interrupt occurs at 3:00 AM instead of 3:59 AM. This
interrupt is enabled and disabled by setting the IT_TIMER bit. It is
important to set the IT_TIMER = 0 to disable the timer interrupt prior to
configuring the periodic time value to prevent the interrupt from
mis-firing.
Both types of the RTC interrupts can be used to
wake-up the device from the STANDBY state or the LP_STANDBY state when they are not
masked.