Initial commit: my SECS2 project
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#ifndef __BSP_DS1302_H__
|
||||
#define __BSP_DS1302_H__
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#define BSP_DS1302_SEC_ADDR 0x80 //秒数据地址
|
||||
#define BSP_DS1302_MIN_ADDR 0x82 //分数据地址
|
||||
#define BSP_DS1302_HOUR_ADDR 0x84 //时数据地址
|
||||
#define BSP_DS1302_DATA_ADDR 0x86 //日数据地址
|
||||
#define BSP_DS1302_MONTH_ADDR 0x88 //月数据地址
|
||||
#define BSP_DS1302_DAY_ADDR 0x8a //星期数据地址
|
||||
#define BSP_DS1302_YEAR_ADDR 0x8c //年数据地址
|
||||
#define BSP_DS1302_CONTROL_ADDR 0x8e //控制数据地址
|
||||
#define BSP_DS1302_CHARGER_ADDR 0x90
|
||||
#define BSP_DS1302_CLKBURST_ADDR 0xbe
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 Year;
|
||||
u8 Month;
|
||||
u8 Day;
|
||||
u8 Hour;
|
||||
u8 Minute;
|
||||
u8 Second;
|
||||
}bsp_DS1302_Time_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bsp_DS1302_Time_t Time;
|
||||
void (*Init)(void);
|
||||
u8 (*Set)(bsp_DS1302_Time_t *);
|
||||
void (*Task)(void);
|
||||
}bsp_DS1302_t;
|
||||
|
||||
extern bsp_DS1302_t DS1302;//系统时间
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user