From 1105733dc07562240bd061a1d8b0869c8c596805 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Thu, 09 Oct 2025 00:41:09 +0800 Subject: [PATCH] ISL1208 RTC示例程序 --- Core/Src/board/isl1208.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/Core/Src/board/isl1208.h b/Core/Src/board/isl1208.h new file mode 100644 index 0000000..2fe532e --- /dev/null +++ b/Core/Src/board/isl1208.h @@ -0,0 +1,46 @@ +/********************************************************************** + * Copyright: (C)2024 LingYun IoT System Studio + * Author: GuoWenxue<guowenxue@gmail.com> + * + * Description: ISL1208 RTC driver on ISKBoard + * + * ChangeLog: + * Version Date Author Description + * V1.0.0 2024.08.29 GuoWenxue Release initial version + * + ***********************************************************************/ + +#ifndef __ISL1208_H_ +#define __ISL1208_H_ + +typedef struct hwclock_s +{ + int tm_sec; /* [0 ~ 59/60 ] */ + int tm_min; /* [0 ~ 59 ] */ + int tm_hour; /* [0 ~ 23 ] */ + + int tm_mday; /* [1 ~ 31] */ + int tm_mon; /* [1 ~ 12] */ + int tm_year; /* [ 2000~2099 ] */ + + int tm_wday; /* [0 ~ 6 ] */ +} hwclock_t; + +extern const char *weekday[7]; + +/* Set RTC time by struct $tm */ +extern int set_hwclock(hwclock_t tm); + +/* Get RTC time by struct $tm */ +extern int get_hwclock(hwclock_t *tm); + +/* Set RTC time by time string format: "2024-08-29 12:08:08" */ +extern int set_rtctime(char *time); + +/* Get RTC time by time string format: "2024-08-29 12:08:08" */ +extern int get_rtctime(char *buf, int size); + +/* Print RTC time by time string format: "2024-08-29 12:08:08" */ +extern void print_rtctime(void); + +#endif /* __ISL1208_H_ */ -- Gitblit v1.9.1