CoX Peripheral Interface V2.1
API Reference
RTC

Real-time Clock(RTC) Peripheral Driver. More...

Collaboration diagram for RTC:

Modules

 xRTC
 

CoX RTC Peripheral Interface.



Detailed Description

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.


Contents


1. RTC Physical Block

RTC_block.png


2. RTC Functional Description


2.1 RTC initialization

This function can enable or disable RTC to work.


2.2 RTC time write and read

We can write time to or read time from RTC TLR and CLR registers or TAR and CAR registers.


2.3 RTC interrupt

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).


3. RTC Applications

RTC can be used to display time and alarm.


Note:
Here descripte the common function of the RTC Peripheral. The CoX Peripheral Interface is base on the functions above.