Real-time Clock(RTC) Peripheral Driver. More...
|
Modules | |
| xRTC | |
CoX RTC Peripheral Interface. | |
Real-time Clock(RTC) Peripheral Driver.
Real Time Clock (RTC) controller provides users with the real time and calendar messages. The RTC controller provides the time messages (second, minute, hour) in Time Loading Register (TLR) as well as calendar messages (day, month, year) in Calendar Loading Register (CLR). It also offers an alarm function so that users can preset alarm time in Time Alarm Register (TAR) and alarm calendar in Calendar Alarm Register (CAR).
The RTC controller supports periodic Time Tick and Alarm Match interrupts.
This function can enable or disable RTC to work.
We can write time to or read time from RTC TLR and CLR registers or TAR and CAR registers.
RTC has two interrupts.
When periodic time tick interrupt is enabled by setting RIER.TIER to 1, the Periodic Time Tick Interrupt is requested periodically in the period selected by TTR register.
When RTC counter in TLR and CLR is equal to alarm setting time TAR and CAR£¬ the alarm interrupt flag (RIIR.AIF) is set and the alarm interrupt is requested if the alarm interrupt is enabled (RIER.AIER=1).
RTC can be used to display time and alarm.