Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
645f39e0
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
645f39e0
编写于
2月 23, 2022
作者:
A
annie_wangli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
annie_wangli
<
annie.wangli@huawei.com
>
上级
8b8c1e0a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
35 deletion
+26
-35
en/device-dev/driver/driver-platform-rtc-des.md
en/device-dev/driver/driver-platform-rtc-des.md
+0
-11
en/device-dev/driver/driver-platform-rtc-develop.md
en/device-dev/driver/driver-platform-rtc-develop.md
+26
-24
未找到文件。
en/device-dev/driver/driver-platform-rtc-des.md
浏览文件 @
645f39e0
# RTC<a name="EN-US_TOPIC_0000001206373007"></a>
-
[
Overview
](
#section104842041574
)
-
[
Available APIs
](
#section20331159102519
)
-
[
Usage Guidelines
](
#section20636145604113
)
-
[
How to Use
](
#section16919828134215
)
-
[
Creating an RTC Device Handle
](
#section1131212144310
)
-
[
Releasing the RTC Device Handle
](
#section10744117144314
)
-
[
Registering RtcAlarmCallback
](
#section14839440184320
)
-
[
Performing RTC-related Operations
](
#section161927578433
)
-
[
Usage Example
](
#section1186111020456
)
## Overview<a name="section104842041574"></a>
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.
...
...
en/device-dev/driver/driver-platform-rtc-develop.md
浏览文件 @
645f39e0
...
...
@@ -13,31 +13,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the real-time clock \(RTC\)
**Figure 1**
Independent service mode
<a
name=
"fig6742142611299"
></a>
![](
figures/independent-service-mode.png
"independent-service-mode-11"
)
## How to Develop<a name="section1784450860142407"></a>
The RTC module adaptation involves the following steps:
1.
Instantiate the driver entry.
-
Instantiate the
**HdfDriverEntry**
structure.
-
Call
**HDF\_INIT**
to register the
**HdfDriverEntry**
instance with the HDF framework.
2.
Configure attribute files.
-
Add the
**deviceNode**
information to the
**device\_info.hcs**
file.
-
\(
Optional
\)
Add the
**rtc\_config.hcs**
file.
3.
Instantiate the RTC controller object.
-
Initialize
**RtcHost**
.
-
Instantiate
**RtcMethod**
in the
**RtcHost**
object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [RtcMethod](#section13652132473017) and [Table 1](#table12929217311).
## Available APIs<a name="section752964871810"></a>
4.
Debug the driver.
-
\(
Optional
\)
For new drivers, verify the basic functions, such as the RTC control status and response to interrupts.
### RtcMethod<a name="section13652132473017"></a>
RtcMethod
```
struct RtcMethod {
...
...
@@ -206,6 +184,30 @@ struct RtcMethod {
</tbody>
</table>
## How to Develop<a name="section1784450860142407"></a>
The RTC module adaptation involves the following steps:
1.
Instantiate the driver entry.
-
Instantiate the
**HdfDriverEntry**
structure.
-
Call
**HDF\_INIT**
to register the
**HdfDriverEntry**
instance with the HDF framework.
2.
Configure attribute files.
-
Add the
**deviceNode**
information to the
**device\_info.hcs**
file.
-
\(
Optional
\)
Add the
**rtc\_config.hcs**
file.
3.
Instantiate the RTC controller object.
-
Initialize
**RtcHost**
.
-
Instantiate
**RtcMethod**
in the
**RtcHost**
object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [RtcMethod](#section13652132473017) and [Table 1](#table12929217311).
4.
Debug the driver.
-
\(
Optional
\)
For new drivers, verify the basic functions, such as the RTC control status and response to interrupts.
## Development Example<a name="section1594883301142407"></a>
The following uses
**rtc\_hi35xx.c**
as an example to present the contents that need to be provided by the vendor to implement device functions.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录