/* ----------------------------------------------------------- */ /* DEMO 1 : D/I demo */ /* Compiler: Borland C++ 3.1, Mode Large */ /* step 1 : connect a DB-16R to CON2 of PCI-1002 */ /* step 2 : run DEMO1.EXE */ /* step 3 : check the LEDs of DB-16R will turn on sequentially */ /* ----------------------------------------------------------- */ #include "P1002.H" WORD P1002_Do(WORD wDo); WORD wBaseAddr,wIrq,wPLX; void main() { int i,j; WORD wBoards,wRetVal; char c; clrscr(); wRetVal=P1002_DriverInit(&wBoards); printf("\n(1) Threr are %d PCI-1002 Cards in this PC",wBoards); if ( wBoards==0 ) { putch(0x07); putch(0x07); putch(0x07); printf("(1) There are no PCI-1002 card in this PC !!!\n"); exit(0); } printf("\n(2) Show the Configuration Space of all PCI-1002:"); for(i=0; i DO = %x",i,j); c=getch(); if ((c=='q') || (c=='Q')) return; j=j<<1; if (j==0) j=1; } P1002_DriverClose(); } /* ----------------------------------------------------------- */ WORD P1002_Do(WORD wDo) { outp(wBaseAddr+0x20,wDo); return(NoError); }