User`s manual

- 64 -
Appendix
unsigned char iData;
unsigned char iFlag;
int iError = 0;
do
{
outportb(SMPORT+00, 0x1E);
iFlag = inportb(SMPORT+00);
if( iError++ > 0x8000 ) return 2;
}
while( ( iFlag & 0x9F ) != 0 );
outportb(SMPORT+04, DeviceID+1);
outportb(SMPORT+03, iREG_INDEX);
outportb(SMPORT+02, 0x48);
iError = 0;
do
{
if( iError++ > 0x8000)
return 2;
if( ( inportb(SMPORT+0x00) & 0x06 ) == 0x06 ) return 1;
}
while( (inportb(SMPORT+0x00) & 0x06 ) != 0x02 );
iData = inportb(SMPORT+05);
return iData;
}
void SMB_Byte_WRITE(int SMPORT, int DeviceID, int oREG_INDEX, int oREG_DATA)
{
unsigned char iFlag;
int iError = 0;
do
{
outportb(SMPORT+00, 0x1E);
iFlag = inportb(SMPORT+00);
if( iError++ > 0x8000 ) return;
}
while( ( iFlag & 0x9F ) != 0 );
outportb(SMPORT+04, DeviceID);
outportb(SMPORT+03, oREG_INDEX);
outportb(SMPORT+05, oREG_DATA);
outportb(SMPORT+02, 0x48);
iError = 0;
do
{
iError++;
if( iError > 0x8000)
return;
if( ( inportb(SMPORT+0x00) & 0x06 ) == 0x06 ) return;
}
while( (inportb(SMPORT+0x00) & 0x06 ) != 0x02 );
}