int A823_Initialize(int cardno,int BaseAddr,int DmaNo, int IrqNo);
int A823_ActiveBoard(int BoardNo);
int A823_Check_Address(int BaseAddr);
unsigned int A823_DI( void );
void A823_DO(unsigned DigitOutput);
int A823_DA(int Channel, unsigned int data);
void A823_AD_SetChGainMode(int Channel, int Gain, int Mode);
void A823_AD_Timer(int c1);
void A823_AD_PollingArray(unsigned int *Buffer, unsigned int Length);
unsigned int A823_AD_PollingVar(void);
int A823_AD_INT_Start(int* Buffer , unsigned int count, int c1);
unsigned A823_AD_INT_Count(void);
void A823_AD_INT_Stop(void);
int A823_AD_DMA_Start(int far *Buffer , unsigned int count, int c1);
void A823_AD_DMA_Stop(void);
int A823_Delay(unsigned int DownCount);
extern int DmaGo;

/***************** DEFINE A823 RELATIVE ADDRESS *****************/
#define   TIMER0	   0x00
#define   TIMER1	   0x01
#define   TIMER2	   0x02
#define   TIMER_MODE	   0x03
#define   AD_LO 	   0x04    /* Analog to Digital, Low Byte */
#define   AD_HI 	   0x05    /* Analog to Digital, High Byte */
#define   DA_CH0_LO	   0x04    /* Digit to Analog, CH 0 */
#define   DA_CH0_HI	   0x05
#define   DA_CH1_LO	   0x06    /* Digit to Analog, CH 1 */
#define   DA_CH1_HI	   0x07
#define   DIGITIN_LO	   0x06    /* Digit Input */
#define   DIGITIN_HI	   0x07
#define   AD_READY	   0x08
#define   DIGITOUT_LO	   0x0D    /* Digit Output */
#define   DIGITOUT_HI	   0x0E

#define   CLEAR_IRQ	   0x08
#define   SET_GAIN	   0x09
#define   SET_CH	   0x0A
#define   SET_MODE	   0x0B
#define   SOFT_TRIG	   0x0C

#define   POLLING_MODE	   1
#define   DMA_MODE	   2
#define   INTERRUPT_MODE   6

/*** define the gain mode ***/
#define   A823_BI_1	   0
#define   A823_BI_10	   1
#define   A823_BI_100	   2
#define   A823_BI_1000	   3
#define   A823_UNI_1	   4
#define   A823_UNI_10	   5
#define   A823_UNI_100	   6
#define   A823_UNI_1000    7
#define   A823_BI_05	   8
#define   A823_BI_5	   9
#define   A823_BI_50	  10
#define   A823_BI_500	  11

#define   A823_BI_2	   1
#define   A823_BI_4	   2
#define   A823_BI_8	   3
#define   A823_UNI_2	   5
#define   A823_UNI_4	   6
#define   A823_UNI_8	   7

/*** define the error number ***/
#define   NoError	   0
#define   CheckBoardError  1
#define   CheckDmaError    2
#define   CheckIrqError    3
#define   CardNumError	   4
#define   DAchannelError   5
#define   DelayError	   6
