beautypg.com

Pio_driverinit, 1 pio_driverinit – Omega OME-PIO-D144 User Manual

Page 25

background image

3.1.1 PIO_DriverInit


PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux)
• wBoards=0 to N Æ Number of boards found in this PC
• wSubVendor Æ SubVendor ID of board to find
• wSubDevice Æ SubDevice ID of board to find
• wSubAux Æ SubAux ID of board to find

This function can detect all OME-PIO/PISO series card in the system. It is

implemented based on the PCI Plug & Play mechanism. It will find all OME-
PIO/PISO series cards installed in this system & save all their resources in the library.


Find all PIO/PISO in this PC

/* Step 1:Detect all OME-PIO/PISO series in this PC */
wRetVal=PIO_DriverInit(&wBoards, 0xff, 0xff, 0xff); /*Find all OME-PIO_PISO*/
printf("\nThrer are %d OME-PIO_PISO Cards in this PC",wBoards);
if (wBoards==0 ) exit(0);

/* Step2: Save resource of all OME-PIO/ISO cards installed in this PC */
printf("\n-----------------------------------------------------");
for(i=0; 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);
}



Find all OME-PIO-D144 in this PC

/* Step1: Detect all OME-PIO-D144 cards first */
wSubVendor=0x80; wSubDevice=0x01; wSubAux=0x00; /* for PIO_D144 */
wRetVal=PIO_DriverInit(&wBoards, wSubVendor, wSubDevice, wSubAux);

printf("Threr are %d OME-PIO-D144 Cards in this PC\n",wBoards);

/* Step2: Save resource of all OME-PIO-D144 cards installed in this PC */
for (i=0; i {
PIO_GetConfigAddressSpace(i, &wBase, &wIrq, &wID1, &wID2, &wID3, &wID4, &wID5);
printf("\nCard_%d: wBase=%x, wIrq=%x", i, wBase, wIrq);
wConfigSpace[i][0]=wBaseAddress; /* save all resource of this card */
wConfigSpace[i][1]=wIrq; /* save all resource of this card */
}


OME-PIO-D144 User’s Manual (Ver.2.1, Sep/2001)

----- 23