📄 lm75.asl
字号:
//**********************************************************************;
// *****************************************************************;
// *****************************************************************;
// ** **;
// ** (C)Copyright 1985-1996, American Megatrends, Inc. **;
// ** **;
// ** All Rights Reserved. **;
// ** **;
// ** 6145-F Northbelt Pkwy, Norcross, GA 30071 **;
// ** **;
// ** Phone (770)-246-8600 **;
// ** **;
// *****************************************************************;
// *****************************************************************;
//**********************************************************************;
// DON'T CHANGE ANY CODE UNLESS REQUIRED !!!
//**********************************************************************;
// SMB support for LM75 thermal sensor
//**********************************************************************;
// change LM75 trip points
Method(TCHG, 0) {
Store(RBYT(TSAD, 0x00), Local0) // Read Current temp
/*
If(LGreaterEqual(Local0,TMAX)) {
Store(TCRT, Local1) // Tcrt
}
Else {
If(LGreaterEqual(Local0,TMIN)) {
Store(TMAX, Local1) // Thigh
}
Else {
Store(TMIN, Local1) // TLow
}
}
STOS(0,Local1) // Set Thigh
STHY(0, Add(Local0, 2)) // Set TLow T + 2.0C to arm the Thermal int
// Subtract(TMIN, 5, Local2) // Set Thyst as TMIN-5.0
// Add(Local0, 0x5, Local1) // Set Thigh T + 5.0 C
Subtract(Local0, 0x1, Local2) // Set Tlow T - 1.0 C
Subtract(TMIN, 0x5, Local3) // Set Tlow TMIN - 5.0 C
// If(LGreater(Local2,Local3))
// {
// Store(Local3, Local2)
// }
STHY(0,Local2) // Set TLow
*/
STOS(TCRT) // Set Thigh TCRT
STHY(Subtract(Local0, 5)) // Set TLow TMIN-5.0C
}
// Set configuration register
Method(SCFG, 1) {
// Arg0 = configuration byte
WBYT(TSAD, 0x01, Arg0)
}
// Set Tos register
Method(STOS, 1) {
// Arg0 = temperature word data
// Set pointer register (occupy the command byte) to 0x03
// Somehow LM75 wants to send out the MSB byte first !
WWRD(TSAD, 0x03, Arg0)
}
// Set Thyst register
Method(STHY, 1) {
// Arg0 = temperature word data
// Set pointer register (occupy the command byte) to 0x02
// Somehow LM75 wants to send out the MSB byte first !
WWRD(TSAD, 0x02, Arg0)
}
// Read temperature register
Method(RTMP, 0) {
// Set pointer register (occupy the command byte) to 0x00
Store(RWRD(TSAD, 0x00), Local0)
Store(Local0, DBG8)
// Somehow LM75 returns right byte first!
If(Not(Local0)) // Read command completed
{
Return( Local0 )
}
Else // Read command failed
{
Store("_TMP Read ERROR", Debug)
Return(Add(TMIN, 2)) // MIN trip point + 2.0 C
}
} // Method(RTMP)
// LM75 Thermal interrupt handler
Method(THDL,0) {
//**********************************************************************;
// Trip point handler
// TPOL status bit applys only for PIIX4 based design
OperationRegion(PMB0, SystemIO, \_SB.PCI0.PMU.PMBS(), 0x28)
Field(PMB0,ByteAcc,NoLock,Preserve){
,2,
TPOL,1, // 28.2h Thermal Polarity bit
}
If(TPOL)
// Temp goes up, Tos threshold being crossed
{
\GFAN._ON() // Turn FAN On
}
Else
// Temp goes down, Thyst threshold being crossed
{
\GFAN._OFF() // Turn FAN Off
}
TCHG() // Reevaluate Thigh/TLow for LM75
Not(TPOL,TPOL) // Toggle the Polarity pin
//**********************************************************************;
}
//**********************************************************************;
// *****************************************************************;
// *****************************************************************;
// ** **;
// ** (C)Copyright 1985-1996, American Megatrends, Inc. **;
// ** **;
// ** All Rights Reserved. **;
// ** **;
// ** 6145-F Northbelt Pkwy, Norcross, GA 30071 **;
// ** **;
// ** Phone (770)-246-8600 **;
// ** **;
// *****************************************************************;
// *****************************************************************;
//**********************************************************************;
// DON'T CHANGE ANY CODE UNLESS REQUIRED !!!
//**********************************************************************;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -