/*--------------------------------------------------------------------*/ /* Veddor Device Sub-vendor Sub-device Sub-aux Tiger PIO_D144 E159 0002 80 01 00 100 PIO_D96 E159 0002 80 01 10 100 PIO_D64 E159 0002 80 01 20 100 PIO_D48 E159 0002 80 01 30 100 PIO_D24 E159 0002 80 01 40 100 PIO_D56 E159 0002 80 01 40 100 PIO-D168 E159 0001 d880 01 50 320 PIO_D144 E159 0001 5c80 01 00 320 PIO_D96 E159 0001 5880 01 10 320 PIO_D64 E159 0001 4080 01 20 320 PIO_D48 E159 0001 4080 01 30 320 PIO_D24 E159 0001 c080 01 40 320 PIO_D56 E159 0001 c080 01 40 320 PIO-DA4/8/16 E159 0002 80 04 00 100 PISO-C64 E159 0002 80 08 00 100 PISO-P64 E159 0002 80 08 10 100 PISO-A64 E159 0002 80 08 50 100 PISO-DA2 E159 0002 80 0B 00 100 PISO-813 E159 0002 80 0A 00 100 PISO-725 E159 0002 80 0C 00 100 PISO-P8R8 E159 0002 80 08 30 100 PIO-DA4/8/16 E159 0001 0x4180 0x00 0x00 320 PISO-DA2 E159 0001 0x4280 0x03 0x00 320 PISO-C64 E159 0001 0x0280 0x00 0x00 320 PISO-P64 E159 0001 0x0280 0x00 0x01 320 PISO-A64 E159 0001 0x8280 0x00 0x05 320 PISO-813 E159 0001 0x4280 0x02 0x00 320 PISO-725 E159 0001 0x0380 0x00 0x00 320 PISO-P8R8SSR8 E159 0001 0x4200 0x00 0x30 320 PISO-P32C32 E159 0002 80 08 20 100 PISO-P32A32 E159 0002 80 08 70 100 PISO-730 E159 0002 80 08 40 100 PISO-730A E159 0002 80 08 80 100 PISO-P32C32 E159 0001 0280 00 20 320 PISO-P32A32 E159 0001 8280 00 70 320 PISO-730 E159 0001 c2ff 00 40 320 PISO-730A E159 0001 62ff 00 80 320 VXC-142 E159 0001 61 00 00 320 VXC-142i E159 0001 161 02 00 320 VXC-182i E159 0001 161 01 00 320 --------------------------------------------------------------------*/ #include #include #include #include #include #define BYTE unsigned char #define UCHAR unsigned char #define WORD unsigned int #define DWORD unsigned long #define TIGER100 0xE1590002 #define TIGER320 0xE1590001 #define NoError 0 #define DriverHandleError 1 #define DriverCallError 2 #define FindBoardError 3 #define TimeOut 4 #define ExceedBoardNumber 5 #define NotFoundBoard 6 #define MAX_BOARD_NUMBER 16 float PIO_FloatSub2(float fA, float fB); short PIO_ShortSub2(short nA, short nB); WORD PIO_DriverInit(WORD *wBoards, DWORD wSubVenderID, WORD wSubDeviceID ,BYTE wSubAuxID); WORD PIO_DriverClose(void); WORD PIO_GetDriverVersion(WORD *wDriverVersion); WORD PIO_GetConfigAddressSpace(WORD wBoardNo, WORD *wBaseAddr, WORD *wIrq, WORD *wSubVendor, WORD *wSubDevice, WORD *wSubAux, WORD *wSlotBus, WORD *wSlotDevice); WORD GetAddress(void); void WriteAddress(UCHAR bBus, UCHAR bDevice, UCHAR bFunction, UCHAR bWhichLong); WORD GetSubVendorID_320(void); // for MSC compiler #define outportb outpw #define inport inpw #define enable _enable #define disable _disable #define inportb inp #define setvect _dos_setvect void _outpd(WORD port,DWORD data); DWORD _inpd(WORD port); /* [0][1] --> system resource allocated wConfigSpace[][0]= wBase wConfigSpace[][1]= wIrq [2][3][4] --> subID to identify PIO/PISO cards wConfigSpace[][2]= wSubVendorID wConfigSpace[][3]= wSubDeviceID wConfigSpace[][4]= wSubAuxID [5][6] --> SlotID to identify the slot position of this PIO/PISO card wConfigSpace[][5]= wSlotBus wConfigSpace[][6]= wSlotDevice */ WORD wConfigSpace[MAX_BOARD_NUMBER][7]; WORD ShowPioPiso(DWORD wSubVendorID, WORD wSubDevice, WORD wSubAux); /* -------------------------------------------------------------------- */ /* -------Below functions are for MSC only----------------------------- */ //void _outpd(WORD port,DWORD data); //DWORD _inpd(WORD port); void delay1(int d); void gotoxy(int x,int y); void clrscr(void);