1 Star 0 Fork 5.3K

royomon / OpenHarmonyDocs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rtc-overview.md 8.23 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

RTC Overview

Introduction

The real-time clock (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.

Available APIs

Table 1 APIs provided by the RTC driver

Capability

Function

Description

RTC handle

RtcOpen

Opens the RTC device to obtain its handle.

RtcClose

Releases a specified handle of the RTC device.

RTC time

RtcReadTime

Reads time information from the RTC driver, including the year, month, the day of the week, day, hour, minute, second, and millisecond.

RtcWriteTime

Writes time information from the RTC driver, including the year, month, the day of the week, day, hour, minute, second, and millisecond.

RTC alarm

RtcReadAlarm

Reads the RTC alarm time that was set last time.

RtcWriteAlarm

Writes the RTC alarm time based on the alarm index.

RtcRegisterAlarmCallback

Registers RtcAlarmCallback that will be invoked when an alarm is generated at the specified time.

RtcAlarmInterruptEnable

Enables or disables RTC alarm interrupts.

RTC configuration

RtcGetFreq

Reads the frequency of the external crystal oscillator connected to the RTC driver.

RtcSetFreq

Sets the frequency of the external crystal oscillator connected to the RTC driver.

RtcReset

Resets the RTC.

Custom register

RtcReadReg

Reads the configuration of a custom RTC register based on the register index.

RtcWriteReg

Writes the configuration of a custom RTC register based on the register index.

NOTE: All functions provided in this document can be called only in kernel mode.

1
https://gitee.com/eastwellext/OpenHarmonyDocs.git
git@gitee.com:eastwellext/OpenHarmonyDocs.git
eastwellext
OpenHarmonyDocs
OpenHarmonyDocs
master

搜索帮助