.. _虚拟RTC: 虚拟RTC ========================================= | AD150 v1.7.0版本SDK提供了虚拟RTC功能示例,其功能包含读写时钟、闹钟,可在powerdown、softoff情况下走时并且响应闹钟。使用时需要开启app_modules.h中的rtc功能宏,相关应用示例位于app/bsp/common/rtc/rtc.c。 注:虚拟rtc在powerdown、softoff情况下运行会六个小时自动唤醒一次,否则时间会不准! ^^^^^^^^^^^^^^^^^^^^ 功能接口介绍 ################################ int rtc_simulate_init(const struct vir_rtc_data \*arg) ************************************************************ 该函数主要实现虚拟rtc功能初始化。其中参数: :: 1、vir_rtc_data: 初始化的时钟、闹钟和回调信息; void read_sys_time(struct sys_time \*curr_time); *********************************************************** 该函数实现读取当前rtc运行的时钟。其中参数: :: 1、curr_time: 读取到的时钟信息,函数会将读取到的时钟更新到该结构体; void write_sys_time(struct sys_time \*curr_time); ****************************************************** 该函数实现写入时钟。其中参数: :: 1、curr_time: 读取到的时钟信息,函数会将读取到的时钟更新到该结构体; void read_alarm(struct sys_time \*alarm_time); ****************************************************** 该函数实现读取闹钟。其中参数: :: 1、alarm_time: 读取到的闹钟信息,函数会将读取到的时钟更新到该结构体; void write_alarm(struct sys_time \*alarm_time); ******************************************************** 该函数实现写入闹钟。其中参数: :: 1、alarm_time: 写入的闹钟信息; void vir_set_alarm_ctrl(u8 set_alarm); **************************************************************** 该函数实现设置闹钟使能。其中参数: :: 1、set_alarm:闹钟使能标志;1:闹钟使能, 0:闹钟失能。 u8 vir_get_alarm_ctrl(void); ************************************************************** 该函数实现获取闹钟使能标志。其中参数::: 1、返回值:闹钟使能标志。1:闹钟使能, 0:闹钟失能。