13
DRIVER INSTALLATION AND SETTING
Step 4.
To Access SMBus register , below shows standard Read/Write
scenarios. You refer to demo code that follow SMbus protocol
to complete the process.
void smbwrite(Data_BYTE device_id, Data_BYTE reg_no,
unsigned char data)
{
Data_BYTE err_no;
WriteAByte(SMBus_Host_Status, 0xFF);
Delay_T(1);
err_no = Check_SMBus_Ready();
if (err_no != 0) return;
WriteAByte(SMBus_Trans_Addr, device_id);
WriteAByte(SMBus_Host_Command, reg_no);
WriteAByte(SMBus_Host_Data0, data);
WriteAByte(SMBus_Host_Control, 0x48);
Delay_T(200);
Check_SMBus_Ready();
}