sdk-hwV1.3/lichee/xr806/appos/project/example/rtc/readme.md

112 lines
2.9 KiB
Markdown
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# rtc示例工程
> rtc示例工程展示了rtc模块接口使用方法。
>
> 本工程中提供以下模块接口使用的示例:
> 1. 设置时间(年/月/日/星期几/时/分/秒)
> 2. 读取时间
> 3. 设置秒闹钟
> 4. 设置天闹钟
> 5. 读取系统运行时间
---
## 适用平台
> 本工程适用以下芯片类型:
>
> 1. XR806系列芯片
> 本工程适用以下评估板类型:
> 1. 底板XR806_EVB
> 2. 模组XR806_MD01
> 本工程在基于"XR806_MD01"的“XR806_EVB”板上测试通过。
> 若需要在其他适用芯片和评估板上运行本工程请根据快速指南《XRadio_Quick_Start_Guide-CN》的提示进行相关配置修改。
> XRadio Wireless MCU芯片和评估板的更多信息可在以下地址获取
> https://docs.xradiotech.com
## 工程配置
> defconfig
> * N/A
>
> Makefile
> * N/A
>
> board_config.h
> * N/A
>
> board_config.c
> * N/A
>
> prj_config.h
>
> * N/A
## 模块依赖
> * N/A
---
## 工程说明
> 本工程通过串口UART0打印信息演示rtc模块的设置时间、读取时间、设置秒闹钟、设置天闹钟、读取系统运行时间功能的使用。
### 操作说明:
> 1. 使用串口线连接UART0接口
> 2. 编译工程,烧录镜像,复位启动
> 3. 系统启动后,可以通过串口软件看到示例的打印信息
> XRadio SDK的编译、烧写等操作方式的说明可在以下地址获取
> https://github.com/XradioTech/xradiotech-wiki
### 控制命令
> * N/A
### 代码结构
```
.
├── gcc
│ ├── defconfig # 本工程的配置规则,用于覆盖默认配置
│ └── Makefile # 本工程的编译规则可指定src、lib、ld、image.cfg、board_config等文件
├── image
│ └── xr806
│ └── image.cfg # 本工程的镜像分区配置
├── main.c # 本工程的入口完成rtc初始化和演示rtc示例
├── prj_config.h # 本工程的配置规则
└── readme.md # 本工程的说明文档
#本程用到XRadio SDK的其他配置文件
.
└── project
   └── common
      └── board
         └── xr806_dig_ver #在project/Kconfig默认指定使用xr806_dig_ver的板级配置
            ├── board_config.h #本工程的板级配置,
            └── board_config.c #本工程的板级pin mux的配置。
```
### 代码流程
> 1. main()入口rtc设置初始化循环检测重置闰年
> 2. rtc_init()函数流程:
> A设置时间
> B读取打印时间
> C设置秒计时闹钟计时结束后打印提示秒闹钟到来
> D设置天闹钟星期几/时/分/秒),到达设置的闹钟点时打印提示天闹钟到来
> E读取并打印系统运行时间
---
## 常见问题
> * N/A
## 参考文档
> * N/A