Fixed Issue 63.
1.1 --- a/Hardware/LPC/F718XX.cs Sat May 29 13:49:20 2010 +0000
1.2 +++ b/Hardware/LPC/F718XX.cs Thu Jun 03 22:40:18 2010 +0000
1.3 @@ -37,18 +37,18 @@
1.4
1.5 using System;
1.6 using System.Collections.Generic;
1.7 -using System.Drawing;
1.8 using System.Text;
1.9 +using OpenHardwareMonitor.Utilities;
1.10
1.11 namespace OpenHardwareMonitor.Hardware.LPC {
1.12 - public class F718XX : LPCHardware, IHardware {
1.13 + public class F718XX : ISuperIO {
1.14
1.15 private ushort address;
1.16 + private Chip chip;
1.17
1.18 - private Sensor[] temperatures;
1.19 - private Sensor[] fans;
1.20 - private Sensor[] voltages;
1.21 - private float[] voltageGains;
1.22 + private float?[] voltages;
1.23 + private float?[] temperatures;
1.24 + private float?[] fans;
1.25
1.26 // Hardware Monitor
1.27 private const byte ADDRESS_REGISTER_OFFSET = 0x05;
1.28 @@ -66,40 +66,21 @@
1.29 return WinRing0.ReadIoPortByte((ushort)(address + DATA_REGISTER_OFFSET));
1.30 }
1.31
1.32 - public F718XX(Chip chip, ushort address) : base(chip) {
1.33 + public F718XX(Chip chip, ushort address) {
1.34 this.address = address;
1.35 + this.chip = chip;
1.36
1.37 - temperatures = new Sensor[3];
1.38 - for (int i = 0; i < temperatures.Length; i++)
1.39 - temperatures[i] = new Sensor("Temperature #" + (i + 1), i, null,
1.40 - SensorType.Temperature, this, new ParameterDescription[] {
1.41 - new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
1.42 - });
1.43 -
1.44 - fans = new Sensor[chip == Chip.F71882 ? 4 : 3];
1.45 - for (int i = 0; i < fans.Length; i++)
1.46 - fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this);
1.47 -
1.48 - switch (chip) {
1.49 - case Chip.F71858:
1.50 - voltageGains = new float[] { 1, 1, 1 };
1.51 - voltages = new Sensor[3];
1.52 - voltages[0] = new Sensor("VCC3V", 0, SensorType.Voltage, this);
1.53 - voltages[1] = new Sensor("VSB3V", 1, SensorType.Voltage, this);
1.54 - voltages[2] = new Sensor("Battery", 2, SensorType.Voltage, this);
1.55 - break;
1.56 - default:
1.57 - voltageGains = new float[] { 1, 0.5f, 1, 1, 1, 1, 1, 1, 1 };
1.58 - voltages = new Sensor[4];
1.59 - voltages[0] = new Sensor("VCC3V", 0, SensorType.Voltage, this);
1.60 - voltages[1] = new Sensor("CPU VCore", 1, SensorType.Voltage, this);
1.61 - voltages[2] = new Sensor("VSB3V", 7, SensorType.Voltage, this);
1.62 - voltages[3] = new Sensor("Battery", 8, SensorType.Voltage, this);
1.63 - break;
1.64 - }
1.65 + voltages = new float?[chip == Chip.F71858 ? 3 : 9];
1.66 + temperatures = new float?[3];
1.67 + fans = new float?[chip == Chip.F71882 || chip == Chip.F71858? 4 : 3];
1.68 }
1.69
1.70 - public override string GetReport() {
1.71 + public Chip Chip { get { return chip; } }
1.72 + public float?[] Voltages { get { return voltages; } }
1.73 + public float?[] Temperatures { get { return temperatures; } }
1.74 + public float?[] Fans { get { return fans; } }
1.75 +
1.76 + public string GetReport() {
1.77 StringBuilder r = new StringBuilder();
1.78
1.79 r.AppendLine("LPC " + this.GetType().Name);
1.80 @@ -123,23 +104,21 @@
1.81 return r.ToString();
1.82 }
1.83
1.84 - public override void Update() {
1.85 + public void Update() {
1.86
1.87 - foreach (Sensor sensor in voltages) {
1.88 - int value = ReadByte((byte)(VOLTAGE_BASE_REG + sensor.Index));
1.89 - sensor.Value = voltageGains[sensor.Index] * 0.001f * (value << 4);
1.90 - if (sensor.Value > 0)
1.91 - ActivateSensor(sensor);
1.92 + for (int i = 0; i < voltages.Length; i++) {
1.93 + int value = ReadByte((byte)(VOLTAGE_BASE_REG + i));
1.94 + voltages[i] = 0.001f * (value << 4);
1.95 }
1.96
1.97 - foreach (Sensor sensor in temperatures) {
1.98 + for (int i = 0; i < temperatures.Length; i++) {
1.99 switch (chip) {
1.100 case Chip.F71858: {
1.101 int tableMode = 0x3 & ReadByte((byte)(TEMPERATURE_CONFIG_REG));
1.102 int high =
1.103 - ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index));
1.104 + ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * i));
1.105 int low =
1.106 - ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index + 1));
1.107 + ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * i + 1));
1.108 if (high != 0xbb && high != 0xcc) {
1.109 int bits = 0;
1.110 switch (tableMode) {
1.111 @@ -151,33 +130,30 @@
1.112 bits |= high << 7;
1.113 bits |= (low & 0xe0) >> 1;
1.114 short value = (short)(bits & 0xfff0);
1.115 - sensor.Value = value / 128.0f;
1.116 - ActivateSensor(sensor);
1.117 + temperatures[i] = value / 128.0f;
1.118 } else {
1.119 - sensor.Value = null;
1.120 + temperatures[i] = null;
1.121 }
1.122 } break;
1.123 default: {
1.124 sbyte value = (sbyte)ReadByte((byte)(
1.125 - TEMPERATURE_BASE_REG + 2 * (sensor.Index + 1)));
1.126 - sensor.Value = value + sensor.Parameters[0].Value;
1.127 + TEMPERATURE_BASE_REG + 2 * (i + 1)));
1.128 if (value < sbyte.MaxValue && value > 0)
1.129 - ActivateSensor(sensor);
1.130 + temperatures[i] = value;
1.131 + else
1.132 + temperatures[i] = null;
1.133 } break;
1.134 }
1.135 }
1.136
1.137 - foreach (Sensor sensor in fans) {
1.138 - int value = ReadByte(FAN_TACHOMETER_REG[sensor.Index]) << 8;
1.139 - value |= ReadByte((byte)(FAN_TACHOMETER_REG[sensor.Index] + 1));
1.140 + for (int i = 0; i < fans.Length; i++) {
1.141 + int value = ReadByte(FAN_TACHOMETER_REG[i]) << 8;
1.142 + value |= ReadByte((byte)(FAN_TACHOMETER_REG[i] + 1));
1.143
1.144 - if (value > 0) {
1.145 - sensor.Value = (value < 0x0fff) ? 1.5e6f / value : 0;
1.146 - if (sensor.Value > 0)
1.147 - ActivateSensor(sensor);
1.148 - } else {
1.149 - sensor.Value = null;
1.150 - }
1.151 + if (value > 0)
1.152 + fans[i] = (value < 0x0fff) ? 1.5e6f / value : 0;
1.153 + else
1.154 + fans[i] = null;
1.155 }
1.156 }
1.157 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/Hardware/LPC/ISuperIO.cs Thu Jun 03 22:40:18 2010 +0000
2.3 @@ -0,0 +1,54 @@
2.4 +/*
2.5 +
2.6 + Version: MPL 1.1/GPL 2.0/LGPL 2.1
2.7 +
2.8 + The contents of this file are subject to the Mozilla Public License Version
2.9 + 1.1 (the "License"); you may not use this file except in compliance with
2.10 + the License. You may obtain a copy of the License at
2.11 +
2.12 + http://www.mozilla.org/MPL/
2.13 +
2.14 + Software distributed under the License is distributed on an "AS IS" basis,
2.15 + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2.16 + for the specific language governing rights and limitations under the License.
2.17 +
2.18 + The Original Code is the Open Hardware Monitor code.
2.19 +
2.20 + The Initial Developer of the Original Code is
2.21 + Michael Möller <m.moeller@gmx.ch>.
2.22 + Portions created by the Initial Developer are Copyright (C) 2009-2010
2.23 + the Initial Developer. All Rights Reserved.
2.24 +
2.25 + Contributor(s):
2.26 +
2.27 + Alternatively, the contents of this file may be used under the terms of
2.28 + either the GNU General Public License Version 2 or later (the "GPL"), or
2.29 + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2.30 + in which case the provisions of the GPL or the LGPL are applicable instead
2.31 + of those above. If you wish to allow use of your version of this file only
2.32 + under the terms of either the GPL or the LGPL, and not to allow others to
2.33 + use your version of this file under the terms of the MPL, indicate your
2.34 + decision by deleting the provisions above and replace them with the notice
2.35 + and other provisions required by the GPL or the LGPL. If you do not delete
2.36 + the provisions above, a recipient may use your version of this file under
2.37 + the terms of any one of the MPL, the GPL or the LGPL.
2.38 +
2.39 +*/
2.40 +
2.41 +using System;
2.42 +using System.Collections.Generic;
2.43 +using OpenHardwareMonitor.Utilities;
2.44 +
2.45 +namespace OpenHardwareMonitor.Hardware.LPC {
2.46 + public interface ISuperIO {
2.47 +
2.48 + Chip Chip { get; }
2.49 +
2.50 + float?[] Voltages { get; }
2.51 + float?[] Temperatures { get; }
2.52 + float?[] Fans { get; }
2.53 +
2.54 + string GetReport();
2.55 + void Update();
2.56 + }
2.57 +}
3.1 --- a/Hardware/LPC/IT87XX.cs Sat May 29 13:49:20 2010 +0000
3.2 +++ b/Hardware/LPC/IT87XX.cs Thu Jun 03 22:40:18 2010 +0000
3.3 @@ -41,17 +41,17 @@
3.4 using System.Text;
3.5
3.6 namespace OpenHardwareMonitor.Hardware.LPC {
3.7 - public class IT87XX : LPCHardware, IHardware {
3.8 -
3.9 - private bool available = false;
3.10 + public class IT87XX : ISuperIO {
3.11 +
3.12 private ushort address;
3.13 + private Chip chip;
3.14
3.15 private readonly ushort addressReg;
3.16 private readonly ushort dataReg;
3.17
3.18 - private List<Sensor> voltages = new List<Sensor>(9);
3.19 - private List<Sensor> temperatures = new List<Sensor>(3);
3.20 - private Sensor[] fans;
3.21 + private float?[] voltages = new float?[0];
3.22 + private float?[] temperatures = new float?[0];
3.23 + private float?[] fans = new float?[0];
3.24
3.25 // Consts
3.26 private const byte ITE_VENDOR_ID = 0x90;
3.27 @@ -78,10 +78,10 @@
3.28 return value;
3.29 }
3.30
3.31 - public IT87XX(Chip chip, ushort address, Mainboard.Manufacturer
3.32 - mainboardManufacturer, Mainboard.Model mainboardModel) : base (chip) {
3.33 + public IT87XX(Chip chip, ushort address) {
3.34
3.35 this.address = address;
3.36 + this.chip = chip;
3.37 this.addressReg = (ushort)(address + ADDRESS_REGISTER_OFFSET);
3.38 this.dataReg = (ushort)(address + DATA_REGISTER_OFFSET);
3.39
3.40 @@ -97,140 +97,22 @@
3.41 if (!valid)
3.42 return;
3.43
3.44 - string[] temperatureLabels;
3.45 - List<Voltage> voltageConfigs = new List<Voltage>();
3.46 - switch (mainboardManufacturer) {
3.47 - case Mainboard.Manufacturer.DFI:
3.48 - switch (mainboardModel) {
3.49 - case Mainboard.Model.LP_BI_P45_T2RS_Elite:
3.50 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.51 - voltageConfigs.Add(new Voltage("FSB VTT", 1));
3.52 - voltageConfigs.Add(new Voltage("+3.3V", 2));
3.53 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
3.54 - voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0));
3.55 - voltageConfigs.Add(new Voltage("NB Core", 5));
3.56 - voltageConfigs.Add(new Voltage("VDIMM", 6));
3.57 - voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
3.58 - voltageConfigs.Add(new Voltage("VBat", 8));
3.59 - temperatureLabels = new string[] {
3.60 - "CPU", "System", "Chipset" };
3.61 - break;
3.62 - case Mainboard.Model.LP_DK_P55_T3eH9:
3.63 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.64 - voltageConfigs.Add(new Voltage("VTT", 1));
3.65 - voltageConfigs.Add(new Voltage("+3.3V", 2));
3.66 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
3.67 - voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0));
3.68 - voltageConfigs.Add(new Voltage("CPU PLL", 5));
3.69 - voltageConfigs.Add(new Voltage("DRAM", 6));
3.70 - voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
3.71 - voltageConfigs.Add(new Voltage("VBat", 8));
3.72 - temperatureLabels = new string[] {
3.73 - "Chipset", "CPU PWM", "CPU" };
3.74 - break;
3.75 - default:
3.76 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.77 - voltageConfigs.Add(new Voltage("VTT", 1, true));
3.78 - voltageConfigs.Add(new Voltage("+3.3V", 2, true));
3.79 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
3.80 - voltageConfigs.Add(new Voltage("+12V", 4, 30, 10, 0, true));
3.81 - voltageConfigs.Add(new Voltage("Voltage #6", 5, true));
3.82 - voltageConfigs.Add(new Voltage("DRAM", 6, true));
3.83 - voltageConfigs.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
3.84 - voltageConfigs.Add(new Voltage("VBat", 8));
3.85 - temperatureLabels = new string[] {
3.86 - "Temperature #1", "Temperature #2", "Temperature #3" };
3.87 - break;
3.88 - }
3.89 - break;
3.90 -
3.91 - case Mainboard.Manufacturer.Gigabyte:
3.92 - switch (mainboardModel) {
3.93 - case Mainboard.Model.EP45_DS3R:
3.94 - case Mainboard.Model.P35_DS3:
3.95 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.96 - voltageConfigs.Add(new Voltage("DRAM", 1));
3.97 - voltageConfigs.Add(new Voltage("+3.3V", 2));
3.98 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
3.99 - voltageConfigs.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
3.100 - voltageConfigs.Add(new Voltage("VBat", 8));
3.101 - break;
3.102 - case Mainboard.Model.GA_MA785GMT_UD2H:
3.103 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.104 - voltageConfigs.Add(new Voltage("DRAM", 1));
3.105 - voltageConfigs.Add(new Voltage("+3.3V", 2));
3.106 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
3.107 - voltageConfigs.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
3.108 - voltageConfigs.Add(new Voltage("VBat", 8));
3.109 - break;
3.110 - default:
3.111 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.112 - voltageConfigs.Add(new Voltage("DRAM", 1, true));
3.113 - voltageConfigs.Add(new Voltage("+3.3V", 2, true));
3.114 - voltageConfigs.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
3.115 - voltageConfigs.Add(new Voltage("Voltage #5", 4, true));
3.116 - voltageConfigs.Add(new Voltage("Voltage #6", 5, true));
3.117 - voltageConfigs.Add(new Voltage("Voltage #7", 6, true));
3.118 - voltageConfigs.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
3.119 - voltageConfigs.Add(new Voltage("VBat", 8));
3.120 - break;
3.121 - }
3.122 - temperatureLabels = new string[] { "System", "CPU" };
3.123 - break;
3.124 -
3.125 - default:
3.126 - voltageConfigs.Add(new Voltage("CPU VCore", 0));
3.127 - voltageConfigs.Add(new Voltage("Voltage #2", 1, true));
3.128 - voltageConfigs.Add(new Voltage("Voltage #3", 2, true));
3.129 - voltageConfigs.Add(new Voltage("Voltage #4", 3, true));
3.130 - voltageConfigs.Add(new Voltage("Voltage #5", 4, true));
3.131 - voltageConfigs.Add(new Voltage("Voltage #6", 5, true));
3.132 - voltageConfigs.Add(new Voltage("Voltage #7", 6, true));
3.133 - voltageConfigs.Add(new Voltage("Voltage #8", 7, true));
3.134 - voltageConfigs.Add(new Voltage("VBat", 8));
3.135 - temperatureLabels = new string[] {
3.136 - "Temperature #1", "Temperature #2", "Temperature #3" };
3.137 - break;
3.138 - }
3.139 -
3.140 - string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
3.141 - foreach (Voltage voltage in voltageConfigs)
3.142 - voltages.Add(new Sensor(voltage.Name, voltage.Index, voltage.Hidden,
3.143 - null, SensorType.Voltage, this, new ParameterDescription[] {
3.144 - new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
3.145 - formula, voltage.Ri),
3.146 - new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
3.147 - formula, voltage.Rf),
3.148 - new ParameterDescription("Vf [V]", "Reference voltage.\n" +
3.149 - formula, voltage.Vf)
3.150 - }));
3.151 -
3.152 - for (int i = 0; i < temperatureLabels.Length; i++)
3.153 - if (temperatureLabels[i] != null) {
3.154 - temperatures.Add(new Sensor(temperatureLabels[i], i, null,
3.155 - SensorType.Temperature, this, new ParameterDescription[] {
3.156 - new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
3.157 - }));
3.158 - }
3.159 -
3.160 - fans = new Sensor[5];
3.161 - for (int i = 0; i < fans.Length; i++)
3.162 - fans[i] = new Sensor("Fan #" + (i + 1), i, SensorType.Fan, this);
3.163 -
3.164 - available = true;
3.165 + voltages = new float?[9];
3.166 + temperatures = new float?[3];
3.167 + fans = new float?[5];
3.168 }
3.169
3.170 - public bool IsAvailable {
3.171 - get { return available; }
3.172 - }
3.173 + public Chip Chip { get { return chip; } }
3.174 + public float?[] Voltages { get { return voltages; } }
3.175 + public float?[] Temperatures { get { return temperatures; } }
3.176 + public float?[] Fans { get { return fans; } }
3.177
3.178 - public override string GetReport() {
3.179 + public string GetReport() {
3.180 StringBuilder r = new StringBuilder();
3.181
3.182 r.AppendLine("LPC " + this.GetType().Name);
3.183 r.AppendLine();
3.184 r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X"));
3.185 - r.Append("Chip Name: "); r.AppendLine(name);
3.186 r.Append("Base Address: 0x"); r.AppendLine(address.ToString("X4"));
3.187 r.AppendLine();
3.188 r.AppendLine("Environment Controller Registers");
3.189 @@ -256,79 +138,48 @@
3.190 return r.ToString();
3.191 }
3.192
3.193 - public override void Update() {
3.194 + public void Update() {
3.195
3.196 - foreach (Sensor sensor in voltages) {
3.197 + for (int i = 0; i < voltages.Length; i++) {
3.198 bool valid;
3.199 float value = 0.001f * ((int)ReadByte(
3.200 - (byte)(VOLTAGE_BASE_REG + sensor.Index), out valid) << 4);
3.201 + (byte)(VOLTAGE_BASE_REG + i), out valid) << 4);
3.202 + if (!valid)
3.203 + continue;
3.204 + if (value > 0)
3.205 + voltages[i] = value;
3.206 + else
3.207 + voltages[i] = null;
3.208 + }
3.209 +
3.210 + for (int i = 0; i < temperatures.Length; i++) {
3.211 + bool valid;
3.212 + sbyte value = (sbyte)ReadByte(
3.213 + (byte)(TEMPERATURE_BASE_REG + i), out valid);
3.214 if (!valid)
3.215 continue;
3.216
3.217 - sensor.Value = value + (value - sensor.Parameters[2].Value) *
3.218 - sensor.Parameters[0].Value / sensor.Parameters[1].Value;
3.219 - if (value > 0)
3.220 - ActivateSensor(sensor);
3.221 + if (value < sbyte.MaxValue && value > 0)
3.222 + temperatures[i] = value;
3.223 + else
3.224 + temperatures[i] = null;
3.225 }
3.226
3.227 - foreach (Sensor sensor in temperatures) {
3.228 + for (int i = 0; i < fans.Length; i++) {
3.229 bool valid;
3.230 - sbyte value = (sbyte)ReadByte(
3.231 - (byte)(TEMPERATURE_BASE_REG + sensor.Index), out valid);
3.232 - if (!valid)
3.233 - continue;
3.234 -
3.235 - sensor.Value = value + sensor.Parameters[0].Value;
3.236 - if (value < sbyte.MaxValue && value > 0)
3.237 - ActivateSensor(sensor);
3.238 - }
3.239 -
3.240 - foreach (Sensor sensor in fans) {
3.241 - bool valid;
3.242 - int value = ReadByte(FAN_TACHOMETER_REG[sensor.Index], out valid);
3.243 + int value = ReadByte(FAN_TACHOMETER_REG[i], out valid);
3.244 if (!valid)
3.245 continue;
3.246 - value |= ReadByte(FAN_TACHOMETER_EXT_REG[sensor.Index], out valid) << 8;
3.247 + value |= ReadByte(FAN_TACHOMETER_EXT_REG[i], out valid) << 8;
3.248 if (!valid)
3.249 continue;
3.250
3.251 if (value > 0x3f) {
3.252 - sensor.Value = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0;
3.253 - if (sensor.Value > 0)
3.254 - ActivateSensor(sensor);
3.255 + fans[i] = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0;
3.256 } else {
3.257 - sensor.Value = null;
3.258 + fans[i] = null;
3.259 }
3.260 }
3.261 }
3.262 -
3.263 - private class Voltage {
3.264 - public readonly string Name;
3.265 - public readonly int Index;
3.266 - public readonly float Ri;
3.267 - public readonly float Rf;
3.268 - public readonly float Vf;
3.269 - public readonly bool Hidden;
3.270 -
3.271 - public Voltage(string name, int index) :
3.272 - this(name, index, 0, 1, 0, false) { }
3.273 -
3.274 - public Voltage(string name, int index, bool hidden) :
3.275 - this(name, index, 0, 1, 0, hidden) { }
3.276 -
3.277 - public Voltage(string name, int index, float ri, float rf, float vf) :
3.278 - this(name, index, ri, rf, vf, false) { }
3.279 -
3.280 - public Voltage(string name, int index, float ri, float rf, float vf,
3.281 - bool hidden)
3.282 - {
3.283 - this.Name = name;
3.284 - this.Index = index;
3.285 - this.Ri = ri;
3.286 - this.Rf = rf;
3.287 - this.Vf = vf;
3.288 - this.Hidden = hidden;
3.289 - }
3.290 - }
3.291 - }
3.292 + }
3.293 }
4.1 --- a/Hardware/LPC/LPCHardware.cs Sat May 29 13:49:20 2010 +0000
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,88 +0,0 @@
4.4 -/*
4.5 -
4.6 - Version: MPL 1.1/GPL 2.0/LGPL 2.1
4.7 -
4.8 - The contents of this file are subject to the Mozilla Public License Version
4.9 - 1.1 (the "License"); you may not use this file except in compliance with
4.10 - the License. You may obtain a copy of the License at
4.11 -
4.12 - http://www.mozilla.org/MPL/
4.13 -
4.14 - Software distributed under the License is distributed on an "AS IS" basis,
4.15 - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
4.16 - for the specific language governing rights and limitations under the License.
4.17 -
4.18 - The Original Code is the Open Hardware Monitor code.
4.19 -
4.20 - The Initial Developer of the Original Code is
4.21 - Michael Möller <m.moeller@gmx.ch>.
4.22 - Portions created by the Initial Developer are Copyright (C) 2009-2010
4.23 - the Initial Developer. All Rights Reserved.
4.24 -
4.25 - Contributor(s):
4.26 -
4.27 - Alternatively, the contents of this file may be used under the terms of
4.28 - either the GNU General Public License Version 2 or later (the "GPL"), or
4.29 - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
4.30 - in which case the provisions of the GPL or the LGPL are applicable instead
4.31 - of those above. If you wish to allow use of your version of this file only
4.32 - under the terms of either the GPL or the LGPL, and not to allow others to
4.33 - use your version of this file under the terms of the MPL, indicate your
4.34 - decision by deleting the provisions above and replace them with the notice
4.35 - and other provisions required by the GPL or the LGPL. If you do not delete
4.36 - the provisions above, a recipient may use your version of this file under
4.37 - the terms of any one of the MPL, the GPL or the LGPL.
4.38 -
4.39 -*/
4.40 -
4.41 -using System;
4.42 -using System.Collections.Generic;
4.43 -using System.Drawing;
4.44 -
4.45 -namespace OpenHardwareMonitor.Hardware.LPC {
4.46 - public abstract class LPCHardware : Hardware {
4.47 -
4.48 - private Image icon;
4.49 - protected readonly string name;
4.50 - protected readonly Chip chip;
4.51 -
4.52 - public LPCHardware(Chip chip) {
4.53 - this.chip = chip;
4.54 - this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
4.55 -
4.56 - switch (chip) {
4.57 - case Chip.F71858: name = "Fintek F71858"; break;
4.58 - case Chip.F71862: name = "Fintek F71862"; break;
4.59 - case Chip.F71869: name = "Fintek F71869"; break;
4.60 - case Chip.F71882: name = "Fintek F71882"; break;
4.61 - case Chip.F71889ED: name = "Fintek F71889ED"; break;
4.62 - case Chip.F71889F: name = "Fintek F71889F"; break;
4.63 - case Chip.IT8712F: this.name = "ITE IT8712F"; break;
4.64 - case Chip.IT8716F: this.name = "ITE IT8716F"; break;
4.65 - case Chip.IT8718F: this.name = "ITE IT8718F"; break;
4.66 - case Chip.IT8720F: this.name = "ITE IT8720F"; break;
4.67 - case Chip.IT8726F: this.name = "ITE IT8726F"; break;
4.68 - case Chip.W83627DHG: this.name = "Winbond W83627DHG"; break;
4.69 - case Chip.W83627DHGP: this.name = "Winbond W83627DHG-P"; break;
4.70 - case Chip.W83627EHF: this.name = "Winbond W83627EHF"; break;
4.71 - case Chip.W83627HF: this.name = "Winbond W83627HF"; break;
4.72 - case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
4.73 - case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
4.74 - case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
4.75 - case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
4.76 - }
4.77 - }
4.78 -
4.79 - public override Identifier Identifier {
4.80 - get { return new Identifier("lpc", chip.ToString().ToLower()); }
4.81 - }
4.82 -
4.83 - public override Image Icon {
4.84 - get { return icon; }
4.85 - }
4.86 -
4.87 - public override string Name {
4.88 - get { return name; }
4.89 - }
4.90 - }
4.91 -}
5.1 --- a/Hardware/LPC/LPCIO.cs Sat May 29 13:49:20 2010 +0000
5.2 +++ b/Hardware/LPC/LPCIO.cs Thu Jun 03 22:40:18 2010 +0000
5.3 @@ -43,7 +43,7 @@
5.4 namespace OpenHardwareMonitor.Hardware.LPC {
5.5 public class LPCIO {
5.6
5.7 - private List<IHardware> hardware = new List<IHardware>();
5.8 + private List<ISuperIO> superIOs = new List<ISuperIO>();
5.9 private StringBuilder report = new StringBuilder();
5.10
5.11 private Chip chip = Chip.Unknown;
5.12 @@ -87,7 +87,7 @@
5.13 WinRing0.WriteIoPortByte(registerPort, 0x55);
5.14 }
5.15
5.16 - internal void IT87Exit() {
5.17 + private void IT87Exit() {
5.18 WinRing0.WriteIoPortByte(registerPort, CONFIGURATION_CONTROL_REGISTER);
5.19 WinRing0.WriteIoPortByte(valuePort, 0x02);
5.20 }
5.21 @@ -119,9 +119,7 @@
5.22 WinRing0.WriteIoPortByte(registerPort, 0xAA);
5.23 }
5.24
5.25 - public LPCIO(Mainboard.Manufacturer mainboardManufacturer,
5.26 - Mainboard.Model mainboardModel)
5.27 - {
5.28 + public LPCIO() {
5.29 if (!WinRing0.IsAvailable)
5.30 return;
5.31
5.32 @@ -289,9 +287,7 @@
5.33 case Chip.W83667HG:
5.34 case Chip.W83667HGB:
5.35 case Chip.W83687THF:
5.36 - W836XX w836XX = new W836XX(chip, revision, address);
5.37 - if (w836XX.IsAvailable)
5.38 - hardware.Add(w836XX);
5.39 + superIOs.Add(new W836XX(chip, revision, address));
5.40 break;
5.41 case Chip.F71858:
5.42 case Chip.F71862:
5.43 @@ -309,7 +305,7 @@
5.44 report.AppendLine();
5.45 return;
5.46 }
5.47 - hardware.Add(new F718XX(chip, address));
5.48 + superIOs.Add(new F718XX(chip, address));
5.49 break;
5.50 default: break;
5.51 }
5.52 @@ -353,10 +349,7 @@
5.53 return;
5.54 }
5.55
5.56 - IT87XX it87 = new IT87XX(chip, address, mainboardManufacturer,
5.57 - mainboardModel);
5.58 - if (it87.IsAvailable)
5.59 - hardware.Add(it87);
5.60 + superIOs.Add(new IT87XX(chip, address));
5.61
5.62 return;
5.63 }
5.64 @@ -383,9 +376,9 @@
5.65 }
5.66 }
5.67
5.68 - public IHardware[] Hardware {
5.69 + public ISuperIO[] SuperIO {
5.70 get {
5.71 - return hardware.ToArray();
5.72 + return superIOs.ToArray();
5.73 }
5.74 }
5.75
6.1 --- a/Hardware/LPC/W836XX.cs Sat May 29 13:49:20 2010 +0000
6.2 +++ b/Hardware/LPC/W836XX.cs Thu Jun 03 22:40:18 2010 +0000
6.3 @@ -37,23 +37,24 @@
6.4
6.5 using System;
6.6 using System.Collections.Generic;
6.7 -using System.Drawing;
6.8 using System.Text;
6.9
6.10 namespace OpenHardwareMonitor.Hardware.LPC {
6.11 - public class W836XX : LPCHardware, IHardware {
6.12 + public class W836XX : ISuperIO {
6.13
6.14 private ushort address;
6.15 private byte revision;
6.16
6.17 - private bool available;
6.18 + private Chip chip;
6.19
6.20 - private Sensor[] temperatures;
6.21 - private Sensor[] fans;
6.22 - private Sensor[] voltages;
6.23 + private float?[] voltages = new float?[0];
6.24 + private float?[] temperatures = new float?[0];
6.25 + private float?[] fans = new float?[0];
6.26
6.27 - private float[] voltageGains;
6.28 - private string[] fanNames;
6.29 + private bool[] peciTemperature = new bool[0];
6.30 + private byte[] voltageRegister = new byte[0];
6.31 + private byte[] voltageBank = new byte[0];
6.32 + private float voltageGain = 0.008f;
6.33
6.34 // Consts
6.35 private const ushort WINBOND_VENDOR_ID = 0x5CA3;
6.36 @@ -64,13 +65,11 @@
6.37 private const byte DATA_REGISTER_OFFSET = 0x06;
6.38
6.39 // Hardware Monitor Registers
6.40 - private const byte VOLTAGE_BASE_REG = 0x20;
6.41 + private const byte VOLTAGE_VBAT_REG = 0x51;
6.42 private const byte BANK_SELECT_REGISTER = 0x4E;
6.43 private const byte VENDOR_ID_REGISTER = 0x4F;
6.44 private const byte TEMPERATURE_SOURCE_SELECT_REG = 0x49;
6.45
6.46 - private string[] TEMPERATURE_NAME =
6.47 - new string[] {"CPU", "Auxiliary", "System"};
6.48 private byte[] TEMPERATURE_REG = new byte[] { 0x50, 0x50, 0x27 };
6.49 private byte[] TEMPERATURE_BANK = new byte[] { 1, 2, 0 };
6.50
6.51 @@ -90,7 +89,7 @@
6.52 (ushort)(address + ADDRESS_REGISTER_OFFSET), register);
6.53 return WinRing0.ReadIoPortByte(
6.54 (ushort)(address + DATA_REGISTER_OFFSET));
6.55 - }
6.56 + }
6.57
6.58 private void WriteByte(byte bank, byte register, byte value) {
6.59 WinRing0.WriteIoPortByte(
6.60 @@ -103,90 +102,73 @@
6.61 (ushort)(address + DATA_REGISTER_OFFSET), value);
6.62 }
6.63
6.64 - public W836XX(Chip chip, byte revision, ushort address)
6.65 - : base(chip)
6.66 - {
6.67 + public W836XX(Chip chip, byte revision, ushort address) {
6.68 this.address = address;
6.69 this.revision = revision;
6.70 + this.chip = chip;
6.71
6.72 - available = IsWinbondVendor();
6.73 -
6.74 - ParameterDescription[] parameter = new ParameterDescription[] {
6.75 - new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
6.76 - };
6.77 - List<Sensor> list = new List<Sensor>();
6.78 + if (!IsWinbondVendor())
6.79 + return;
6.80 +
6.81 + temperatures = new float?[3];
6.82 + peciTemperature = new bool[3];
6.83 switch (chip) {
6.84 case Chip.W83667HG:
6.85 case Chip.W83667HGB:
6.86 - // do not add temperature sensor registers that read PECI
6.87 + // note temperature sensor registers that read PECI
6.88 byte flag = ReadByte(0, TEMPERATURE_SOURCE_SELECT_REG);
6.89 - if ((flag & 0x04) == 0)
6.90 - list.Add(new Sensor(TEMPERATURE_NAME[0], 0, null,
6.91 - SensorType.Temperature, this, parameter));
6.92 - if ((flag & 0x40) == 0)
6.93 - list.Add(new Sensor(TEMPERATURE_NAME[1], 1, null,
6.94 - SensorType.Temperature, this, parameter));
6.95 - list.Add(new Sensor(TEMPERATURE_NAME[2], 2, null,
6.96 - SensorType.Temperature, this, parameter));
6.97 + peciTemperature[0] = (flag & 0x04) != 0;
6.98 + peciTemperature[1] = (flag & 0x40) != 0;
6.99 + peciTemperature[2] = false;
6.100 break;
6.101 case Chip.W83627DHG:
6.102 case Chip.W83627DHGP:
6.103 // do not add temperature sensor registers that read PECI
6.104 byte sel = ReadByte(0, TEMPERATURE_SOURCE_SELECT_REG);
6.105 - if ((sel & 0x07) == 0)
6.106 - list.Add(new Sensor(TEMPERATURE_NAME[0], 0, null,
6.107 - SensorType.Temperature, this, parameter));
6.108 - if ((sel & 0x70) == 0)
6.109 - list.Add(new Sensor(TEMPERATURE_NAME[1], 1, null,
6.110 - SensorType.Temperature, this, parameter));
6.111 - list.Add(new Sensor(TEMPERATURE_NAME[2], 2, null,
6.112 - SensorType.Temperature, this, parameter));
6.113 + peciTemperature[0] = (sel & 0x07) != 0;
6.114 + peciTemperature[1] = (sel & 0x70) != 0;
6.115 + peciTemperature[2] = false;
6.116 break;
6.117 default:
6.118 - // no PECI support, add all sensors
6.119 - for (int i = 0; i < TEMPERATURE_NAME.Length; i++)
6.120 - list.Add(new Sensor(TEMPERATURE_NAME[i], i, null,
6.121 - SensorType.Temperature, this, parameter));
6.122 + // no PECI support
6.123 + peciTemperature[0] = false;
6.124 + peciTemperature[1] = false;
6.125 + peciTemperature[2] = false;
6.126 break;
6.127 }
6.128 - temperatures = list.ToArray();
6.129
6.130 switch (chip) {
6.131 + case Chip.W83627EHF:
6.132 + voltages = new float?[10];
6.133 + voltageRegister = new byte[] {
6.134 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x50, 0x51, 0x52 };
6.135 + voltageBank = new byte[] { 0, 0, 0, 0, 0, 0, 0, 5, 5, 5 };
6.136 + voltageGain = 0.008f;
6.137 + fans = new float?[5];
6.138 + break;
6.139 case Chip.W83627DHG:
6.140 - case Chip.W83627DHGP:
6.141 - case Chip.W83627EHF:
6.142 + case Chip.W83627DHGP:
6.143 case Chip.W83667HG:
6.144 - case Chip.W83667HGB:
6.145 - fanNames = new string[] { "System", "CPU", "Auxiliary",
6.146 - "CPU #2", "Auxiliary #2" };
6.147 - voltageGains = new float[] { 1, 1, 1, 2, 1, 1, 1, 2 };
6.148 - voltages = new Sensor[3];
6.149 - voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this);
6.150 - voltages[1] = new Sensor("+3.3V", 3, SensorType.Voltage, this);
6.151 - voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this);
6.152 + case Chip.W83667HGB:
6.153 + voltages = new float?[9];
6.154 + voltageRegister = new byte[] {
6.155 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x50, 0x51 };
6.156 + voltageBank = new byte[] { 0, 0, 0, 0, 0, 0, 0, 5, 5 };
6.157 + voltageGain = 0.008f;
6.158 + fans = new float?[5];
6.159 break;
6.160 case Chip.W83627HF:
6.161 case Chip.W83627THF:
6.162 case Chip.W83687THF:
6.163 - fanNames = new string[] { "System", "CPU", "Auxiliary" };
6.164 - voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 };
6.165 - voltages = new Sensor[3];
6.166 - voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this);
6.167 - voltages[1] = new Sensor("+3.3V", 2, SensorType.Voltage, this);
6.168 - voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this);
6.169 - break;
6.170 - default: fanNames = new string[0];
6.171 + voltages = new float?[7];
6.172 + voltageRegister = new byte[] {
6.173 + 0x20, 0x21, 0x22, 0x23, 0x24, 0x50, 0x51 };
6.174 + voltageBank = new byte[] { 0, 0, 0, 0, 0, 5, 5 };
6.175 + voltageGain = 0.016f;
6.176 + fans = new float?[3];
6.177 break;
6.178 }
6.179 -
6.180 - fans = new Sensor[fanNames.Length];
6.181 - for (int i = 0; i < fanNames.Length; i++)
6.182 - fans[i] = new Sensor(fanNames[i], i, SensorType.Fan, this);
6.183 - }
6.184 -
6.185 - public bool IsAvailable {
6.186 - get { return available; }
6.187 - }
6.188 + }
6.189
6.190 private bool IsWinbondVendor() {
6.191 ushort vendorId =
6.192 @@ -206,52 +188,57 @@
6.193 return value > 0 ? target | mask : target & ~mask;
6.194 }
6.195
6.196 - public override void Update() {
6.197 + public Chip Chip { get { return chip; } }
6.198 + public float?[] Voltages { get { return voltages; } }
6.199 + public float?[] Temperatures { get { return temperatures; } }
6.200 + public float?[] Fans { get { return fans; } }
6.201
6.202 - foreach (Sensor sensor in voltages) {
6.203 - if (sensor.Index < 7) {
6.204 + public void Update() {
6.205 +
6.206 + for (int i = 0; i < voltages.Length; i++) {
6.207 + if (voltageRegister[i] != VOLTAGE_VBAT_REG) {
6.208 // two special VCore measurement modes for W83627THF
6.209 + float fvalue;
6.210 if ((chip == Chip.W83627HF || chip == Chip.W83627THF ||
6.211 - chip == Chip.W83687THF) && sensor.Index == 0)
6.212 + chip == Chip.W83687THF) && i == 0)
6.213 {
6.214 byte vrmConfiguration = ReadByte(0, 0x18);
6.215 - int value = ReadByte(0, VOLTAGE_BASE_REG);
6.216 + int value = ReadByte(voltageBank[i], voltageRegister[i]);
6.217 if ((vrmConfiguration & 0x01) == 0)
6.218 - sensor.Value = 0.016f * value; // VRM8 formula
6.219 + fvalue = 0.016f * value; // VRM8 formula
6.220 else
6.221 - sensor.Value = 0.00488f * value + 0.69f; // VRM9 formula
6.222 + fvalue = 0.00488f * value + 0.69f; // VRM9 formula
6.223 } else {
6.224 - int value = ReadByte(0, (byte)(VOLTAGE_BASE_REG + sensor.Index));
6.225 - sensor.Value = 0.008f * voltageGains[sensor.Index] * value;
6.226 + int value = ReadByte(voltageBank[i], voltageRegister[i]);
6.227 + fvalue = voltageGain * value;
6.228 }
6.229 - if (sensor.Value > 0)
6.230 - ActivateSensor(sensor);
6.231 + if (fvalue > 0)
6.232 + voltages[i] = fvalue;
6.233 + else
6.234 + voltages[i] = null;
6.235 } else {
6.236 // Battery voltage
6.237 bool valid = (ReadByte(0, 0x5D) & 0x01) > 0;
6.238 if (valid) {
6.239 - sensor.Value =
6.240 - 0.008f * voltageGains[sensor.Index] * ReadByte(5, 0x51);
6.241 - ActivateSensor(sensor);
6.242 + voltages[i] = voltageGain * ReadByte(5, VOLTAGE_VBAT_REG);
6.243 } else {
6.244 - sensor.Value = null;
6.245 + voltages[i] = null;
6.246 }
6.247 }
6.248 }
6.249
6.250 - foreach (Sensor sensor in temperatures) {
6.251 - int value = ((sbyte)ReadByte(TEMPERATURE_BANK[sensor.Index],
6.252 - TEMPERATURE_REG[sensor.Index])) << 1;
6.253 - if (TEMPERATURE_BANK[sensor.Index] > 0)
6.254 - value |= ReadByte(TEMPERATURE_BANK[sensor.Index],
6.255 - (byte)(TEMPERATURE_REG[sensor.Index] + 1)) >> 7;
6.256 + for (int i = 0; i < temperatures.Length; i++) {
6.257 + int value = ((sbyte)ReadByte(TEMPERATURE_BANK[i],
6.258 + TEMPERATURE_REG[i])) << 1;
6.259 + if (TEMPERATURE_BANK[i] > 0)
6.260 + value |= ReadByte(TEMPERATURE_BANK[i],
6.261 + (byte)(TEMPERATURE_REG[i] + 1)) >> 7;
6.262
6.263 float temperature = value / 2.0f;
6.264 - if (temperature <= 125 && temperature >= -55) {
6.265 - sensor.Value = temperature + sensor.Parameters[0].Value;
6.266 - ActivateSensor(sensor);
6.267 + if (temperature <= 125 && temperature >= -55 && !peciTemperature[i]) {
6.268 + temperatures[i] = temperature;
6.269 } else {
6.270 - sensor.Value = null;
6.271 + temperatures[i] = null;
6.272 }
6.273 }
6.274
6.275 @@ -259,21 +246,18 @@
6.276 for (int i = 0; i < FAN_BIT_REG.Length; i++)
6.277 bits = (bits << 8) | ReadByte(0, FAN_BIT_REG[i]);
6.278 ulong newBits = bits;
6.279 - foreach (Sensor sensor in fans) {
6.280 - int count = ReadByte(FAN_TACHO_BANK[sensor.Index],
6.281 - FAN_TACHO_REG[sensor.Index]);
6.282 + for (int i = 0; i < fans.Length; i++) {
6.283 + int count = ReadByte(FAN_TACHO_BANK[i], FAN_TACHO_REG[i]);
6.284
6.285 // assemble fan divisor
6.286 int divisorBits = (int)(
6.287 - (((bits >> FAN_DIV_BIT2[sensor.Index]) & 1) << 2) |
6.288 - (((bits >> FAN_DIV_BIT1[sensor.Index]) & 1) << 1) |
6.289 - ((bits >> FAN_DIV_BIT0[sensor.Index]) & 1));
6.290 + (((bits >> FAN_DIV_BIT2[i]) & 1) << 2) |
6.291 + (((bits >> FAN_DIV_BIT1[i]) & 1) << 1) |
6.292 + ((bits >> FAN_DIV_BIT0[i]) & 1));
6.293 int divisor = 1 << divisorBits;
6.294
6.295 float value = (count < 0xff) ? 1.35e6f / (count * divisor) : 0;
6.296 - sensor.Value = value;
6.297 - if (value > 0)
6.298 - ActivateSensor(sensor);
6.299 + fans[i] = value;
6.300
6.301 // update fan divisor
6.302 if (count > 192 && divisorBits < 7)
6.303 @@ -281,12 +265,9 @@
6.304 if (count < 96 && divisorBits > 0)
6.305 divisorBits--;
6.306
6.307 - newBits = SetBit(newBits, FAN_DIV_BIT2[sensor.Index],
6.308 - (divisorBits >> 2) & 1);
6.309 - newBits = SetBit(newBits, FAN_DIV_BIT1[sensor.Index],
6.310 - (divisorBits >> 1) & 1);
6.311 - newBits = SetBit(newBits, FAN_DIV_BIT0[sensor.Index],
6.312 - divisorBits & 1);
6.313 + newBits = SetBit(newBits, FAN_DIV_BIT2[i], (divisorBits >> 2) & 1);
6.314 + newBits = SetBit(newBits, FAN_DIV_BIT1[i], (divisorBits >> 1) & 1);
6.315 + newBits = SetBit(newBits, FAN_DIV_BIT0[i], divisorBits & 1);
6.316 }
6.317
6.318 // write new fan divisors
6.319 @@ -300,7 +281,7 @@
6.320 }
6.321 }
6.322
6.323 - public override string GetReport() {
6.324 + public string GetReport() {
6.325 StringBuilder r = new StringBuilder();
6.326
6.327 r.AppendLine("LPC " + this.GetType().Name);
6.328 @@ -337,5 +318,5 @@
6.329
6.330 return r.ToString();
6.331 }
6.332 - }
6.333 + }
6.334 }
7.1 --- a/Hardware/Mainboard/Mainboard.cs Sat May 29 13:49:20 2010 +0000
7.2 +++ b/Hardware/Mainboard/Mainboard.cs Thu Jun 03 22:40:18 2010 +0000
7.3 @@ -47,7 +47,8 @@
7.4 private string name;
7.5 private Image icon;
7.6
7.7 - private LPCIO lpcGroup;
7.8 + private LPCIO lpcio;
7.9 + private IHardware[] superIOHardware;
7.10
7.11 public Mainboard() {
7.12 this.smbios = new SMBIOS();
7.13 @@ -68,9 +69,14 @@
7.14 }
7.15
7.16 this.icon = Utilities.EmbeddedResources.GetImage("mainboard.png");
7.17 - this.lpcGroup = new LPCIO(
7.18 - smbios.Board != null ? smbios.Board.Manufacturer : Manufacturer.Unknown,
7.19 - smbios.Board != null ? smbios.Board.Model : Model.Unknown);
7.20 + this.lpcio = new LPCIO();
7.21 + ISuperIO[] superIO = lpcio.SuperIO;
7.22 + superIOHardware = new IHardware[superIO.Length];
7.23 + for (int i = 0; i < superIO.Length; i++)
7.24 + superIOHardware[i] = new SuperIOHardware(superIO[i],
7.25 + smbios.Board != null ? smbios.Board.Manufacturer :
7.26 + Manufacturer.Unknown, smbios.Board != null ? smbios.Board.Model :
7.27 + Model.Unknown);
7.28 }
7.29
7.30 public string Name {
7.31 @@ -92,7 +98,7 @@
7.32 r.AppendLine();
7.33 r.Append(smbios.GetReport());
7.34
7.35 - r.Append(lpcGroup.GetReport());
7.36 + r.Append(lpcio.GetReport());
7.37
7.38 return r.ToString();
7.39 }
7.40 @@ -102,7 +108,7 @@
7.41 public void Close() { }
7.42
7.43 public IHardware[] SubHardware {
7.44 - get { return lpcGroup.Hardware; }
7.45 + get { return superIOHardware; }
7.46 }
7.47
7.48 public ISensor[] Sensors {
7.49 @@ -119,7 +125,7 @@
7.50 }
7.51
7.52 public void Traverse(IVisitor visitor) {
7.53 - foreach (IHardware hardware in lpcGroup.Hardware)
7.54 + foreach (IHardware hardware in superIOHardware)
7.55 hardware.Accept(visitor);
7.56 }
7.57 }
8.1 --- a/Hardware/Mainboard/Model.cs Sat May 29 13:49:20 2010 +0000
8.2 +++ b/Hardware/Mainboard/Model.cs Thu Jun 03 22:40:18 2010 +0000
8.3 @@ -5,14 +5,20 @@
8.4 namespace OpenHardwareMonitor.Hardware.Mainboard {
8.5
8.6 public enum Model {
8.7 + // ASUS
8.8 + P5W_DH_Deluxe,
8.9 +
8.10 // DFI
8.11 LP_BI_P45_T2RS_Elite,
8.12 LP_DK_P55_T3eH9,
8.13
8.14 // Gigabyte
8.15 + _965P_S3,
8.16 EP45_DS3R,
8.17 + EP45_UD3R,
8.18 GA_MA785GMT_UD2H,
8.19 P35_DS3,
8.20 + X38_DS5,
8.21
8.22 // Unknown
8.23 Unknown
9.1 --- a/Hardware/Mainboard/SMBIOS.cs Sat May 29 13:49:20 2010 +0000
9.2 +++ b/Hardware/Mainboard/SMBIOS.cs Thu Jun 03 22:40:18 2010 +0000
9.3 @@ -224,16 +224,24 @@
9.4 }
9.5
9.6 switch (productName) {
9.7 + case "P5W DH Deluxe":
9.8 + model = Model.P5W_DH_Deluxe; break;
9.9 case "LP BI P45-T2RS Elite":
9.10 model = Model.LP_BI_P45_T2RS_Elite; break;
9.11 case "LP DK P55-T3eH9":
9.12 model = Model.LP_DK_P55_T3eH9; break;
9.13 + case "965P-S3":
9.14 + model = Model._965P_S3; break;
9.15 case "EP45-DS3R":
9.16 model = Model.EP45_DS3R; break;
9.17 + case "EP45-UD3R":
9.18 + model = Model.EP45_UD3R; break;
9.19 case "GA-MA785GMT-UD2H":
9.20 model = Model.GA_MA785GMT_UD2H; break;
9.21 case "P35-DS3":
9.22 model = Model.P35_DS3; break;
9.23 + case "X38-DS5":
9.24 + model = Model.X38_DS5; break;
9.25 default:
9.26 model = Model.Unknown; break;
9.27 }
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/Hardware/Mainboard/SuperIOHardware.cs Thu Jun 03 22:40:18 2010 +0000
10.3 @@ -0,0 +1,465 @@
10.4 +/*
10.5 +
10.6 + Version: MPL 1.1/GPL 2.0/LGPL 2.1
10.7 +
10.8 + The contents of this file are subject to the Mozilla Public License Version
10.9 + 1.1 (the "License"); you may not use this file except in compliance with
10.10 + the License. You may obtain a copy of the License at
10.11 +
10.12 + http://www.mozilla.org/MPL/
10.13 +
10.14 + Software distributed under the License is distributed on an "AS IS" basis,
10.15 + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10.16 + for the specific language governing rights and limitations under the License.
10.17 +
10.18 + The Original Code is the Open Hardware Monitor code.
10.19 +
10.20 + The Initial Developer of the Original Code is
10.21 + Michael Möller <m.moeller@gmx.ch>.
10.22 + Portions created by the Initial Developer are Copyright (C) 2009-2010
10.23 + the Initial Developer. All Rights Reserved.
10.24 +
10.25 + Contributor(s):
10.26 +
10.27 + Alternatively, the contents of this file may be used under the terms of
10.28 + either the GNU General Public License Version 2 or later (the "GPL"), or
10.29 + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
10.30 + in which case the provisions of the GPL or the LGPL are applicable instead
10.31 + of those above. If you wish to allow use of your version of this file only
10.32 + under the terms of either the GPL or the LGPL, and not to allow others to
10.33 + use your version of this file under the terms of the MPL, indicate your
10.34 + decision by deleting the provisions above and replace them with the notice
10.35 + and other provisions required by the GPL or the LGPL. If you do not delete
10.36 + the provisions above, a recipient may use your version of this file under
10.37 + the terms of any one of the MPL, the GPL or the LGPL.
10.38 +
10.39 +*/
10.40 +
10.41 +using System;
10.42 +using System.Collections.Generic;
10.43 +using System.Drawing;
10.44 +using OpenHardwareMonitor.Hardware.LPC;
10.45 +
10.46 +namespace OpenHardwareMonitor.Hardware.Mainboard {
10.47 + public class SuperIOHardware : Hardware {
10.48 +
10.49 + private ISuperIO superIO;
10.50 + private Image icon;
10.51 + protected readonly string name;
10.52 +
10.53 + private List<Sensor> voltages = new List<Sensor>();
10.54 + private List<Sensor> temperatures = new List<Sensor>();
10.55 + private List<Sensor> fans = new List<Sensor>();
10.56 +
10.57 + public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer,
10.58 + Model model)
10.59 + {
10.60 + this.superIO = superIO;
10.61 + this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
10.62 +
10.63 + switch (superIO.Chip) {
10.64 + case Chip.F71858: name = "Fintek F71858"; break;
10.65 + case Chip.F71862: name = "Fintek F71862"; break;
10.66 + case Chip.F71869: name = "Fintek F71869"; break;
10.67 + case Chip.F71882: name = "Fintek F71882"; break;
10.68 + case Chip.F71889ED: name = "Fintek F71889ED"; break;
10.69 + case Chip.F71889F: name = "Fintek F71889F"; break;
10.70 + case Chip.IT8712F: this.name = "ITE IT8712F"; break;
10.71 + case Chip.IT8716F: this.name = "ITE IT8716F"; break;
10.72 + case Chip.IT8718F: this.name = "ITE IT8718F"; break;
10.73 + case Chip.IT8720F: this.name = "ITE IT8720F"; break;
10.74 + case Chip.IT8726F: this.name = "ITE IT8726F"; break;
10.75 + case Chip.W83627DHG: this.name = "Winbond W83627DHG"; break;
10.76 + case Chip.W83627DHGP: this.name = "Winbond W83627DHG-P"; break;
10.77 + case Chip.W83627EHF: this.name = "Winbond W83627EHF"; break;
10.78 + case Chip.W83627HF: this.name = "Winbond W83627HF"; break;
10.79 + case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
10.80 + case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
10.81 + case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
10.82 + case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
10.83 + }
10.84 +
10.85 + List<Voltage> v = new List<Voltage>();
10.86 + List<Temperature> t = new List<Temperature>();
10.87 + List<Fan> f = new List<Fan>();
10.88 +
10.89 + switch (superIO.Chip) {
10.90 + case Chip.IT8712F:
10.91 + case Chip.IT8716F:
10.92 + case Chip.IT8718F:
10.93 + case Chip.IT8720F:
10.94 + case Chip.IT8726F:
10.95 + switch (manufacturer) {
10.96 + case Manufacturer.DFI:
10.97 + switch (model) {
10.98 + case Model.LP_BI_P45_T2RS_Elite:
10.99 + v.Add(new Voltage("CPU VCore", 0));
10.100 + v.Add(new Voltage("FSB VTT", 1));
10.101 + v.Add(new Voltage("+3.3V", 2));
10.102 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.103 + v.Add(new Voltage("+12V", 4, 30, 10, 0));
10.104 + v.Add(new Voltage("NB Core", 5));
10.105 + v.Add(new Voltage("VDIMM", 6));
10.106 + v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
10.107 + v.Add(new Voltage("VBat", 8));
10.108 + t.Add(new Temperature("CPU", 0));
10.109 + t.Add(new Temperature("System", 1));
10.110 + t.Add(new Temperature("Chipset", 2));
10.111 + f.Add(new Fan("Fan #1", 0));
10.112 + f.Add(new Fan("Fan #2", 1));
10.113 + f.Add(new Fan("Fan #3", 2));
10.114 + break;
10.115 + case Model.LP_DK_P55_T3eH9:
10.116 + v.Add(new Voltage("CPU VCore", 0));
10.117 + v.Add(new Voltage("VTT", 1));
10.118 + v.Add(new Voltage("+3.3V", 2));
10.119 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.120 + v.Add(new Voltage("+12V", 4, 30, 10, 0));
10.121 + v.Add(new Voltage("CPU PLL", 5));
10.122 + v.Add(new Voltage("DRAM", 6));
10.123 + v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
10.124 + v.Add(new Voltage("VBat", 8));
10.125 + t.Add(new Temperature("Chipset", 0));
10.126 + t.Add(new Temperature("CPU PWM", 1));
10.127 + t.Add(new Temperature("CPU", 2));
10.128 + f.Add(new Fan("Fan #1", 0));
10.129 + f.Add(new Fan("Fan #2", 1));
10.130 + f.Add(new Fan("Fan #3", 2));
10.131 + break;
10.132 + default:
10.133 + v.Add(new Voltage("CPU VCore", 0));
10.134 + v.Add(new Voltage("VTT", 1, true));
10.135 + v.Add(new Voltage("+3.3V", 2, true));
10.136 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
10.137 + v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
10.138 + v.Add(new Voltage("Voltage #6", 5, true));
10.139 + v.Add(new Voltage("DRAM", 6, true));
10.140 + v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
10.141 + v.Add(new Voltage("VBat", 8));
10.142 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.143 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.144 + for (int i = 0; i < superIO.Fans.Length; i++)
10.145 + f.Add(new Fan("Fan #" + (i + 1), i));
10.146 + break;
10.147 + }
10.148 + break;
10.149 +
10.150 + case Manufacturer.Gigabyte:
10.151 + switch (model) {
10.152 + case Model._965P_S3:
10.153 + v.Add(new Voltage("CPU VCore", 0));
10.154 + v.Add(new Voltage("DRAM", 1));
10.155 + v.Add(new Voltage("+3.3V", 2));
10.156 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.157 + v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
10.158 + v.Add(new Voltage("VBat", 8));
10.159 + t.Add(new Temperature("System", 0));
10.160 + t.Add(new Temperature("CPU", 1));
10.161 + f.Add(new Fan("CPU Fan", 0));
10.162 + f.Add(new Fan("System Fan", 1));
10.163 + break;
10.164 + case Model.EP45_DS3R:
10.165 + case Model.EP45_UD3R:
10.166 + case Model.X38_DS5:
10.167 + v.Add(new Voltage("CPU VCore", 0));
10.168 + v.Add(new Voltage("DRAM", 1));
10.169 + v.Add(new Voltage("+3.3V", 2));
10.170 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.171 + v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
10.172 + v.Add(new Voltage("VBat", 8));
10.173 + t.Add(new Temperature("System", 0));
10.174 + t.Add(new Temperature("CPU", 1));
10.175 + f.Add(new Fan("CPU Fan", 0));
10.176 + f.Add(new Fan("System Fan #2", 1));
10.177 + f.Add(new Fan("Power Fan", 2));
10.178 + f.Add(new Fan("System Fan #1", 3));
10.179 + break;
10.180 + case Model.P35_DS3:
10.181 + v.Add(new Voltage("CPU VCore", 0));
10.182 + v.Add(new Voltage("DRAM", 1));
10.183 + v.Add(new Voltage("+3.3V", 2));
10.184 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.185 + v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
10.186 + v.Add(new Voltage("VBat", 8));
10.187 + t.Add(new Temperature("System", 0));
10.188 + t.Add(new Temperature("CPU", 1));
10.189 + f.Add(new Fan("CPU Fan", 0));
10.190 + f.Add(new Fan("System Fan #1", 1));
10.191 + f.Add(new Fan("System Fan #2", 2));
10.192 + f.Add(new Fan("Power Fan", 3));
10.193 + break;
10.194 + case Model.GA_MA785GMT_UD2H:
10.195 + v.Add(new Voltage("CPU VCore", 0));
10.196 + v.Add(new Voltage("DRAM", 1));
10.197 + v.Add(new Voltage("+3.3V", 2));
10.198 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
10.199 + v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
10.200 + v.Add(new Voltage("VBat", 8));
10.201 + t.Add(new Temperature("System", 0));
10.202 + t.Add(new Temperature("CPU", 1));
10.203 + f.Add(new Fan("CPU Fan", 0));
10.204 + f.Add(new Fan("System Fan", 1));
10.205 + f.Add(new Fan("NB Fan", 2));
10.206 + break;
10.207 + default:
10.208 + v.Add(new Voltage("CPU VCore", 0));
10.209 + v.Add(new Voltage("DRAM", 1, true));
10.210 + v.Add(new Voltage("+3.3V", 2, true));
10.211 + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
10.212 + v.Add(new Voltage("Voltage #5", 4, true));
10.213 + v.Add(new Voltage("Voltage #6", 5, true));
10.214 + v.Add(new Voltage("Voltage #7", 6, true));
10.215 + v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
10.216 + v.Add(new Voltage("VBat", 8));
10.217 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.218 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.219 + for (int i = 0; i < superIO.Fans.Length; i++)
10.220 + f.Add(new Fan("Fan #" + (i + 1), i));
10.221 + break;
10.222 + }
10.223 + break;
10.224 +
10.225 + default:
10.226 + v.Add(new Voltage("CPU VCore", 0));
10.227 + v.Add(new Voltage("Voltage #2", 1, true));
10.228 + v.Add(new Voltage("Voltage #3", 2, true));
10.229 + v.Add(new Voltage("Voltage #4", 3, true));
10.230 + v.Add(new Voltage("Voltage #5", 4, true));
10.231 + v.Add(new Voltage("Voltage #6", 5, true));
10.232 + v.Add(new Voltage("Voltage #7", 6, true));
10.233 + v.Add(new Voltage("Voltage #8", 7, true));
10.234 + v.Add(new Voltage("VBat", 8));
10.235 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.236 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.237 + for (int i = 0; i < superIO.Fans.Length; i++)
10.238 + f.Add(new Fan("Fan #" + (i + 1), i));
10.239 + break;
10.240 + }
10.241 + break;
10.242 +
10.243 + case Chip.F71858:
10.244 + v.Add(new Voltage("VCC3V", 0));
10.245 + v.Add(new Voltage("VSB3V", 1));
10.246 + v.Add(new Voltage("Battery", 2));
10.247 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.248 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.249 + for (int i = 0; i < superIO.Fans.Length; i++)
10.250 + f.Add(new Fan("Fan #" + (i + 1), i));
10.251 + break;
10.252 + case Chip.F71862:
10.253 + case Chip.F71869:
10.254 + case Chip.F71882:
10.255 + case Chip.F71889ED:
10.256 + case Chip.F71889F:
10.257 + v.Add(new Voltage("VCC3V", 0));
10.258 + v.Add(new Voltage("CPU VCore", 1));
10.259 + v.Add(new Voltage("Voltage #3", 2, true));
10.260 + v.Add(new Voltage("Voltage #4", 3, true));
10.261 + v.Add(new Voltage("Voltage #5", 4, true));
10.262 + v.Add(new Voltage("Voltage #6", 5, true));
10.263 + v.Add(new Voltage("Voltage #7", 6, true));
10.264 + v.Add(new Voltage("VSB3V", 7));
10.265 + v.Add(new Voltage("Battery", 8));
10.266 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.267 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.268 + for (int i = 0; i < superIO.Fans.Length; i++)
10.269 + f.Add(new Fan("Fan #" + (i + 1), i));
10.270 + break;
10.271 +
10.272 + case Chip.W83627EHF:
10.273 + v.Add(new Voltage("CPU VCore", 0));
10.274 + v.Add(new Voltage("Voltage #2", 1, true));
10.275 + v.Add(new Voltage("AVCC", 2, 34, 34, 0));
10.276 + v.Add(new Voltage("3VCC", 3, 34, 34, 0));
10.277 + v.Add(new Voltage("Voltage #5", 4, true));
10.278 + v.Add(new Voltage("Voltage #6", 5, true));
10.279 + v.Add(new Voltage("Voltage #7", 6, true));
10.280 + v.Add(new Voltage("3VSB", 7, 34, 34, 0));
10.281 + v.Add(new Voltage("VBAT", 8, 34, 34, 0));
10.282 + v.Add(new Voltage("Voltage #10", 9, true));
10.283 + t.Add(new Temperature("CPU", 0));
10.284 + t.Add(new Temperature("Auxiliary", 1));
10.285 + t.Add(new Temperature("System", 2));
10.286 + f.Add(new Fan("System", 0));
10.287 + f.Add(new Fan("CPU", 1));
10.288 + f.Add(new Fan("Auxiliary", 2));
10.289 + f.Add(new Fan("CPU #2", 3));
10.290 + f.Add(new Fan("Auxiliary #2", 4));
10.291 + break;
10.292 + case Chip.W83627DHG:
10.293 + case Chip.W83627DHGP:
10.294 + case Chip.W83667HG:
10.295 + case Chip.W83667HGB:
10.296 + v.Add(new Voltage("CPU VCore", 0));
10.297 + v.Add(new Voltage("Voltage #2", 1, true));
10.298 + v.Add(new Voltage("AVCC", 2, 34, 34, 0));
10.299 + v.Add(new Voltage("3VCC", 3, 34, 34, 0));
10.300 + v.Add(new Voltage("Voltage #5", 4, true));
10.301 + v.Add(new Voltage("Voltage #6", 5, true));
10.302 + v.Add(new Voltage("Voltage #7", 6, true));
10.303 + v.Add(new Voltage("3VSB", 7, 34, 34, 0));
10.304 + v.Add(new Voltage("VBAT", 8, 34, 34, 0));
10.305 + t.Add(new Temperature("CPU", 0));
10.306 + t.Add(new Temperature("Auxiliary", 1));
10.307 + t.Add(new Temperature("System", 2));
10.308 + f.Add(new Fan("System", 0));
10.309 + f.Add(new Fan("CPU", 1));
10.310 + f.Add(new Fan("Auxiliary", 2));
10.311 + f.Add(new Fan("CPU #2", 3));
10.312 + f.Add(new Fan("Auxiliary #2", 4));
10.313 + break;
10.314 + case Chip.W83627HF:
10.315 + case Chip.W83627THF:
10.316 + case Chip.W83687THF:
10.317 + v.Add(new Voltage("CPU VCore", 0));
10.318 + v.Add(new Voltage("Voltage #2", 1, true));
10.319 + v.Add(new Voltage("Voltage #3", 2, true));
10.320 + v.Add(new Voltage("AVCC", 3, 34, 51, 0));
10.321 + v.Add(new Voltage("Voltage #5", 4, true));
10.322 + v.Add(new Voltage("5VSB", 5, 34, 51, 0));
10.323 + v.Add(new Voltage("VBAT", 6));
10.324 + t.Add(new Temperature("CPU", 0));
10.325 + t.Add(new Temperature("Auxiliary", 1));
10.326 + t.Add(new Temperature("System", 2));
10.327 + f.Add(new Fan("System", 0));
10.328 + f.Add(new Fan("CPU", 1));
10.329 + f.Add(new Fan("Auxiliary", 2));
10.330 + break;
10.331 + default:
10.332 + for (int i = 0; i < superIO.Voltages.Length; i++)
10.333 + v.Add(new Voltage("Voltage #" + (i + 1), i, true));
10.334 + for (int i = 0; i < superIO.Temperatures.Length; i++)
10.335 + t.Add(new Temperature("Temperature #" + (i + 1), i));
10.336 + for (int i = 0; i < superIO.Fans.Length; i++)
10.337 + f.Add(new Fan("Fan #" + (i + 1), i));
10.338 + break;
10.339 + }
10.340 +
10.341 + string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
10.342 + foreach (Voltage voltage in v)
10.343 + if (voltage.Index < superIO.Voltages.Length) {
10.344 + Sensor sensor = new Sensor(voltage.Name, voltage.Index,
10.345 + voltage.Hidden, null, SensorType.Voltage, this,
10.346 + new ParameterDescription[] {
10.347 + new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
10.348 + formula, voltage.Ri),
10.349 + new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
10.350 + formula, voltage.Rf),
10.351 + new ParameterDescription("Vf [V]", "Reference voltage.\n" +
10.352 + formula, voltage.Vf)
10.353 + });
10.354 + voltages.Add(sensor);
10.355 + }
10.356 +
10.357 + foreach (Temperature temperature in t)
10.358 + if (temperature.Index < superIO.Temperatures.Length) {
10.359 + Sensor sensor = new Sensor(temperature.Name, temperature.Index, null,
10.360 + SensorType.Temperature, this, new ParameterDescription[] {
10.361 + new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
10.362 + });
10.363 + temperatures.Add(sensor);
10.364 + }
10.365 +
10.366 + foreach (Fan fan in f)
10.367 + if (fan.Index < superIO.Fans.Length) {
10.368 + Sensor sensor = new Sensor(fan.Name, fan.Index, null, SensorType.Fan,
10.369 + this, null);
10.370 + fans.Add(sensor);
10.371 + }
10.372 + }
10.373 +
10.374 + public override Identifier Identifier {
10.375 + get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
10.376 + }
10.377 +
10.378 + public override Image Icon {
10.379 + get { return icon; }
10.380 + }
10.381 +
10.382 + public override string Name {
10.383 + get { return name; }
10.384 + }
10.385 +
10.386 + public override string GetReport() {
10.387 + return superIO.GetReport();
10.388 + }
10.389 +
10.390 + public override void Update() {
10.391 + superIO.Update();
10.392 +
10.393 + foreach (Sensor sensor in voltages) {
10.394 + float? value = superIO.Voltages[sensor.Index];
10.395 + if (value.HasValue) {
10.396 + sensor.Value = value + (value - sensor.Parameters[2].Value) *
10.397 + sensor.Parameters[0].Value / sensor.Parameters[1].Value;
10.398 + ActivateSensor(sensor);
10.399 + }
10.400 + }
10.401 +
10.402 + foreach (Sensor sensor in temperatures) {
10.403 + float? value = superIO.Temperatures[sensor.Index];
10.404 + if (value.HasValue) {
10.405 + sensor.Value = value + sensor.Parameters[0].Value;
10.406 + ActivateSensor(sensor);
10.407 + }
10.408 + }
10.409 +
10.410 + foreach (Sensor sensor in fans) {
10.411 + float? value = superIO.Fans[sensor.Index];
10.412 + if (value.HasValue) {
10.413 + sensor.Value = value;
10.414 + if (value.Value > 0)
10.415 + ActivateSensor(sensor);
10.416 + }
10.417 + }
10.418 + }
10.419 +
10.420 + private class Voltage {
10.421 + public readonly string Name;
10.422 + public readonly int Index;
10.423 + public readonly float Ri;
10.424 + public readonly float Rf;
10.425 + public readonly float Vf;
10.426 + public readonly bool Hidden;
10.427 +
10.428 + public Voltage(string name, int index) :
10.429 + this(name, index, 0, 1, 0, false) { }
10.430 +
10.431 + public Voltage(string name, int index, bool hidden) :
10.432 + this(name, index, 0, 1, 0, hidden) { }
10.433 +
10.434 + public Voltage(string name, int index, float ri, float rf, float vf) :
10.435 + this(name, index, ri, rf, vf, false) { }
10.436 +
10.437 + public Voltage(string name, int index, float ri, float rf, float vf,
10.438 + bool hidden) {
10.439 + this.Name = name;
10.440 + this.Index = index;
10.441 + this.Ri = ri;
10.442 + this.Rf = rf;
10.443 + this.Vf = vf;
10.444 + this.Hidden = hidden;
10.445 + }
10.446 + }
10.447 +
10.448 + private class Temperature {
10.449 + public readonly string Name;
10.450 + public readonly int Index;
10.451 +
10.452 + public Temperature(string name, int index) {
10.453 + this.Name = name;
10.454 + this.Index = index;
10.455 + }
10.456 + }
10.457 +
10.458 + private class Fan {
10.459 + public readonly string Name;
10.460 + public readonly int Index;
10.461 +
10.462 + public Fan(string name, int index) {
10.463 + this.Name = name;
10.464 + this.Index = index;
10.465 + }
10.466 + }
10.467 + }
10.468 +}
11.1 --- a/OpenHardwareMonitor.csproj Sat May 29 13:49:20 2010 +0000
11.2 +++ b/OpenHardwareMonitor.csproj Thu Jun 03 22:40:18 2010 +0000
11.3 @@ -52,10 +52,12 @@
11.4 </Reference>
11.5 <Reference Include="System" />
11.6 <Reference Include="System.Configuration" />
11.7 + <Reference Include="System.Data" />
11.8 <Reference Include="System.Drawing" />
11.9 <Reference Include="System.Management" />
11.10 <Reference Include="System.Web" />
11.11 <Reference Include="System.Windows.Forms" />
11.12 + <Reference Include="System.Xml" />
11.13 </ItemGroup>
11.14 <ItemGroup>
11.15 <Compile Include="GUI\CrashReportForm.cs">
11.16 @@ -94,7 +96,8 @@
11.17 <Compile Include="Hardware\IParameter.cs" />
11.18 <Compile Include="Hardware\LPC\Chip.cs" />
11.19 <Compile Include="Hardware\LPC\F718XX.cs" />
11.20 - <Compile Include="Hardware\LPC\LPCHardware.cs" />
11.21 + <Compile Include="Hardware\LPC\ISuperIO.cs" />
11.22 + <Compile Include="Hardware\Mainboard\SuperIOHardware.cs" />
11.23 <Compile Include="Hardware\Mainboard\Mainboard.cs" />
11.24 <Compile Include="Hardware\Mainboard\MainboardGroup.cs" />
11.25 <Compile Include="Hardware\Mainboard\Model.cs" />