凌云物联网实验室ISKBoard(IoT Starter Kits Board)开发板项目源码
guowenxue
2023-04-03 32806da6f5647ac637fa7d48aa9c221b091ab35e
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
/*
 * isl1208.h
 *
 *  Created on: Jan 19, 2023
 *      Author: Wenxue
 */
 
#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_ */