# RTC - [Overview](#section471241871165623) - [Summary](#section162759248165623) - [Files](#files) - [Data Structures](#nested-classes) - [Typedefs](#typedef-members) - [Enumerations](#enum-members) - [Functions](#func-members) - [Details](#section1063913536165623) - [Typedef](#section1614801129165623) - [RtcAlarmCallback](#gaf9932b7e647bce0503f1314bbe5eef8d) - [Enumeration Type](#section1322628777165623) - [RtcAlarmIndex](#gad7b3a575c848e2669db5e5b6f7e74330) - [Function](#section173008276165623) - [RtcAlarmInterruptEnable\(\)](#ga8b0f2951646ebd17313d905553bd8e0e) - [RtcClose\(\)](#ga395aa79ef260bfcd603ed56f9839d73b) - [RtcGetFreq\(\)](#ga766e2df8045177cd030e1133df4cba12) - [RtcOpen\(\)](#ga35004a866f23081ce2a446f1b0f88e32) - [RtcReadAlarm\(\)](#gabc4a137f0aed13e41da2db2dccc32b08) - [RtcReadReg\(\)](#gaec39316c639860a032f802628276d366) - [RtcReadTime\(\)](#gae8b242769eacd00b71eb1debce9be4de) - [RtcRegisterAlarmCallback\(\)](#ga0c42d787adde8d56a82b0c21624049d5) - [RtcReset\(\)](#ga7eb8a5ecf1058b9f90a133e2caa14573) - [RtcSetFreq\(\)](#ga17fdfb7ba3c876974cf9099aab092345) - [RtcWriteAlarm\(\)](#gaf4dd53c3e5b6c7a1766f6b15a77c96e9) - [RtcWriteReg\(\)](#gab8cc20f50b103acef06aa7887610be1c) - [RtcWriteTime\(\)](#ga7b6da87bfe9af2bcbfeebe9793876eb8) ## **Overview** **Description:** Provides standard real-time clock \(RTC\) APIs. These APIs allow you to perform operations such as reading or writing system time, reading or writing alarm time, setting alarm interrupts, registering alarm callbacks, setting the external frequency, resetting the RTC driver, and customizing RTC configurations. The RTC driver provides precise real time for the operating system \(OS\). If the OS is powered off, the RTC driver continues to keep track of the system time using an external battery. **Since:** 1.0 ## **Summary** ## Files
RtcAlarmCallback) (enum RtcAlarmIndex) |
Defines a callback that will be invoked when an alarm is generated at the specified time. |
RtcAlarmIndex { RTC_ALARM_INDEX_A = 0, RTC_ALARM_INDEX_B = 1 } |
RtcOpen (void) |
|
RtcReadTime (DevHandle handle, struct RtcTime *time) |
|
RtcWriteTime (DevHandle handle, const struct RtcTime *time) |
|
RtcReadAlarm (DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime *time) |
|
RtcWriteAlarm (DevHandle handle, enum RtcAlarmIndex alarmIndex, const struct RtcTime *time) |
|
RtcRegisterAlarmCallback (DevHandle handle, enum RtcAlarmIndex alarmIndex, RtcAlarmCallback cb) |
Registers RtcAlarmCallback that will be invoked when an alarm is generated at the specified time. |
RtcAlarmInterruptEnable (DevHandle handle, enum RtcAlarmIndex alarmIndex, uint8_t enable) |
|
RtcGetFreq (DevHandle handle, uint32_t *freq) |
|
RtcSetFreq (DevHandle handle, uint32_t freq) |
Sets the frequency of the external crystal oscillator connected to the RTC driver. |
RtcReadReg (DevHandle handle, uint8_t usrDefIndex, uint8_t *value) |
Reads the configuration of a custom RTC register based on the register index. |
RtcWriteReg (DevHandle handle, uint8_t usrDefIndex, uint8_t value) |
Writes the configuration of a custom RTC register based on the register index. |
| RTC_ALARM_INDEX_A | |
| RTC_ALARM_INDEX_B |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| alarmIndex | Indicates the RTC alarm index. For details, see RtcAlarmIndex. |
| enable | Specifies whether to enable RTC alarm interrupts. The value 1 means to enable alarm interrupts and value 0 means to disable alarm interrupts. |
| handle | Indicates the pointer to the RTC device handle to release, which is created via RtcGetHandle. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| freq | Indicates the pointer to the frequency of the external crystal oscillator, in Hz. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| alarmIndex | Indicates the RTC alarm index. For details, see RtcAlarmIndex. |
| time | Indicates the pointer to the RTC alarm time information. For details, see RtcTime. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| time | Indicates the pointer to the time information read from the RTC driver. For details, see RtcTime. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| alarmIndex | Indicates the RTC alarm index. For details, see RtcAlarmIndex. |
| cb | Indicates the callback to register. For details, see RtcAlarmCallback. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| freq | Indicates the frequency to set for the external crystal oscillator, in Hz. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| alarmIndex | Indicates the RTC alarm index. For details, see RtcAlarmIndex. |
| tm | Indicates the pointer to the RTC alarm time information. For details, see RtcTime. |
| handle | Indicates the pointer to the RTC device handle, which is obtained via RtcGetHandle. |
| time | Indicates the pointer to the time information to write. For details, see RtcTime. |