Omega OME-PIO-D144 manual PIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAux

Page 25

3.1.1PIO_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/ISOcards installed in this PC */

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);

}

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-D144cards installed in this PC */ for (i=0; i<wBoards; 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

Image 25
Contents User’sGuide Mexico CanadaBenelux Czech RepublicOME-PIO-D144 Table of Contents Demo Program All signals are TTL compatible SpecificationsProduct Check List Board Layout Hardware configurationI/O Port Location Enable I/O OperationRefer to DEMO1.C for demo program O Architecture Interrupt Operation If INT signal is Low now Æ select the non-inverted inputMake sure the initial level is High or Low Refer to DEMO3.C for source code Refer to DEMO4.C for source code CN1PC0 CN1PC1 CN1PC2 CN1PC3 If PC1 is active OME-DB-37 Daughter BoardsOME-DN-37 & OME-DN-50 OME-DB-8125OME-ADP-37/PCI & OME-ADP-50/PCI OME-PIO-D144 OME-DB-24P/24PD Isolated Input BoardOME-DB-24P OME-DB-24PD OME-DB-24R/24RD Relay Board OME-DB-24PR OME-DB-24PR/24POR/24CCOM OME-DB-24PR Daughter Board Comparison Table VCC Pin AssignmentGND OME-PIO-D144 User’s Manual Ver.2.1, Sep/2001 Resource-allocated information How to Find the I/O AddressPIO/PISO identification information PC’s physical slot informationOME-PISO-P32C32 OME-PIO-821OME-PISO-P32A32 OME-PISO-P8R8PIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAux PIODriverInitPIOGetConfigAddressSpace ShowPIOPISO Slot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07 Assignment of I/O AddressOME-PIO-D144 User’s Manual Ver.2.1, Sep/2001 RESET\ RESET\ Control RegisterI/O Address Map Address Read WriteAUX data Register AUX Control RegisterINT Mask Control Register CN1PC3 CN1PC2 CN1PC1 CN1PC0Interrupt Polarity Control Register Aux Status RegisterActive I/O Port Control Register Read/Write 8-bit data RegisterCN2PC CN2PB CN2PA CN1PC CN1PB CN1PA 9 I/O Selection Control RegisterCN4PC CN4PB CN4PA CN3PC CN3PB CN3PA CN6PC CN6PB CN6PA CN5PC CN5PB CN5PA\TC\LARGE\LIB\ \TC\LARGE\\TC\LARGE\DEMO?\ \TC\LARGE\LIB\PIO.HOME-PIO-D144.H Demo1 Use D/O of CN1 CN3 CN4 Demo2 Use D/O of CN1~CN6 PA/PB/PC COUNT=0 Demo3 Interrupt demo1Refer to Sec .5.1 for more information Demo4 Interrupt demo2 Refer to Sec .5.2 for more information Demo5 Interrupt demo3 CN1PC1 OME-PIO-D144 User’s Manual Ver.2.1, Sep/2001 Demo 6 Outport of CN1-CN6 OME-PIO-D144 User’s Manual Ver.2.1, Sep/2001 Demo10 Find Card Number OME-PIO-D144 User’s Manual Ver.2.1, Sep/2001 WARRANTY/DISCLAIMER Temperature