Omega OME-PIO-D56 User Manual page 32

Pci-bus digital i/o board
Table of Contents

Advertisement

3.1.2
PIO_GetConfigAddressSpace
PIO_GetConfigAddressSpace(wBoardNo,*wBase,*wIrq, *wSubVendor,
• wBoardNo=0 to N
• wBase
• wIrq
• wSubVendor
• wSubDevice
• wSubAux
• wSlotBus
• wSlotDevice
The user can use this function to save resource 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 is given as follows:
/* step1: detect all OME-PIO-D56/OME-PIO-D24 cards first */
wSubVendor=0x80; wSubDevice=1; wSubAux=0x40; /*
D56/D24 */
wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux);
printf("There are %d OME-PIO-D56/OME-PIO-D24 Cards in this PC\n",wBoards);
/* step2: save resource of all OME-PIO-D56/OME-PIO-D24 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 all resource of this card
wConfigSpace[i][1]=wIrq;
}
/* step3: control the OME-PIO-D56/OME-PIO-D24 directly */
wBase=wConfigSpace[0][0];/* get base address the card_0
outport(wBase,1);
wBase=wConfigSpace[1][0];/* get base address the card_1
outport(wBase,1);
OME-PIO-D56/PIO-D24 User Manual (Ver.2.1, Oct/2003, PPH-005-21)
*wSubDevice,*wSubAux,*wSlotBus, *wSlotDevice)
totally N+1 boards found by PIO_DriveInit(....)
base address of the board control word
allocated IRQ channel number of this board
subVendor ID of this board
subDevice ID of this board
subAux ID of this board
hardware slot ID1 of this board
hardware slot ID2 of this board
/* save all resource of this card
/* enable all D/I/O operations of card_0
/* enable all D/I/O operations of card_1
for
OME-PIO-
*/
*/
*/
*/
*/
*/
---- 30

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ome-pio-d24

Table of Contents