RTEMS  5.1

The RTC driver provides the interface to configure and use the RTC peripheral.

It manages date, time, and alarms.
This timer is clocked by the 32kHz system clock, and is not impacted by power management settings (PMC). To be accurate, it is better to use an external 32kHz crystal instead of the internal 32kHz RC.
It uses BCD format, and time can be set in AM/PM or 24h mode through a configuration bit in the mode register.
To update date or time, the user has to follow these few steps :

An alarm can be set to happen on month, date, hours, minutes or seconds, by setting the proper "Enable" bit of each of these fields in the Time and Calendar registers. This allows a large number of configurations to be available for the user. Alarm occurrence can be detected even by polling or interrupt.

A check of the validity of the date and time format and values written by the user is automatically done. Errors are reported through the Valid Entry Register.

For more accurate information, please look at the RTC section of the Datasheet.

Related files :
rtc.c
rtc.h.