xt-sdk 文档 v1.0.3
xt-sdk 嵌入式 SDK API 参考
载入中...
搜索中...
未找到
xt_hal_rtc.h
浏览该文件的文档.
1
12
13#ifndef __XT_HAL_RTC_H__
14#define __XT_HAL_RTC_H__
15
16/* ==================== [Includes] ========================================== */
17
18#include "xt_hal_internal.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
30
31/* ==================== [Defines] =========================================== */
32
33/* ==================== [Typedefs] ========================================== */
34
38#if !defined(XT_HAL_RTC_TIME_64BITS)
39typedef uint32_t xt_hal_rtc_timestamp_t;
40#else
41typedef uint64_t xt_hal_rtc_timestamp_t;
42#endif
43
61
68
75typedef void (*xt_hal_rtc_cb_t)(uint8_t id, uint32_t event_id);
76
77/* ==================== [Global Prototypes] ================================= */
78
86
94
101
111
120xt_err_t xt_hal_rtc_setup_alarm_relative(uint8_t id, uint32_t timeout_ms, xt_hal_rtc_cb_t cb);
121
129
138
146
154
155/* ==================== [Macros] ============================================ */
156 /* xt_hal_rtc */
158
159#ifdef __cplusplus
160} /* extern "C" */
161#endif
162
163#endif /* __XT_HAL_RTC_H__ */
int32_t xt_err_t
错误码类型
uint32_t xt_hal_rtc_timestamp_t
RTC 时间戳类型
xt_err_t xt_hal_rtc_close_alarm(uint8_t id)
关闭 RTC 闹钟
xt_err_t xt_hal_rtc_set_timezone(int8_t zone)
设置 RTC 时区
xt_err_t xt_hal_rtc_set_time(struct xt_hal_rtc_tm *tm)
设置 RTC 时间
xt_err_t xt_hal_rtc_setup_alarm_relative(uint8_t id, uint32_t timeout_ms, xt_hal_rtc_cb_t cb)
增量设置 RTC 闹钟
xt_hal_rtc_timestamp_t xt_hal_rtc_get_timestamp(void)
获取 RTC 时间戳
xt_hal_rtc_event_id
RTC 事件类型枚举
xt_err_t xt_hal_rtc_get_time(struct xt_hal_rtc_tm *tm)
获取 RTC 时间
xt_err_t xt_hal_rtc_get_timezone(int8_t *zone)
获取 RTC 时区
void(* xt_hal_rtc_cb_t)(uint8_t id, uint32_t event_id)
RTC 回调函数类型
xt_err_t xt_hal_rtc_get_alarm(uint8_t id, struct xt_hal_rtc_tm *tm)
获取 RTC 闹钟信息
xt_err_t xt_hal_rtc_setup_alarm(uint8_t id, struct xt_hal_rtc_tm *tm, xt_hal_rtc_cb_t cb)
设置 RTC 闹钟
@ XT_HAL_RTC_ALARM
RTC 时间结构体
XTINY HAL 内部公共头文件