The sample program is given as following:
/* step 1: find address-mapping of PIO/PISO cards */
clrscr();
wRetVal=PIO_DriverInit(&wBoards,0x80,0x01,0x30); /* for OME-PIO-D48 */
printf("\nThrer are %d PIO_D48 Cards in this PC",wBoards);
if (wBoards==0) exit(0);
printf("\n------------ The Configuration Space ----------------");
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);
}
/* select card_0 */
PIO_GetConfigAddressSpace(0,&wBase,&wIrq,&t1,&t2,&t3,&t4,&t5);
/* step 2: enable all D/I/O port */
outportb(wBase,1); /* enable D/I/O */
/* step 3: program 8255-1-PA-PB-PC as output port(first 3 port) */
outportb(wBase+0xcc,0x80);/* 8255-1-PA,PB,PC are all output port */
outportb(wBase+0xc0,0); /* 8255-1-PA initial value=0 */
outportb(wBase+0xc4,0); /* 8255-1-PB initial value=0 */
outportb(wBase+0xc8,0); /* 8255-1-PB initial value=0 */
/* step 4: program 8255-2-PA-PB-PC as output port(the other port)*/
outportb(wBase+0xdc,0x80);/* 8255-2-PA,PB,PC are all output port */
outportb(wBase+0xd0,0); /* 8255-2-PA initial value=0 */
outportb(wBase+0xd4,0); /* 8255-2-PB initial value=0 */
outportb(wBase+0xd8,0); /* 8255-2-PB initial value=0 */
OME-PIO-D48 User Manual, Sep/2000, V2.1 ----- 8