54
BOOL SMBus::SMBus_Busy()
{
// Check SMBus status if equal SMBHSTSTS_BUSY
if( (this->IO_Read(SMBHSTSTS) & SMBHSTSTS_BUSY ) == 1 )
return TRUE; // return true
else
return FALSE; // else retrun false
}
6. SMBus_Busy
void SMBus::IO_Write(WORD dwOffset, BYTE dwData)
{
// Set dwData value to assigned address
SetPortVal(this->m_MapIOdwOffset, dwData,1);
}
7. IO_Write
BYTE SMBus::IO_Read(WORD dwOffset)
{
DWORD dwAddrVal;
// Get dwAddrVal value from assigned address
GetPortVal(this->m_MapIOdwOffset,&dwAddrVal,1);
return (BYTE)(dwAddrVal & 0x0FF);
}
8. IO_Read
SMBus::SMBus()
{
this->m_MapIOAddress = 0x500;
}
9. Define SMBus IO address