#ifndef	__EXT_RTC_H
#define	__EXT_RTC_H

#define RTC_ID					0xDE

#define RTC_REG_SECOND			0x00
#define RTC_REG_MINUTE			0x01
#define RTC_REG_HOUR			0x02
#define RTC_REG_DATE			0x03
#define RTC_REG_MONTH			0x04
#define RTC_REG_YEAR			0x05
#define RTC_REG_WEEK			0x06
#define RTC_REG_STATUS			0x07

typedef struct _RTC_VAR_					//BCD Type
{
	U8 Second;
	U8 Minute;
	U8 Hour;
	U8 Date;
	U8 Month;
	U8 Year;
	U8 Week;
}RTC_VAR;
extern RTC_VAR xdata RTC;
extern BOOL	bRTCErr;
extern BOOL	bRTCTwiRWErr;
extern U8	xdata	ucRTCTwiRWErrDelayCnt;


extern BOOL RTCInitTime(RTC_VAR xdata *RtcInitVal);
extern BOOL RTCReadTime(RTC_VAR xdata *RtcRdVal);
extern BOOL RTCModifyTime(RTC_VAR xdata *RtcMdyVal);
extern void RTCTwiCheck(void);

#endif