// PCI8134
#ifndef _MOTION
#define _MOTION

#define SOFT_VERSION 200117 //YY.MM.DD

// ========== Choose Function Model Name =============
#define _ADLINK

// =========== Choose Board Interface ================
#define _PCI		// PCI Bus

// =========== Choose Customized Option ================
//#define _NT40_FIXED
//#define _HEXA

// =========== Choose OS =================
#define _MYWIN32
//#define _MSDOS
//#define _MYLINUX
//#define _MYWINCE

// =========== Choose Compiler =============
#define _MSC
//#define _BC31
//#define _MYWATCOMC
//#define _PLATFORMBUILDER

// =========== Choose IO method =============
#define _IO_HAL
//#define _IO_DIRECT

/////////////////////////////////////////////////////////////////////

#if defined(_MYWIN32)

	#if defined( _MSC )
	  #define FNTYPE PASCAL

		#if defined( _IO_HAL )


		void Win32_outb(unsigned short  address, unsigned char  RegSelCmd);   
		void Win32_outw(unsigned short  address, unsigned short  RegSelCmd);   
		void Win32_outl(unsigned short  address, unsigned long  RegSelCmd);   
		unsigned char  Win32_inb(unsigned short  address);   
		unsigned short Win32_inw(unsigned short  address);   
		unsigned long  Win32_inl(unsigned short  address);   

		#define _OUTPORTB(s,t) Win32_outb(s,t)   
		#define _OUTPORTW(s,t) Win32_outw(s,t)   
		#define _OUTPORTD(s,t) Win32_outl(s,t)   
		#define _INPORTB(s) Win32_inb(s)   
		#define _INPORTW(s) Win32_inw(s)   
		#define _INPORTD(s) Win32_inl(s)   


		//#define _OUTPORTB _outp
		//#define _OUTPORTW _outpw
		//#define _OUTPORTD _outpd
		//#define _INPORTB _inp
		//#define _INPORTW _inpw//
		//#define _INPORTD _inpd//


		#else

		#define _OUTPORTB _outp
		#define _OUTPORTW _outpw
		#define _OUTPORTD _outpd
		#define _INPORTB _inp
		#define _INPORTW _inpw
		#define _INPORTD _inpd

		#endif

	  #define _SLEEP        Sleep
	  #define _SLEEP_US(x)	_win32_sleep_us((x))
	
      void _win32_sleep_us( long MicroSec ); 

	#endif

#elif defined (_MSDOS)

	#if defined( _BC31 )
	  #define FNTYPE
	  #define _OUTPORTB outportb
	  #define _OUTPORTW outport
	  #define _INPORTB inportb
	  #define _INPORTW inport
	  #define _SLEEP   delay
	#elif defined (_WATCOMC)
	  #define FNTYPE
	  #define _OUTPORTB outp
	  #define _OUTPORTW outpw
	  #define _INPORTB inp
	  #define _INPORTW inpw
	  #define _SLEEP   delay
	#endif
#elif defined ( _MYLINUX)

  #define FNTYPE
  #define _SLEEP(t) usleep(1000*t)

  #define _OUTPORTB outb
  #define _OUTPORTW outw
  #define _OUTPORTD outl
  #define _INPORTB inb
  #define _INPORTW inw
  #define _INPORTD inl

#elif defined (_MYWINCE )

	#ifdef _PLATFORMBUILDER
	  #define FNTYPE
	  #define _OUTPORTB _outp
	  #define _OUTPORTW _outpw
	  #define _OUTPORTD _outpd
	  #define _INPORTB _inp
	  #define _INPORTW _inpw
	  #define _INPORTD _inpd
	  #define _SLEEP Sleep
	#endif

#endif


#endif
