/***************** Define A822 Register Address *****************/ #define TIMER0 0x00 /* 8254 timer/counter_0 */ #define TIMER1 0x01 /* 8254 timer/counter_1 */ #define TIMER2 0x02 /* 8254 timer/counter_2 */ #define TIMER_MODE 0x03 /* 8254 control register */ #define AD_LO 0x04 /* AD, Low Byte */ #define AD_HI 0x05 /* AD, High Byte */ #define DA_CH0_LO 0x04 /* DA, Channel 0, Low byte */ #define DA_CH0_HI 0x05 /* DA, Channel 0, High byte */ #define DA_CH1_LO 0x06 /* DA, Channel 1, Low byte */ #define DA_CH1_HI 0x07 /* DA, Channel 1, High byte */ #define DI_LO 0x06 /* DI, Low byte */ #define DI_HI 0x07 /* DI, High byte */ #define DO_LO 0x0D /* DO, Low byte */ #define DO_HI 0x0E /* DO, High byte */ #define CLEAR_IRQ 0x08 /* AD, Clear Interrupt Request */ #define SET_GAIN 0x09 /* AD, Gain Control */ #define SET_CH 0x0A /* AD, Multiplexer Control */ #define SET_MODE 0x0B /* AD, Mode Control */ #define SOFT_TRIG 0x0C /* AD, Software Trigger Control */ /*** define AD Trigger/Transfer Mode ***/ #define POLLING_MODE 1 /* Software Trig, Software Transfer (Polling)*/ #define DMA_MODE 2 /* Pacer Trig, DMA Transfer */ #define INTERRUPT_MODE 6 /* Pacer Trig, Software/Interrupt Transfer*/ /*** define the AD Gain Code ***/ #define A822_BI_1 0 #define A822_BI_10 1 #define A822_BI_100 2 #define A822_BI_1000 3 #define A822_UNI_1 4 #define A822_UNI_10 5 #define A822_UNI_100 6 #define A822_UNI_1000 7 #define A822_BI_05 8 #define A822_BI_5 9 #define A822_BI_50 10 #define A822_BI_500 11 /*** define the error number ***/ #define NoError 0 #define CheckBoardError 1 #define CheckDmaError 2 #define CheckIrqError 3 #define CardNumError 4 #if defined __cplusplus extern "C" { #endif int FAR PASCAL _export A822_ActiveBoard(int BoardNo); int FAR PASCAL _export A822_Check_Address(int BaseAddr); int FAR PASCAL _export A822_Initialize(int CardNo,int BaseAddr,int DmaNo, int IrqNo); unsigned FAR PASCAL _export A822_DI(void); void FAR PASCAL _export A822_DO(unsigned DigitOutput); void FAR PASCAL _export A822_DA(int Channel,unsigned data); void FAR PASCAL _export A822_AD_SetChGainMode(int Ch,int Gain,int Mode); void FAR PASCAL _export A822_AD_PollingArray(int FAR *Buffer,unsigned Length); unsigned FAR PASCAL _export A822_AD_PollingVar(void); void FAR PASCAL _export A822_AD_INT(int Ch,int Gain, unsigned int count, int FAR *Buffer2, int c1, int c2); void FAR PASCAL _export A822AdIntStart1( int Ch, int Gain , unsigned buffersize , int FAR *Buffer2 , int c1 , int c2); int FAR PASCAL _export A822AdIntGetData(int count,int *buf); unsigned FAR PASCAL _export A822_AD_INT_Count(void); void FAR PASCAL _export A822_AD_INT_Stop(void); int FAR PASCAL _export A822_DMA_Start(int Ch,int Gain,unsigned count, int FAR *Buffer,unsigned c1,unsigned c2); int FAR PASCAL _export A822_DMA_Status(void); int FAR PASCAL _export A822_AD_DMA_Stop(void); int FAR PASCAL _export A822_Delay(unsigned int); unsigned FAR PASCAL _export A822_InputByte(int Address ); void FAR PASCAL _export A822_OutputByte(int Address, int val); #if defined __cplusplus } #endif