ISKBoard example project
guowenxue
7 days ago 6c7b6c910be1dcdc0bb786e02be648b1a56faa5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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_ */