Sample program 2:
Identify all VXC cards in the PC
wRetVal=PIO_DriverInit(&wBoards,0xff,0xff,0xff);
/* identify all VXC cards */
printf("\nThere are %d VXC Cards in this PC",wBoards);
if (wBoards==0 ) exit(0);
printf("\n-----------------------------------------------------");
for(i=0; i<wBoards; i++)
{
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);
printf(" --> ");
ShowPioPiso(wSubVendor,wSubDevice,wSubAux);
}
4.1.2 PIO_GetConfigAddressSpace
PIO_GetConfigAddressSpace(wBoardNo,*wBase,*wIrq, *wSubVendor,
*wSubDevice,*wSubAux,*wSlotBus, *wSlotDevice)
•
wBoardNo
[IN] Board index number which between 0 and total boards –1.
•
wBase
[OUT] The base address of this board.
•
wIrq
[OUT] The IRQ channel number allocated to this board.
•
wSubVendor
[OUT] The sub-vendor ID for this board.
•
wSubDevice
[OUT] The sub-device ID for this board.
•
wSubAux
[OUT] The sub-aux ID for this board.
•
wSlotBus
[OUT] The hardware slot ID1 for this board.
•
wSlotDevice
[OUT] The hardware slot ID2 for this board.
The
PIO_GetConfigAddressSpace
function can be used to save the
resource information for all VXC cards installed in the system. The application
program can then directly control the functions of each VXC series card.
A sample program source is as follows:
VXC Cards User’s Manual (Ver. 1.1, 06/09.2005, pmh-012-01) -----30