4.8Demo10: Find Card Number
/* | */ | |
/* demo 10: Find card number | */ | |
/* step 1 : run demo10.exe | */ | |
/* step 2 | : connect a | |
/* step 3 | : The card number is shown in screen as TEST OK | */ |
/* | */ |
#include "PIO.H"
WORD wBase,wIrq;
WORD wBoards,wRetVal;
WORD wBase,wIrq,wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice;
int main()
{
int i,j,k;
char c;
clrscr();
PIO_DriverInit(&wBoards,0x80,0x01,0x00); /* for
{
putch(0x07); putch(0x07); putch(0x07);
printf("(1) There are no
exit(0);
}
printf("\n(2) The Configuration Space
{
PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&wSubVendor,&wSubDevice, &wSubAux,&wSlotBus,&wSlotDevice);
printf("\nCard_%d: wBase=%x,wIrq=%x,subID=[%x,%x,%x],SlotID=[%x,%x]" ,i,wBase,wIrq,wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice);
}
PIO_GetConfigAddressSpace(0,&wBase,&wIrq,&wSubVendor,&wSubDevice,
for (;;) | &wSubAux,&wSlotBus,&wSlotDevice); | |
|
| |
{ | press any key to stop | |
for (i=0; i<wBoards; i++) test_card(i); |
| |
delay_ms(1000); /* delay 1 sec */ |
| |
if (kbhit()!=0) {getch(); break;} |
| |
} |
|
|
PIO_DriverClose(); |
|
|
} |
|
|
/* | */ |
test_card(int card)
{
int i,j,k,ok,val;
PIO_GetConfigAddressSpace(card,&wBase,&wIrq,&wSubVendor,&wSubDevice,
| &wSubAux,&wSlotBus,&wSlotDevice); | |
outp(wBase,1); | /* enable D/I/O | */ |
|