Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // N o t e b o o k H a r d w a r e C o n t r o l A C P I D L L
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- //
- //
- // This file is provided "as is" with no expressed or implied warranty.
- // The authors accepts no liability for any damage/loss of business that
- // this product may cause.
- //
- //
- public static class Lenovo
- {
- #region Notebook Lenovo : class N200
- //
- // class author: Daniel Albers (Kontakt: www.P35-Forum.de "Hallo32") mit der Unterstützung von Yardi & ilikedirt (bei @ www.p35-forum.de)
- //
- //Version 1.0 (erste Final Version)
- //Modified for Lenovo N200 by AndySeven Version 0.21 http://www.thinkpad-forum.de/thread.php?threadid=33888
- public class N200
- {
- #region Thermal Zone class for CPU Temperature : class THRM
- //
- public static class THRM // If the name of the Thermal Zone class is the same as the name of an existing thermal zone in the system then NHC will overwrite the system thermal zone
- {
- // Info
- public const string description = "CPU Temperature"; // Description of current class
- public const bool default_enable = true; // false = By default the current class is disabled in NHC
- public const int icon = 5; // 0 = Hardware icon, 1 = Brightness icon, 2 = Fan icon, 3 = Battery icon, 4 = Audio icon, 5 = Temperature icon
- public const bool thermal_zone = true; // NHC will interpret this class as a Thermal Zone zone class if this value is true
- #region Value class for _TZ : class _TZ
- //
- public static class _TZ
- {
- // Properties of the value class
- public const string description = "Thermal Zone"; // Description of current value
- public const bool nhc_visible = true; // true -> value is visible in NHC
- // Value
- public static int _tz = 0; // It must have the same name as the class (case are ignored)
- public static int fan_on_modus = 0;
- public const string unit = "°C"; // unit of the example_value class.
- }
- //
- #endregion
- public const int refresh_interval=1; // Highspeed Fkt führt zu Fehlern, evtl. sehr langsamer EC
- public static bool refresh()
- {
- int max_temp=0;
- int cache1 = 0;
- int cache2 = 0;
- int cache3 = 0;
- if(ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref cache1, 0xB0, 8)==false) {return false;}
- if(ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref cache2, 0xB1, 8)==false) {return false;}
- if(ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref cache3, 0xB5, 8) == false) { return false; }
- max_temp = cache1;
- if (cache2 > max_temp)
- {
- max_temp = cache2;
- }
- if (cache3 > max_temp)
- {
- max_temp = cache3;
- }
- //if(ACPI.FIELD.ReadByOffset("_SB.PCI0.LPCB.EC0.ERAM", ref cache, 176, 8)==false) {return false;} // get TZ temperature
- if (cache1 != 45 && cache1 != 51 && cache1 != 61)
- {
- _TZ._tz = cache1;
- }
- if ((_TZ._tz <= FAN_CONFIG.FAN_ON_TEMP_MINIMUM.fan_on_temp_minimum) || _TZ.fan_on_modus == 0)
- {
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 45, 181, 8)==false) {return false;}
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 45, 177, 8)==false) {return false;}
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 45, 176, 8)==false) {return false;}
- _TZ.fan_on_modus = 0;
- }
- if ((_TZ._tz > FAN_CONFIG.FAN_ON_TEMP.fan_on_temp && _TZ._tz <= FAN_CONFIG.FAN_ON_TEMP.fan_on_temp + 5) || _TZ.fan_on_modus == 1)
- {
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 51, 181, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 51, 177, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 51, 176, 8) == false) { return false; }
- _TZ.fan_on_modus = 1;
- }
- if ((_TZ._tz > FAN_CONFIG.FAN_ON_TEMP.fan_on_temp + 5 && _TZ._tz<=70)|| _TZ.fan_on_modus == 2)
- {
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 61, 181, 8)==false) {return false;}
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 61, 177, 8)==false) {return false;}
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 61, 176, 8)==false) {return false;}
- _TZ.fan_on_modus = 2;
- }
- if ((_TZ._tz > 70 && _TZ._tz 80) || _TZ.fan_on_modus == 3)
- {
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 70, 181, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 70, 177, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 70, 176, 8) == false) { return false; }
- _TZ.fan_on_modus = 3;
- }
- if (_TZ._tz >= 80)
- {
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 90, 181, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 90, 177, 8) == false) { return false; }
- if (ACPI.FIELD.WriteByOffset("_SB.PCI0.LPCB.EC0.ERAM", 90, 176, 8) == false) { return false; }
- _TZ.fan_on_modus = 4;
- }
- return true;
- }
- }
- //
- #endregion
- #region
- public static class FAN_CONFIG
- {
- // Info
- public const string description = "FAN Config"; // Description of current class
- public const bool default_enable = true; // false = By default the current class is disabled in NHC
- public const int icon = 2; // 0 = Hardware icon, 1 = Brightness icon, 2 = Fan icon, 3 = Battery icon, 4 = Audio icon, 5 = Temperature icon
- #region Value class for FAN_ON_TEMP : class FAN_ON_TEMP
- //
- public static class FAN_ON_TEMP
- {
- // Properties of the value class
- public const string description = "FAN ON Temperature"; // Description of current value
- public const bool nhc_visible = true; // true -> value is visible in NHC
- // Value
- public static int fan_on_temp = 1; // It must have the same name as the class (case are ignored)
- public const string unit = "°C"; // unit of value
- // With this class it is possible to change the value in NHC on runtime
- public static class NHC_WRITE
- {
- public const bool nhc_write = true; // true -> it is possible to change the value in NHC
- public const int nhc_minimum_value = 45; // the minimum value
- public const int nhc_maximum_value = 65; // the maximum value 65 +5 = 70°
- public const int nhc_default_value = 57; // the default value
- }
- }
- public static class FAN_ON_TEMP_MINIMUM
- {
- // Properties of the value class
- public const string description = "FAN OFF Temperature"; // Description of current value
- public const bool nhc_visible = true; // true -> value is visible in NHC
- // Value
- public static int fan_on_temp_minimum = 1; // It must have the same name as the class (case are ignored)
- public const string unit = "°C"; // unit of value
- // With this class it is possible to change the value in NHC on runtime
- public static class NHC_WRITE
- {
- public const bool nhc_write = true; // true -> it is possible to change the value in NHC
- public const int nhc_minimum_value = 30; // the minimum value
- public const int nhc_maximum_value = 62; // the maximum value
- public const int nhc_default_value = 50; // the default value
- }
- }
- //
- #endregion
- }
- //
- #endregion
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement