#define WORD int

#define NoError 	0
#define SysNoOpen	1
#define ActiveError	2
#define TimeOut 	3
#define SysOpenError	4
#define CheckError	5
#define BoardError	6
#define SingDiffError	7
#define IrqError	8
#define SampleRateError 9
#define HandshakeError	10


#define UNIPOLAR		0x40	/* Unipolar */
#define BIPOLAR 		0x00	/* Bipolar */

					/* ISO-AD32H ISO-AD32L */
#define CONFIG_1		0x00	/* Gain = 1	1      */
#define CONFIG_2		0x10	/*	 10	2      */
#define CONFIG_3		0x20	/*	100	4      */
#define CONFIG_4		0x30	/*     1000	8      */
#define CONFIG_5		0x80	/*	0.5	0.5    */
#define CONFIG_6		0x90	/*	  5	1      */
#define CONFIG_7		0xA0	/*	 50	2      */
#define CONFIG_8		0xB0	/*	500	4      */

#define SAMPLE_RATE_NO_INT	0x00
#define SAMPLE_RATE_WITH_INT	0x01
#define FAST_NO_INT		0x02
#define FAST_WITH_INT		0x03

extern short  AD32_ShortSub2(short nA, short nB);
extern float  AD32_FloatSub2(float fA, float fB);
extern WORD   AD32_GetVersion(void);
extern WORD   AD32_CheckBoard(WORD wBoard, WORD wBase, WORD wSingDiff,
		       WORD wIrq);
extern WORD   AD32_ActiveBoard(WORD wBoard);
extern WORD   AD32_ReadActive(WORD *wActive, WORD *wBase, WORD *wIrq);
extern WORD   AD32_SetChannelConfigNoScan(WORD wChannel, WORD wMode,
		       WORD wConfig, WORD wSettle);
extern WORD   AD32_ReadChannelConfigNoScan(WORD *wChannel, WORD *wMode,
		       WORD *wConfig);
extern WORD   AD32_ReadSingDiff(WORD *wSingDiff);
extern WORD   AD32_ReadAdNoScan(WORD *wData);
extern WORD   AD32_StartAdsNoScan(WORD wMode, WORD wCount);
extern WORD   AD32_ReadSystemStatus(WORD *wStatus);
extern WORD   AD32_ReadFIFO(WORD *wData);
extern WORD   AD32_ClearFIFO(void);
extern WORD   AD32_SetSampleRate(float fSampleRate);
extern WORD   AD32_ReadSampleRate(float *fSampleRate);
extern WORD   AD32_ReadChannelScanStatus(WORD wScanNum, WORD *wChannel,
		       WORD *wMode, WORD *wConfig);
extern WORD   AD32_SetChannelScanStatus(WORD wScanNum, WORD wChannel,
		       WORD wMode, WORD wConfig);
extern WORD   AD32_StartChannelScanAds(WORD wMode, WORD wScanCount,
		       WORD wAdCount);
