⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ht1380.h

📁 HT1380 source code, ht1380.c is source code and ht1380.h is head file
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -