ht1380.h

来自「HT1380 source code, ht1380.c is source c」· C头文件 代码 · 共 57 行

H
57
字号
#include "IOrCmp.h"

#define RSTRTC		16
#define RTIO			15
#define RTCLK		14

#define RTC_WR		16
#define RTC_DATA		15
#define RTC_CLK		14
#ifdef CMP_SOFT
#define RTC_CE		17
#else
#define RTC_CE		12
#endif

/*
typedef unsigned char         BYTE;     // 1 byte 
typedef unsigned short        WORD;     // 2 byte
typedef unsigned long         DWORD;    // 4 byte
*/

typedef struct
{

	unsigned short	Year;						// 0000-9999
	unsigned char		Month;						// 01-12(01H-0CH)
	unsigned char		Date;						// 01-31(01H-1FH)
	unsigned char		Week;						// 01-07
	unsigned char		Hour;						// 00-23(00-17H)
	unsigned char		Minute;						// 00-59(00-3BH)
	unsigned char		Second;						// 00-59(00-3BH)

	
} TIME_S2;



/*initialize the ht1380,all parameter is 0*/
extern void init_ht1380();

/*setup the write protect. flag=1 protect,flag=0 unprotect*/
extern void ProtectRTC(char flag);

/*read the time value from ht1380*/
extern void ReadRTC(TIME_S2 *DateTime);

/*write time value to ht1380
return value:
-1: the second value error
-2: the minute value error
-3: the hour value error
-4: the date value error
-5: the month value error
-6: the day value  error*/
extern int WriteRTC(TIME_S2 *DateTime);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?