F81801U Hardware Monitor under Linux

From LEXWiKi

(Difference between revisions)
Jump to: navigation, search
(New page: Category:AllowPages == The Sample code source you can download from == Source file: [ftp://ftp.lex.com.tw/Engineer/SoftSupport/AP_Module/HardwareMonitor/f81801u_hw_src.tar.gz f81801u_h...)
Line 14: Line 14:
$./configure
$./configure
$make
$make
-
$/src/f81801u_hw
+
$src/f81801u_hw
or double click f81801u_hw
or double click f81801u_hw

Revision as of 21:06, 16 September 2011

Contents

The Sample code source you can download from

Source file: f81801u_hw_src.tar.gz

About source code.

1.Install libgtk2.0-dev first

2.We suggest using Code::Blocks as an IDE in Linux.

3.Or you can just use "make" to compile the source code in the f81801u_hw_src/ folder or f81801u_hw_src/src/ folder.
  And you can excute "f81801u_hw" file in the f81801u_hw_src/src/ folder
 $cd f81801u_hw_src
 $./configure
 $make
 $src/f81801u_hw
 or double click f81801u_hw
If you want to execute the hardware monitor utility under user account , you can follow the procedure:

1.Login by user account.

2.go to the f81801u_hw_src/src folder
 $cd f81801u_hw_src/src/

3.copy the f81801u_hw into the ForUser folder
 $cp f81801u_hw ForUser

4.build SetForUser
 $gcc -o f81801u_hw SetForUser.c

5.change the file mode
 $sudo chown root.root f81801u_hw
 $sudo chmod 4755 f81801u_hw

6.then you can execute the hardware monitor utility
 $./f81801u_hw 
 or double click f81801u_hw

Binary file: f81801u_hw_bin.tar.gz

How to use the DEMO application

Image:f81801u_hw.JPG

  1. Press the "Read Value" button , and then you can find the values in the below text boxes.

Sample code Introduction

Define Registry

#define F81801U_DEFAULT_CHIP_ID_1	0x07
#define F81801U_DEFAULT_CHIP_ID_2	0x23
#define F81801U_CHIP_ID_1			0x20
#define F81801U_CHIP_ID_2			0x21
#define HW_MONITOR_INDEX			0x295
#define HW_MONITOR_DATA				0x296
#define CPU_FAN_MSB					0xA0
#define CPU_FAN_LSB					0xA1
#define F81801U_VOLTAGE_CORE		0x21
#define F81801U_VOLTAGE_3V			0x20
#define F81801U_VOLTAGE_VIN2		0x22
#define F81801U_VOLTAGE_VSB3V		0x27 
#define F81801U_VOLTAGE_VBAT		0x28 
#define F81801U_TEMPERATURE_SYSTEM	0x74
#define F81801U_TEMPERATURE_CPU		0x72

Open VT1211

outb(0x87,0x4E);
if ((F81801U_Read(F81801U_CHIP_ID_1) == F81801U_DEFAULT_CHIP_ID_1) && (F81801U_Read(F81801U_CHIP_ID_2) == F81801U_DEFAULT_CHIP_ID_2 ))
    return TRUE;		
else
    return FALSE;	

Read Data

DWORD dwPortVal;
outb(dwAddrVal,HW_MONITOR_INDEX);
dwPortVal = inb(HW_MONITOR_DATA);
return ( dwPortVal & 0x00FF);

GetTemperature

switch (dwAddrVal)
{
    case F81801U_TEMPERATURE_CPU:
        return F81801U_Read(F81801U_TEMPERATURE_CPU);
    case F81801U_TEMPERATURE_SYSTEM:
        return F81801U_Read(F81801U_TEMPERATURE_SYSTEM) ;
}

GetVoltage

switch (dwAddrVal)
{
    case F81801U_VOLTAGE_CORE:
        return (float)(F81801U_Read(F81801U_VOLTAGE_CORE)*0.8)/100;
    case F81801U_VOLTAGE_3V:
        return (float)(F81801U_Read(F81801U_VOLTAGE_3V)*1.6)/100;
    case F81801U_VOLTAGE_VIN2:
        return (float)(F81801U_Read(F81801U_VOLTAGE_VIN2)*0.8)/100;
    case F81801U_VOLTAGE_VSB3V:
        return (float)((F81801U_Read(F81801U_VOLTAGE_VSB3V)*1.6)/100);
    case F81801U_VOLTAGE_VBAT:
        return (float)((F81801U_Read(F81801U_VOLTAGE_VBAT)*1.6)/100);
}
Personal tools