3.1.2PIO_GetConfigAddressSpace

PIO_GetConfigAddressSpace(wBoardNo,*wBase,*wIrq, *wSubVendor, *wSubDevice,*wSubAux,*wSlotBus, *wSlotDevice)

wBoardNo=0 to N Æ totally N+1 boards found by PIO_DriveInit(….)

wBase

Æ base address of the board control word

wIrq

Æ allocated IRQ channel number of this board

wSubVendor Æ subVendor ID of this board

wSubDevice

Æ subDevice ID of this board

wSubAux

Æ subAux ID of this board

wSlotBus

Æ hardware slot ID1 of this board

wSlotDevice

Æ hardware slot ID2 of this board

The user can use this function to save resources of all OME-PIO/PISO cards installed in this system. Then the application program can control all functions of OME-PIO/PISO series card directly.

The sample program source is given as follows:

/* step1: detect all OME-PIO-D96 cards first */

wSubVendor=0x80; wSubDevice=1; wSubAux=0x10; /* for PIO_D96 */

wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux); printf("Threr are %d OME-PIO-D96 Cards in this PC\n",wBoards);

/* step2: save resource of all OME-PIO-D96cards 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 all resource of this card

*/

wConfigSpace[i][1]=wIrq;

/* save all resource of this card

*/

}

 

 

/* step3: control the OME-PIO-D96directly */

 

wBase=wConfigSpace[0][0];/* get base address the card_0

*/

outport(wBase,1);

/* enable all D/I/O operation of card_0

*/

wBase=wConfigSpace[1][0];/* get base address the card_1

*/

outport(wBase,1);

/* enable all D/I/O operation of card_1

*/

OME-PIO-D96 User Manual (Ver.1.1, Mar/2003)

---- 27

Page 29
Image 29
Omega Engineering OME-PIO-D96 manual PIOGetConfigAddressSpace, Enable all D/I/O operation of card0