#ifndef __TD__DAQ___
#define __TD__DAQ___

#include <windows.h>

/* error message */
#define	BAD_DRV_ID						-1
#define	ERROR_LOADING_VXD				-2
#define	ERROR_INIT_INT					-3
#define	ERROR_INIT_INTT					-4
#define	DRV_STACK_FULL					-5
#define	BAD_VXD							-6
#define	BAD_AO_NUMBER					-7
#define	BAD_GAIN						-8
#define	BAD_CHAN						-9
#define	FUNC_NOT_IMPLEMENTED			-10
#define BAD_PARAMETER					-11
#define IRQ_NOT_INSTALL					-12
#define	CANNOT_CLOSE_DRIVER				-13
#define	BAD_DI_NUMBER					-14
#define	BAD_DO_NUMBER					-15
#define	ERROR_CHANGE_WHILE_INT			-16
#define	AINPUTS_NOT_CONFIGURED			-17
#define	FREKVENCY_MEASUREMENT_NOT_SET	-18
#define	BAD_AI_NUMBER					-19
#define BOARD_NOT_RESPOND				-20
#define CHANNELS_NOT_SORTED				-21
#define	AOUTPUTS_NOT_CONFIGURED			-22
#define	LOAD_INTERNAL_BOARD_RAM_ERR		-23
#define	SAVE_INTERNAL_BOARD_RAM_ERR		-24
#define TO_MUCH_CHANNELS				-25
/*	A/D gen trig source */
#define	SW								0
#define	TIMER							1
#define	EXTERNAL						2
#define	SLAVE							3
#define LT512						(1<<16)
#define CYKL_GENERATOR				(1<<17)
#define IGNORE_OUTPUT_FAULTS		(1<<18)
#define GATED_AI_TIMER_OR_EXT		(1<<19)
/*	BIT 20, 21 */
#define TRIGGER_EXTERNAL			(2<<20)
#define TRIGGER_SW					(1<<20)
#define TRIGGER_ANALOG				(3<<20)



#if defined(__cplusplus) || defined(__cplusplus__)
extern "C" {
#endif

int __cdecl	Td_Init_Drv( char	*Name, int hWnd);
int __cdecl	Td_Get_AI( int handle, BYTE Chan, BYTE Gain);
int __cdecl	Td_Set_AO( int	handle, WORD AO, WORD Val, BYTE Gain);
int __cdecl	Td_Get_Int_Status( int	handle, ULONG *Ct, ULONG *CtR, ULONG *CtW);
int __cdecl	Td_Set_Interrupt_Timing( int handle, double *Frekvency);
int __cdecl	Td_Start_Interrupt( int	handle, ULONG Mode);
int __cdecl	Td_Start_Measuring( int	handle, ULONG Count_Pred, ULONG Count, ULONG Mode);
int __cdecl	Td_Stop_Interrupt( int	handle);
int __cdecl	Td_Get_DI( int handle, WORD DI);
int __cdecl	Td_Set_DO( int	handle, WORD DO, BYTE Val);
int __cdecl	Td_Config_AI( int	handle, WORD *Cfg, WORD Len);
int __cdecl	Td_Get_AI_Buf( int handle, WORD *Buf, ULONG	Max_Vals);
int __cdecl	Td_Get_AICfg_Buf( int handle, ULONG *Buf, ULONG	Max_Vals);
int __cdecl	Td_Config_Msg_Gen( int	handle, int Pause, int BufR_Min, int BufW_Min);
int __cdecl	Td_Set_AI_Timing( int handle, double *Frekvency);
int __cdecl	Td_Set_AO_Timing( int handle, double *Frekvency);
int __cdecl	Td_Set_AIO_Timing( int handle, double *AIFrekvency, double *AOFrekvency);
int __cdecl	Td_Set_AO_Buf( int handle, WORD *Buf, ULONG	Max_Vals);
int __cdecl	Td_Config_AO( int handle, WORD *Buf, ULONG	Max_Vals);
int __cdecl	Td_Load_Board_Mem( int	handle, unsigned char *EEProm, int Adr, int Len);
int __cdecl	Td_Write_Board_Mem( int	handle, unsigned char *EEProm, int Adr, int Len);
int __cdecl	Td_Close_Drv( int	handle);
int __cdecl	Td_SetAnalogTrigVal(int	handle, USHORT Channel, USHORT Slope, USHORT Value);

#if defined(__cplusplus) || defined(__cplusplus__)
}
#endif

#endif /* __TD__DAQ___ */
