rtc_if.h

Overview

Related Modules:

RTC

Description:

Declares the standard RTC APIs.

Since:

1.0

Summary

Data Structures

Data Structure Name Description
RtcTime Defines the RTC information.

Typedefs

Typedef Name Description
RtcAlarmCallback) (enum RtcAlarmIndex) typedef int32_t(* Defines a callback that will be invoked when an alarm is generated at the specified time.

Enumerations

Enumeration Name Description
RtcAlarmIndex { RTC_ALARM_INDEX_A = 0, RTC_ALARM_INDEX_B = 1 } Enumerates alarm indexes.

Functions

Function Name Description
RtcOpen (void) struct DevHandle Opens the RTC device to obtain its handle.
RtcClose (struct DevHandle handle) void Releases a specified handle of the RTC device.
RtcReadTime (struct DevHandle handle, struct RtcTime time) int32_t Reads time from the RTC driver.
RtcWriteTime (struct DevHandle handle, const struct RtcTime time) int32_t Writes format-compliant time to the RTC driver.
RtcReadAlarm (struct DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime time) int32_t Reads the RTC alarm time that was set last time.
RtcWriteAlarm (struct DevHandle handle, enum RtcAlarmIndex alarmIndex, const struct RtcTime time) int32_t Writes the RTC alarm time based on the alarm index.
RtcRegisterAlarmCallback (struct DevHandle handle, enum RtcAlarmIndex alarmIndex, RtcAlarmCallback cb) int32_t Registers RtcAlarmCallback that will be invoked when an alarm is generated at the specified time.
RtcAlarmInterruptEnable (struct DevHandle handle, enum RtcAlarmIndex alarmIndex, uint8_t enable) int32_t Enables or disables alarm interrupts.
RtcGetFreq (struct DevHandle handle, uint32_t freq) int32_t Reads the RTC external frequency.
RtcSetFreq (struct DevHandle handle, uint32_t freq) int32_t Sets the frequency of the external crystal oscillator connected to the RTC driver.
RtcReset (struct DevHandle handle) int32_t Resets the RTC driver.
RtcReadReg (struct DevHandle handle, uint8_t usrDefIndex, uint8_t value) int32_t Reads the configuration of a custom RTC register based on the register index.
RtcWriteReg (struct DevHandle *handle, uint8_t usrDefIndex, uint8_t value) int32_t Writes the configuration of a custom RTC register based on the register index.