凌云物联网实验室ISKBoard(IoT Starter Kits Board)开发板项目源码
guowenxue
2023-04-04 5937444d8c50fd85f603fae272f46bf10679fe28
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
/**********************************************************************
*   Copyright: (C)2023 LingYun IoT System Studio
*      Author: GuoWenxue<guowenxue@gmail.com> QQ: 281143292
* Description: ISKBoard ISL1208 RTC chip Hardware Abstract Layer driver
*
*   ChangeLog:
*        Version    Date       Author            Description
*        V1.0.0  2023.04.3    GuoWenxue      Release initial version
***********************************************************************/
#ifndef INC_ISL1208_H_
#define INC_ISL1208_H_
 
#include "i2c_bitbang.h"
 
#define ISL1208_I2CBUS           I2CBUS0   /* ISL1208 on GPIO I2C bus0 */
#define ISL1208_CHIPADDR         0x6F      /* ISL1208 7-Bits Chip address */
 
typedef struct rtc_time_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 ]      */
} rtc_time_t;
 
extern const char    *weekday[7];
 
extern int set_rtc_time(rtc_time_t tm);
 
extern int get_rtc_time(rtc_time_t *tm);
 
extern void print_rtc_time(void);
 
#endif /* INC_ISL1208_H_ */