
#include<stdlib.h>

/****** define the gain mode ********/
#define ISO813_BI_1		0
#define ISO813_BI_2		1
#define ISO813_BI_4		2
#define ISO813_BI_8		3
#define ISO813_BI_16		4

#define ISO813_UNI_1		0
#define ISO813_UNI_2		1
#define ISO813_UNI_4		2
#define ISO813_UNI_8		3
#define ISO813_UNI_16		4

/****** define the error number *******/
#define ISO813_NoError 			0
#define ISO813_CheckBoardError		1
#define ISO813_DriverOpenError		2
#define ISO813_DriverNoOpen		3
#define ISO813_AdError			4
#define ISO813_AdError2			-100.0
#define ISO813_OtherError		5
#define ISO813_GetDriverVersionError	6
#define ISO813_TimeOutError		0xffff

#define WORD	unsigned int
#define DWORD   unsigned long
#define UCHAR	unsigned char

/***************************************************/
/**************** Function of Test *****************/
short ISO813_SHORT_SUB_2(short nA, short nB);
WORD  ISO813_GetDriverVersion(WORD *wDriverVersion);

/*************** Function of Driver *****************/
unsigned int  ISO813_DriverInit(void);
void  ISO813_DriverClose(void);
WORD  ISO813_Check_Address(WORD wBase);

/***************** Function of AD *******************/
WORD  ISO813_AD_Hex(  WORD  wBase,     WORD  wChannel, WORD wGainCode );
WORD  ISO813_ADs_Hex( WORD  wBase,     WORD  wChannel, WORD wGainCode,
		      WORD  *wBuffer,  DWORD dwDataNo  );
void  ISO813_AD_SetReadyTicks(WORD wTicks);

/********** Declare 8253 Timer Interface ************/
WORD  ISO813_TimerRead(WORD *wTicks);
void  ISO813_TimerDelay(DWORD dwTicks);

/***************** Function of DIO*******************/
void  ISO813_OutputByte(WORD wPortAddr, UCHAR bOutputVal);
void  ISO813_OutputWord(WORD wPortAddr, WORD wOutputVal);
WORD  ISO813_InputByte(WORD wPortAddr);
WORD  ISO813_InputWord(WORD wPortAddr);


