1 Star 0 Fork 4.9K

平凡 / docs

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

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.

1
https://gitee.com/pingfan_vs_hs/docs.git
git@gitee.com:pingfan_vs_hs/docs.git
pingfan_vs_hs
docs
docs
master

搜索帮助