#include <io.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>

/*------------------------------*/

#define	TRUE		0x01
#define	FALSE		0x00

/* ------------------------------------------------------------------ */
/*  RTC	timer Definitions					      */
/* ------------------------------------------------------------------ */
#define	RTC_alarm_sec	0x01
#define	RTC_alarm_min	0x03
#define	RTC_alarm_hour	0x05
#define	RTC_sec		0x00
#define	RTC_min		0x02
#define	RTC_hour	0x04
#define	RTC_week	0x06
#define	RTC_day		0x07
#define	RTC_month	0x08
#define	RTC_year	0x09
#define	RTC_REG_A	0x0A
#define	RTC_REG_B	0x0B
#define	RTC_REG_C	0x0C
#define	RTC_REG_D	0x0D

/*------ utility.lib declaration -----*/

/* -----Battery Backup RAM----------------------------------------- */
unsigned char read_backup_ram(unsigned int index);
void write_backup_ram(unsigned int index, unsigned char	data);
void Set_NVRAM_Size(unsigned char sector);
unsigned char Get_NVRAM_Size( void);
/* -----Battery Backup RAM----------------------------------------- */

/* -----RTC-------------------------------------------------------- */
unsigned char GetRTCtime(unsigned char Time);
void SetRTCtime(unsigned char Time,unsigned char data);
void Set_SysMem(unsigned char which_byte, unsigned char	data);
unsigned char Get_SysMem(unsigned char which_byte);
/* -----RTC-------------------------------------------------------- */

void WDT_enable(void);
void WDT_disable(void);
void WDT_clear(void);

extern int tmArriveCnt[100];
int Timer_Init();
int Timer_Set(unsigned int msec);
void Timer_Reset(int idx);
void Release_All();
void ADAMdelay(unsigned	short msec);
