Fixed Issue 63.
3 Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 The contents of this file are subject to the Mozilla Public License Version
6 1.1 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.mozilla.org/MPL/
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 for the specific language governing rights and limitations under the License.
15 The Original Code is the Open Hardware Monitor code.
17 The Initial Developer of the Original Code is
18 Michael Möller <m.moeller@gmx.ch>.
19 Portions created by the Initial Developer are Copyright (C) 2009-2010
20 the Initial Developer. All Rights Reserved.
24 Alternatively, the contents of this file may be used under the terms of
25 either the GNU General Public License Version 2 or later (the "GPL"), or
26 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 in which case the provisions of the GPL or the LGPL are applicable instead
28 of those above. If you wish to allow use of your version of this file only
29 under the terms of either the GPL or the LGPL, and not to allow others to
30 use your version of this file under the terms of the MPL, indicate your
31 decision by deleting the provisions above and replace them with the notice
32 and other provisions required by the GPL or the LGPL. If you do not delete
33 the provisions above, a recipient may use your version of this file under
34 the terms of any one of the MPL, the GPL or the LGPL.
39 using System.Collections.Generic;
41 using OpenHardwareMonitor.Hardware.LPC;
43 namespace OpenHardwareMonitor.Hardware.Mainboard {
44 public class SuperIOHardware : Hardware {
46 private ISuperIO superIO;
48 protected readonly string name;
50 private List<Sensor> voltages = new List<Sensor>();
51 private List<Sensor> temperatures = new List<Sensor>();
52 private List<Sensor> fans = new List<Sensor>();
54 public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer,
57 this.superIO = superIO;
58 this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
60 switch (superIO.Chip) {
61 case Chip.F71858: name = "Fintek F71858"; break;
62 case Chip.F71862: name = "Fintek F71862"; break;
63 case Chip.F71869: name = "Fintek F71869"; break;
64 case Chip.F71882: name = "Fintek F71882"; break;
65 case Chip.F71889ED: name = "Fintek F71889ED"; break;
66 case Chip.F71889F: name = "Fintek F71889F"; break;
67 case Chip.IT8712F: this.name = "ITE IT8712F"; break;
68 case Chip.IT8716F: this.name = "ITE IT8716F"; break;
69 case Chip.IT8718F: this.name = "ITE IT8718F"; break;
70 case Chip.IT8720F: this.name = "ITE IT8720F"; break;
71 case Chip.IT8726F: this.name = "ITE IT8726F"; break;
72 case Chip.W83627DHG: this.name = "Winbond W83627DHG"; break;
73 case Chip.W83627DHGP: this.name = "Winbond W83627DHG-P"; break;
74 case Chip.W83627EHF: this.name = "Winbond W83627EHF"; break;
75 case Chip.W83627HF: this.name = "Winbond W83627HF"; break;
76 case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
77 case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
78 case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
79 case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
82 List<Voltage> v = new List<Voltage>();
83 List<Temperature> t = new List<Temperature>();
84 List<Fan> f = new List<Fan>();
86 switch (superIO.Chip) {
92 switch (manufacturer) {
93 case Manufacturer.DFI:
95 case Model.LP_BI_P45_T2RS_Elite:
96 v.Add(new Voltage("CPU VCore", 0));
97 v.Add(new Voltage("FSB VTT", 1));
98 v.Add(new Voltage("+3.3V", 2));
99 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
100 v.Add(new Voltage("+12V", 4, 30, 10, 0));
101 v.Add(new Voltage("NB Core", 5));
102 v.Add(new Voltage("VDIMM", 6));
103 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
104 v.Add(new Voltage("VBat", 8));
105 t.Add(new Temperature("CPU", 0));
106 t.Add(new Temperature("System", 1));
107 t.Add(new Temperature("Chipset", 2));
108 f.Add(new Fan("Fan #1", 0));
109 f.Add(new Fan("Fan #2", 1));
110 f.Add(new Fan("Fan #3", 2));
112 case Model.LP_DK_P55_T3eH9:
113 v.Add(new Voltage("CPU VCore", 0));
114 v.Add(new Voltage("VTT", 1));
115 v.Add(new Voltage("+3.3V", 2));
116 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
117 v.Add(new Voltage("+12V", 4, 30, 10, 0));
118 v.Add(new Voltage("CPU PLL", 5));
119 v.Add(new Voltage("DRAM", 6));
120 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
121 v.Add(new Voltage("VBat", 8));
122 t.Add(new Temperature("Chipset", 0));
123 t.Add(new Temperature("CPU PWM", 1));
124 t.Add(new Temperature("CPU", 2));
125 f.Add(new Fan("Fan #1", 0));
126 f.Add(new Fan("Fan #2", 1));
127 f.Add(new Fan("Fan #3", 2));
130 v.Add(new Voltage("CPU VCore", 0));
131 v.Add(new Voltage("VTT", 1, true));
132 v.Add(new Voltage("+3.3V", 2, true));
133 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
134 v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
135 v.Add(new Voltage("Voltage #6", 5, true));
136 v.Add(new Voltage("DRAM", 6, true));
137 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
138 v.Add(new Voltage("VBat", 8));
139 for (int i = 0; i < superIO.Temperatures.Length; i++)
140 t.Add(new Temperature("Temperature #" + (i + 1), i));
141 for (int i = 0; i < superIO.Fans.Length; i++)
142 f.Add(new Fan("Fan #" + (i + 1), i));
147 case Manufacturer.Gigabyte:
150 v.Add(new Voltage("CPU VCore", 0));
151 v.Add(new Voltage("DRAM", 1));
152 v.Add(new Voltage("+3.3V", 2));
153 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
154 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
155 v.Add(new Voltage("VBat", 8));
156 t.Add(new Temperature("System", 0));
157 t.Add(new Temperature("CPU", 1));
158 f.Add(new Fan("CPU Fan", 0));
159 f.Add(new Fan("System Fan", 1));
161 case Model.EP45_DS3R:
162 case Model.EP45_UD3R:
164 v.Add(new Voltage("CPU VCore", 0));
165 v.Add(new Voltage("DRAM", 1));
166 v.Add(new Voltage("+3.3V", 2));
167 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
168 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
169 v.Add(new Voltage("VBat", 8));
170 t.Add(new Temperature("System", 0));
171 t.Add(new Temperature("CPU", 1));
172 f.Add(new Fan("CPU Fan", 0));
173 f.Add(new Fan("System Fan #2", 1));
174 f.Add(new Fan("Power Fan", 2));
175 f.Add(new Fan("System Fan #1", 3));
178 v.Add(new Voltage("CPU VCore", 0));
179 v.Add(new Voltage("DRAM", 1));
180 v.Add(new Voltage("+3.3V", 2));
181 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
182 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
183 v.Add(new Voltage("VBat", 8));
184 t.Add(new Temperature("System", 0));
185 t.Add(new Temperature("CPU", 1));
186 f.Add(new Fan("CPU Fan", 0));
187 f.Add(new Fan("System Fan #1", 1));
188 f.Add(new Fan("System Fan #2", 2));
189 f.Add(new Fan("Power Fan", 3));
191 case Model.GA_MA785GMT_UD2H:
192 v.Add(new Voltage("CPU VCore", 0));
193 v.Add(new Voltage("DRAM", 1));
194 v.Add(new Voltage("+3.3V", 2));
195 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
196 v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
197 v.Add(new Voltage("VBat", 8));
198 t.Add(new Temperature("System", 0));
199 t.Add(new Temperature("CPU", 1));
200 f.Add(new Fan("CPU Fan", 0));
201 f.Add(new Fan("System Fan", 1));
202 f.Add(new Fan("NB Fan", 2));
205 v.Add(new Voltage("CPU VCore", 0));
206 v.Add(new Voltage("DRAM", 1, true));
207 v.Add(new Voltage("+3.3V", 2, true));
208 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
209 v.Add(new Voltage("Voltage #5", 4, true));
210 v.Add(new Voltage("Voltage #6", 5, true));
211 v.Add(new Voltage("Voltage #7", 6, true));
212 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
213 v.Add(new Voltage("VBat", 8));
214 for (int i = 0; i < superIO.Temperatures.Length; i++)
215 t.Add(new Temperature("Temperature #" + (i + 1), i));
216 for (int i = 0; i < superIO.Fans.Length; i++)
217 f.Add(new Fan("Fan #" + (i + 1), i));
223 v.Add(new Voltage("CPU VCore", 0));
224 v.Add(new Voltage("Voltage #2", 1, true));
225 v.Add(new Voltage("Voltage #3", 2, true));
226 v.Add(new Voltage("Voltage #4", 3, true));
227 v.Add(new Voltage("Voltage #5", 4, true));
228 v.Add(new Voltage("Voltage #6", 5, true));
229 v.Add(new Voltage("Voltage #7", 6, true));
230 v.Add(new Voltage("Voltage #8", 7, true));
231 v.Add(new Voltage("VBat", 8));
232 for (int i = 0; i < superIO.Temperatures.Length; i++)
233 t.Add(new Temperature("Temperature #" + (i + 1), i));
234 for (int i = 0; i < superIO.Fans.Length; i++)
235 f.Add(new Fan("Fan #" + (i + 1), i));
241 v.Add(new Voltage("VCC3V", 0));
242 v.Add(new Voltage("VSB3V", 1));
243 v.Add(new Voltage("Battery", 2));
244 for (int i = 0; i < superIO.Temperatures.Length; i++)
245 t.Add(new Temperature("Temperature #" + (i + 1), i));
246 for (int i = 0; i < superIO.Fans.Length; i++)
247 f.Add(new Fan("Fan #" + (i + 1), i));
254 v.Add(new Voltage("VCC3V", 0));
255 v.Add(new Voltage("CPU VCore", 1));
256 v.Add(new Voltage("Voltage #3", 2, true));
257 v.Add(new Voltage("Voltage #4", 3, true));
258 v.Add(new Voltage("Voltage #5", 4, true));
259 v.Add(new Voltage("Voltage #6", 5, true));
260 v.Add(new Voltage("Voltage #7", 6, true));
261 v.Add(new Voltage("VSB3V", 7));
262 v.Add(new Voltage("Battery", 8));
263 for (int i = 0; i < superIO.Temperatures.Length; i++)
264 t.Add(new Temperature("Temperature #" + (i + 1), i));
265 for (int i = 0; i < superIO.Fans.Length; i++)
266 f.Add(new Fan("Fan #" + (i + 1), i));
270 v.Add(new Voltage("CPU VCore", 0));
271 v.Add(new Voltage("Voltage #2", 1, true));
272 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
273 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
274 v.Add(new Voltage("Voltage #5", 4, true));
275 v.Add(new Voltage("Voltage #6", 5, true));
276 v.Add(new Voltage("Voltage #7", 6, true));
277 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
278 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
279 v.Add(new Voltage("Voltage #10", 9, true));
280 t.Add(new Temperature("CPU", 0));
281 t.Add(new Temperature("Auxiliary", 1));
282 t.Add(new Temperature("System", 2));
283 f.Add(new Fan("System", 0));
284 f.Add(new Fan("CPU", 1));
285 f.Add(new Fan("Auxiliary", 2));
286 f.Add(new Fan("CPU #2", 3));
287 f.Add(new Fan("Auxiliary #2", 4));
290 case Chip.W83627DHGP:
293 v.Add(new Voltage("CPU VCore", 0));
294 v.Add(new Voltage("Voltage #2", 1, true));
295 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
296 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
297 v.Add(new Voltage("Voltage #5", 4, true));
298 v.Add(new Voltage("Voltage #6", 5, true));
299 v.Add(new Voltage("Voltage #7", 6, true));
300 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
301 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
302 t.Add(new Temperature("CPU", 0));
303 t.Add(new Temperature("Auxiliary", 1));
304 t.Add(new Temperature("System", 2));
305 f.Add(new Fan("System", 0));
306 f.Add(new Fan("CPU", 1));
307 f.Add(new Fan("Auxiliary", 2));
308 f.Add(new Fan("CPU #2", 3));
309 f.Add(new Fan("Auxiliary #2", 4));
314 v.Add(new Voltage("CPU VCore", 0));
315 v.Add(new Voltage("Voltage #2", 1, true));
316 v.Add(new Voltage("Voltage #3", 2, true));
317 v.Add(new Voltage("AVCC", 3, 34, 51, 0));
318 v.Add(new Voltage("Voltage #5", 4, true));
319 v.Add(new Voltage("5VSB", 5, 34, 51, 0));
320 v.Add(new Voltage("VBAT", 6));
321 t.Add(new Temperature("CPU", 0));
322 t.Add(new Temperature("Auxiliary", 1));
323 t.Add(new Temperature("System", 2));
324 f.Add(new Fan("System", 0));
325 f.Add(new Fan("CPU", 1));
326 f.Add(new Fan("Auxiliary", 2));
329 for (int i = 0; i < superIO.Voltages.Length; i++)
330 v.Add(new Voltage("Voltage #" + (i + 1), i, true));
331 for (int i = 0; i < superIO.Temperatures.Length; i++)
332 t.Add(new Temperature("Temperature #" + (i + 1), i));
333 for (int i = 0; i < superIO.Fans.Length; i++)
334 f.Add(new Fan("Fan #" + (i + 1), i));
338 string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
339 foreach (Voltage voltage in v)
340 if (voltage.Index < superIO.Voltages.Length) {
341 Sensor sensor = new Sensor(voltage.Name, voltage.Index,
342 voltage.Hidden, null, SensorType.Voltage, this,
343 new ParameterDescription[] {
344 new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
345 formula, voltage.Ri),
346 new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
347 formula, voltage.Rf),
348 new ParameterDescription("Vf [V]", "Reference voltage.\n" +
351 voltages.Add(sensor);
354 foreach (Temperature temperature in t)
355 if (temperature.Index < superIO.Temperatures.Length) {
356 Sensor sensor = new Sensor(temperature.Name, temperature.Index, null,
357 SensorType.Temperature, this, new ParameterDescription[] {
358 new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
360 temperatures.Add(sensor);
363 foreach (Fan fan in f)
364 if (fan.Index < superIO.Fans.Length) {
365 Sensor sensor = new Sensor(fan.Name, fan.Index, null, SensorType.Fan,
371 public override Identifier Identifier {
372 get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
375 public override Image Icon {
379 public override string Name {
383 public override string GetReport() {
384 return superIO.GetReport();
387 public override void Update() {
390 foreach (Sensor sensor in voltages) {
391 float? value = superIO.Voltages[sensor.Index];
392 if (value.HasValue) {
393 sensor.Value = value + (value - sensor.Parameters[2].Value) *
394 sensor.Parameters[0].Value / sensor.Parameters[1].Value;
395 ActivateSensor(sensor);
399 foreach (Sensor sensor in temperatures) {
400 float? value = superIO.Temperatures[sensor.Index];
401 if (value.HasValue) {
402 sensor.Value = value + sensor.Parameters[0].Value;
403 ActivateSensor(sensor);
407 foreach (Sensor sensor in fans) {
408 float? value = superIO.Fans[sensor.Index];
409 if (value.HasValue) {
410 sensor.Value = value;
412 ActivateSensor(sensor);
417 private class Voltage {
418 public readonly string Name;
419 public readonly int Index;
420 public readonly float Ri;
421 public readonly float Rf;
422 public readonly float Vf;
423 public readonly bool Hidden;
425 public Voltage(string name, int index) :
426 this(name, index, 0, 1, 0, false) { }
428 public Voltage(string name, int index, bool hidden) :
429 this(name, index, 0, 1, 0, hidden) { }
431 public Voltage(string name, int index, float ri, float rf, float vf) :
432 this(name, index, ri, rf, vf, false) { }
434 public Voltage(string name, int index, float ri, float rf, float vf,
441 this.Hidden = hidden;
445 private class Temperature {
446 public readonly string Name;
447 public readonly int Index;
449 public Temperature(string name, int index) {
456 public readonly string Name;
457 public readonly int Index;
459 public Fan(string name, int index) {