27.5.3 Alarm
The RTC has five programmable fields: month, date, hours, minutes and seconds.
Each of these fields can be enabled or disabled to match the alarm condition:
- If all the fields are enabled, an alarm flag is generated (the corresponding flag is asserted and an interrupt generated if enabled) at a given month, date, hour/minute/second.
- If only the “seconds” field is enabled, then an alarm is generated every minute.
Depending on the combination of fields enabled, a large number of possibilities are available to the user ranging from minutes to 365/366 days.
Hour, minute and second matching alarms (SECEN, MINEN, HOUREN) can be enabled independently of SEC, MIN, HOUR fields.
Note: To change one of the SEC, MIN, HOUR, DATE, MONTH fields, it is recommended to disable
the field before changing the value and then re-enable it after the change has been made.
This requires up to three accesses to the RTC_TIMALR or RTC_CALALR. The first access clears
the enable corresponding to the field to change (SECEN, MINEN, HOUREN, DATEEN, MTHEN). If
the field is already cleared, this access is not required. The second access performs the
change of the value (SEC, MIN, HOUR, DATE, MONTH). The third access is required to
re-enable the field by writing 1 in SECEN, MINEN, HOUREn, DATEEN, MTHEN fields.