3.1.2 PIO_GetConfigAddressSpace
PIO_GetConfigAddressSpace(wBoardNo,*wBase,*wIrq,
*wSubVendor,*wSubDevice,*wSubAux,*wSlotBus, *wSlotDevice)
•
wBoardNo=0 to N
Æ
The total number of boards using the PIO_DriverInit(...)
function
•
wBase
Æ
The base address of the board control word
•
wIrq
Æ
The allocated IRQ channel number for this board
•
wSubVendor
Æ
The subVendor ID of this board
•
wSubDevice
Æ
The subDevice ID of this board
•
wSubAux
Æ
The subAux ID of this board
•
wSlotBus
Æ
The bus number of the slot used by this board
•
wSlotDevice
Æ
The device number of the slot used by this board
The function can be used to save the resource information for all PIO/PISO
cards installed in this system. The application program can then directly control
all functions of the PIO/PISO series card.
Detect the configuration address space for your PIO-DA4/8/16 series cards
/* Step 1: Detect all PIO-DA4/8/16 series cards */
wSubVendor=0x80; wSubDevice=4; wSubAux=0x00;
/*For PIO_DA4/8/16
series cards */
wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux);
printf("There are %d PIO-DA16/8/4 Cards in this PC\n",wBoards);
/* Step 2: Save the resource information for all PIO-DA4/8/16 series cards
installed in this PC */
for (i=0; i<wBoards; i++)
{
PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&t1,&t2,&t3,&t4,&t5);
printf("\nCard_%d: wBase=%x, wIrq=%x", i,wBase,wIrq);
wConfigSpace[i][0]=wBaseAddress;
/*Save the resource information for this card*/
wConfigSpace[i][1]=wIrq;
/*Save the resource information for this card*/
}
PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
43