ICP DAS USA PCI-P16C16 User Manual

Page 33

Advertising
background image

dBaseAddress=_inpd(0xcfc);

wBaseAddr4=(WORD)(dBaseAddress&0xfffe);
wConfigSpace[wTotalBoards][4]=wBaseAddr4;


/*-------------------------------------------*/

WhichLong=9; /* Base Address 5 */

WriteAddress(Bus,Device,Function,WhichLong);
dBaseAddress=_inpd(0xcfc);

wBaseAddr5=(WORD)(dBaseAddress&0xfffe);

wConfigSpace[wTotalBoards][5]=wBaseAddr5;

/*---------- store the type name ID --------*/

wConfigSpace[wTotalBoards][6]=TYPE_P8R8;

wTotalBoards++; /* increment board number */

wGetAddress=1;

}
}
}
if( wTotalBoards>16 )
return( NotFoundBoard );
else
return( NoError );
}

void WriteAddress(UCHAR bBus, UCHAR bDevice, UCHAR bFunction,
UCHAR bWhichLong)
{
DWORD dOutData;
WORD HiWord,LoWord;
UCHAR HiByte,LoByte;

HiWord=0x8000|bBus;
HiByte=(bDevice<<3)|bFunction;
LoByte=(bWhichLong<<2) & 0xfc;
LoWord=( (WORD)HiByte<<8 )|LoByte;
dOutData=( (DWORD)HiWord<<16 ) | LoWord;
_outpd(0xcf8,dOutData);

PCI-P8R8/P16R16/P16C16/P16POR16 User’s Manual (Ver.2.2, 2005/5/5) …

33

Advertising
This manual is related to the following products: