
The sample program code is shown below:
/* Step1: Detect all
printf("There are %d
/* Step2: save resource of all |
| |
for (i=0; i<wBoards; i++) |
|
|
{ |
|
|
P1002_GetConfigAddressSpace(i,&wBase,&wIrq,&wPLX); |
| |
printf("\nCard_%d: wBase=%x, wIrq=%x, wPLX=%x", i,wBase,wIrq,wPLX); |
| |
wConfigSpace[i][0]=wBaseAddress; /* save all resource of this card */ |
| |
wConfigSpace[i][1]=wIrq; | /* save all resource of this card */ |
|
wConfigSpace[i][2]=wPLX; | /* save all resource of this card */ |
|
} |
|
|
/* Step3: control the |
| |
wBase=wConfigSpace[0][0]; | /* get base address the card_0 | */ |
outpw(wBase+0x20,wDoValue); | /* control the D/O states of card_0 | */ |
wDiValue=inpw(wBase+0x20); | /* read the D/I states of card_0 | */ |
wBase=wConfigSpace[1][0]; | /* get base address of card_1 | */ |
outpw(wBase+0x20,wDoValue); | /* control the D/O states of card_1 | */ |
wDiValue=inpw(wBase+0x20); | /* read the D/I states of card_1 | */ |
wPLX=wConfigSpace[2][2]; | /* get | |
_outpd(wPLX+0x4c,0x41); | /* channel_1, interrupt active_Low | */ |
… |
|
|
… |
|
|
… |
|
|
_outpd(wPLX+0x4c,0); | /* disable all interrupts | */ |
27