14
DRIVER INSTALLATION AND SETTING
©Vecow UE-1000 User Manual
Data_BYTE smbread(Data_BYTE device_id, Data_BYTE reg_no,
unsigned char *dat)
{
Data_BYTE err_no;
WriteAByte(SMBus_Host_Status, 0xff);
WriteAByte(SMBus_Host_Data0, 0x00);
err_no = Check_SMBus_Ready();
if (err_no != 0) return err_no;
WriteAByte(SMBus_Trans_Addr, de1);
WriteAByte(SMBus_Host_Command, reg_no);
WriteAByte(SMBus_Host_Control, 0x48);
Delay_T(20);
err_no = Check_SMBus_Ready();
if (err_no != 0) return err_no;
*dat = ReadAByte(SMBus_Host_Data0);
return (err_no); //Data 0
}