Fixed the temperature reading and improved the report for the Nuvoton NCT6771F super I/O chip.
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;
40 using System.Globalization;
41 using System.Threading;
42 using OpenHardwareMonitor.Hardware.LPC;
44 namespace OpenHardwareMonitor.Hardware.Mainboard {
45 internal class SuperIOHardware : Hardware {
47 private readonly Mainboard mainboard;
48 private readonly ISuperIO superIO;
49 private readonly string name;
51 private readonly List<Sensor> voltages = new List<Sensor>();
52 private readonly List<Sensor> temperatures = new List<Sensor>();
53 private readonly List<Sensor> fans = new List<Sensor>();
55 private delegate float? ReadValueDelegate(int index);
56 private delegate void UpdateDelegate();
58 // delegates for mainboard specific sensor reading code
59 private readonly ReadValueDelegate readVoltage;
60 private readonly ReadValueDelegate readTemperature;
61 private readonly ReadValueDelegate readFan;
63 // delegate for post update mainboard specific code
64 private readonly UpdateDelegate postUpdate;
66 // mainboard specific mutex
67 private readonly Mutex mutex;
69 public SuperIOHardware(Mainboard mainboard, ISuperIO superIO,
70 Manufacturer manufacturer, Model model, ISettings settings)
72 this.mainboard = mainboard;
73 this.superIO = superIO;
74 this.name = ChipName.GetName(superIO.Chip);
76 this.readVoltage = (index) => superIO.Voltages[index];
77 this.readTemperature = (index) => superIO.Temperatures[index];
78 this.readFan = (index) => superIO.Fans[index];
80 this.postUpdate = () => { };
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.ASUS:
95 case Model.Crosshair_III_Formula: // IT8720F
96 v.Add(new Voltage("VBat", 8));
97 t.Add(new Temperature("CPU", 0));
98 for (int i = 0; i < superIO.Fans.Length; i++)
99 f.Add(new Fan("Fan #" + (i + 1), i));
101 case Model.M2N_SLI_DELUXE:
102 v.Add(new Voltage("CPU VCore", 0));
103 v.Add(new Voltage("+3.3V", 1));
104 v.Add(new Voltage("+5V", 3, 6.8f, 10));
105 v.Add(new Voltage("+12V", 4, 30, 10));
106 v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
107 v.Add(new Voltage("VBat", 8));
108 t.Add(new Temperature("CPU", 0));
109 t.Add(new Temperature("Motherboard", 1));
110 f.Add(new Fan("CPU Fan", 0));
111 f.Add(new Fan("Chassis Fan #1", 1));
112 f.Add(new Fan("Power Fan", 2));
114 case Model.M4A79XTD_EVO: // IT8720F
115 v.Add(new Voltage("+5V", 3, 6.8f, 10));
116 v.Add(new Voltage("VBat", 8));
117 t.Add(new Temperature("CPU", 0));
118 t.Add(new Temperature("Motherboard", 1));
119 f.Add(new Fan("CPU Fan", 0));
120 f.Add(new Fan("Chassis Fan #1", 1));
121 f.Add(new Fan("Chassis Fan #2", 2));
124 v.Add(new Voltage("CPU VCore", 0));
125 v.Add(new Voltage("Voltage #2", 1, true));
126 v.Add(new Voltage("Voltage #3", 2, true));
127 v.Add(new Voltage("Voltage #4", 3, true));
128 v.Add(new Voltage("Voltage #5", 4, true));
129 v.Add(new Voltage("Voltage #6", 5, true));
130 v.Add(new Voltage("Voltage #7", 6, true));
131 v.Add(new Voltage("Voltage #8", 7, true));
132 v.Add(new Voltage("VBat", 8));
133 for (int i = 0; i < superIO.Temperatures.Length; i++)
134 t.Add(new Temperature("Temperature #" + (i + 1), i));
135 for (int i = 0; i < superIO.Fans.Length; i++)
136 f.Add(new Fan("Fan #" + (i + 1), i));
141 case Manufacturer.ASRock:
143 case Model.P55_Deluxe: // IT8720F
145 v.Add(new Voltage("CPU VCore", 0));
146 v.Add(new Voltage("+3.3V", 2));
147 v.Add(new Voltage("+12V", 4, 30, 10));
148 v.Add(new Voltage("+5V", 5, 6.8f, 10));
149 v.Add(new Voltage("VBat", 8));
150 t.Add(new Temperature("CPU", 0));
151 t.Add(new Temperature("Motherboard", 1));
152 f.Add(new Fan("CPU Fan", 0));
153 f.Add(new Fan("Chassis Fan #1", 1));
155 // this mutex is also used by the official ASRock tool
156 mutex = new Mutex(false, "ASRockOCMark");
158 bool exclusiveAccess = false;
160 exclusiveAccess = mutex.WaitOne(10, false);
161 } catch (AbandonedMutexException) { }
162 catch (InvalidOperationException) { }
164 // only read additional fans if we get exclusive access
165 if (exclusiveAccess) {
167 f.Add(new Fan("Chassis Fan #2", 2));
168 f.Add(new Fan("Chassis Fan #3", 3));
169 f.Add(new Fan("Power Fan", 4));
171 readFan = (index) => {
173 return superIO.Fans[index];
176 byte? gpio = superIO.ReadGPIO(7);
180 // read the last 3 fans based on GPIO 83-85
181 int[] masks = { 0x05, 0x03, 0x06 };
182 return (((gpio.Value >> 3) & 0x07) ==
183 masks[index - 2]) ? superIO.Fans[2] : null;
190 byte? gpio = superIO.ReadGPIO(7);
194 // prepare the GPIO 83-85 for the next update
195 int[] masks = { 0x05, 0x03, 0x06 };
197 (byte)((gpio.Value & 0xC7) | (masks[fanIndex] << 3)));
198 fanIndex = (fanIndex + 1) % 3;
204 v.Add(new Voltage("CPU VCore", 0));
205 v.Add(new Voltage("Voltage #2", 1, true));
206 v.Add(new Voltage("Voltage #3", 2, true));
207 v.Add(new Voltage("Voltage #4", 3, true));
208 v.Add(new Voltage("Voltage #5", 4, true));
209 v.Add(new Voltage("Voltage #6", 5, true));
210 v.Add(new Voltage("Voltage #7", 6, true));
211 v.Add(new Voltage("Voltage #8", 7, true));
212 v.Add(new Voltage("VBat", 8));
213 for (int i = 0; i < superIO.Temperatures.Length; i++)
214 t.Add(new Temperature("Temperature #" + (i + 1), i));
215 for (int i = 0; i < superIO.Fans.Length; i++)
216 f.Add(new Fan("Fan #" + (i + 1), i));
221 case Manufacturer.DFI:
223 case Model.LP_BI_P45_T2RS_Elite: // IT8718F
224 v.Add(new Voltage("CPU VCore", 0));
225 v.Add(new Voltage("FSB VTT", 1));
226 v.Add(new Voltage("+3.3V", 2));
227 v.Add(new Voltage("+5V", 3, 6.8f, 10));
228 v.Add(new Voltage("+12V", 4, 30, 10));
229 v.Add(new Voltage("NB Core", 5));
230 v.Add(new Voltage("VDIMM", 6));
231 v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
232 v.Add(new Voltage("VBat", 8));
233 t.Add(new Temperature("CPU", 0));
234 t.Add(new Temperature("System", 1));
235 t.Add(new Temperature("Chipset", 2));
236 f.Add(new Fan("Fan #1", 0));
237 f.Add(new Fan("Fan #2", 1));
238 f.Add(new Fan("Fan #3", 2));
240 case Model.LP_DK_P55_T3eH9: // IT8720F
241 v.Add(new Voltage("CPU VCore", 0));
242 v.Add(new Voltage("VTT", 1));
243 v.Add(new Voltage("+3.3V", 2));
244 v.Add(new Voltage("+5V", 3, 6.8f, 10));
245 v.Add(new Voltage("+12V", 4, 30, 10));
246 v.Add(new Voltage("CPU PLL", 5));
247 v.Add(new Voltage("DRAM", 6));
248 v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
249 v.Add(new Voltage("VBat", 8));
250 t.Add(new Temperature("Chipset", 0));
251 t.Add(new Temperature("CPU PWM", 1));
252 t.Add(new Temperature("CPU", 2));
253 f.Add(new Fan("Fan #1", 0));
254 f.Add(new Fan("Fan #2", 1));
255 f.Add(new Fan("Fan #3", 2));
258 v.Add(new Voltage("CPU VCore", 0));
259 v.Add(new Voltage("VTT", 1, true));
260 v.Add(new Voltage("+3.3V", 2, true));
261 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
262 v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
263 v.Add(new Voltage("Voltage #6", 5, true));
264 v.Add(new Voltage("DRAM", 6, true));
265 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
266 v.Add(new Voltage("VBat", 8));
267 for (int i = 0; i < superIO.Temperatures.Length; i++)
268 t.Add(new Temperature("Temperature #" + (i + 1), i));
269 for (int i = 0; i < superIO.Fans.Length; i++)
270 f.Add(new Fan("Fan #" + (i + 1), i));
275 case Manufacturer.Gigabyte:
277 case Model._965P_S3: // IT8718F
278 v.Add(new Voltage("CPU VCore", 0));
279 v.Add(new Voltage("DRAM", 1));
280 v.Add(new Voltage("+3.3V", 2));
281 v.Add(new Voltage("+5V", 3, 6.8f, 10));
282 v.Add(new Voltage("+12V", 7, 27, 9.1f));
283 v.Add(new Voltage("VBat", 8));
284 t.Add(new Temperature("System", 0));
285 t.Add(new Temperature("CPU", 1));
286 f.Add(new Fan("CPU Fan", 0));
287 f.Add(new Fan("System Fan", 1));
289 case Model.EP45_DS3R: // IT8718F
290 case Model.EP45_UD3R:
292 v.Add(new Voltage("CPU VCore", 0));
293 v.Add(new Voltage("DRAM", 1));
294 v.Add(new Voltage("+3.3V", 2));
295 v.Add(new Voltage("+5V", 3, 6.8f, 10));
296 v.Add(new Voltage("+12V", 7, 27, 9.1f));
297 v.Add(new Voltage("VBat", 8));
298 t.Add(new Temperature("System", 0));
299 t.Add(new Temperature("CPU", 1));
300 f.Add(new Fan("CPU Fan", 0));
301 f.Add(new Fan("System Fan #2", 1));
302 f.Add(new Fan("Power Fan", 2));
303 f.Add(new Fan("System Fan #1", 3));
305 case Model.EX58_EXTREME: // IT8720F
306 v.Add(new Voltage("CPU VCore", 0));
307 v.Add(new Voltage("DRAM", 1));
308 v.Add(new Voltage("+5V", 3, 6.8f, 10));
309 v.Add(new Voltage("VBat", 8));
310 t.Add(new Temperature("System", 0));
311 t.Add(new Temperature("CPU", 1));
312 t.Add(new Temperature("Northbridge", 2));
313 f.Add(new Fan("CPU Fan", 0));
314 f.Add(new Fan("System Fan #2", 1));
315 f.Add(new Fan("Power Fan", 2));
316 f.Add(new Fan("System Fan #1", 3));
318 case Model.P35_DS3: // IT8718F
319 case Model.P35_DS3L: // IT8718F
320 v.Add(new Voltage("CPU VCore", 0));
321 v.Add(new Voltage("DRAM", 1));
322 v.Add(new Voltage("+3.3V", 2));
323 v.Add(new Voltage("+5V", 3, 6.8f, 10));
324 v.Add(new Voltage("+12V", 7, 27, 9.1f));
325 v.Add(new Voltage("VBat", 8));
326 t.Add(new Temperature("System", 0));
327 t.Add(new Temperature("CPU", 1));
328 f.Add(new Fan("CPU Fan", 0));
329 f.Add(new Fan("System Fan #1", 1));
330 f.Add(new Fan("System Fan #2", 2));
331 f.Add(new Fan("Power Fan", 3));
333 case Model.P55_UD4: // IT8720F
334 case Model.P55M_UD4: // IT8720F
335 v.Add(new Voltage("CPU VCore", 0));
336 v.Add(new Voltage("DRAM", 1));
337 v.Add(new Voltage("+3.3V", 2));
338 v.Add(new Voltage("+5V", 3, 6.8f, 10));
339 v.Add(new Voltage("+12V", 5, 27, 9.1f));
340 v.Add(new Voltage("VBat", 8));
341 t.Add(new Temperature("System", 0));
342 t.Add(new Temperature("CPU", 2));
343 f.Add(new Fan("CPU Fan", 0));
344 f.Add(new Fan("System Fan #2", 1));
345 f.Add(new Fan("Power Fan", 2));
346 f.Add(new Fan("System Fan #1", 3));
348 case Model.GA_MA770T_UD3: // IT8720F
349 v.Add(new Voltage("CPU VCore", 0));
350 v.Add(new Voltage("DRAM", 1));
351 v.Add(new Voltage("+3.3V", 2));
352 v.Add(new Voltage("+5V", 3, 6.8f, 10));
353 v.Add(new Voltage("+12V", 4, 27, 9.1f));
354 v.Add(new Voltage("VBat", 8));
355 t.Add(new Temperature("System", 0));
356 t.Add(new Temperature("CPU", 1));
357 f.Add(new Fan("CPU Fan", 0));
358 f.Add(new Fan("System Fan #1", 1));
359 f.Add(new Fan("System Fan #2", 2));
360 f.Add(new Fan("Power Fan", 3));
362 case Model.GA_MA785GMT_UD2H: // IT8718F
363 v.Add(new Voltage("CPU VCore", 0));
364 v.Add(new Voltage("DRAM", 1));
365 v.Add(new Voltage("+3.3V", 2));
366 v.Add(new Voltage("+5V", 3, 6.8f, 10));
367 v.Add(new Voltage("+12V", 4, 27, 9.1f));
368 v.Add(new Voltage("VBat", 8));
369 t.Add(new Temperature("System", 0));
370 t.Add(new Temperature("CPU", 1));
371 f.Add(new Fan("CPU Fan", 0));
372 f.Add(new Fan("System Fan", 1));
373 f.Add(new Fan("NB Fan", 2));
375 case Model.X58A_UD3R: // IT8720F
376 v.Add(new Voltage("CPU VCore", 0));
377 v.Add(new Voltage("DRAM", 1));
378 v.Add(new Voltage("+3.3V", 2));
379 v.Add(new Voltage("+5V", 3, 6.8f, 10));
380 v.Add(new Voltage("+12V", 5, 27, 9.1f));
381 v.Add(new Voltage("VBat", 8));
382 t.Add(new Temperature("System", 0));
383 t.Add(new Temperature("CPU", 1));
384 t.Add(new Temperature("Northbridge", 2));
385 f.Add(new Fan("CPU Fan", 0));
386 f.Add(new Fan("System Fan #2", 1));
387 f.Add(new Fan("Power Fan", 2));
388 f.Add(new Fan("System Fan #1", 3));
391 v.Add(new Voltage("CPU VCore", 0));
392 v.Add(new Voltage("DRAM", 1, true));
393 v.Add(new Voltage("+3.3V", 2, true));
394 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
395 v.Add(new Voltage("Voltage #5", 4, true));
396 v.Add(new Voltage("Voltage #6", 5, true));
397 v.Add(new Voltage("Voltage #7", 6, true));
398 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
399 v.Add(new Voltage("VBat", 8));
400 for (int i = 0; i < superIO.Temperatures.Length; i++)
401 t.Add(new Temperature("Temperature #" + (i + 1), i));
402 for (int i = 0; i < superIO.Fans.Length; i++)
403 f.Add(new Fan("Fan #" + (i + 1), i));
409 v.Add(new Voltage("CPU VCore", 0));
410 v.Add(new Voltage("Voltage #2", 1, true));
411 v.Add(new Voltage("Voltage #3", 2, true));
412 v.Add(new Voltage("Voltage #4", 3, true));
413 v.Add(new Voltage("Voltage #5", 4, true));
414 v.Add(new Voltage("Voltage #6", 5, true));
415 v.Add(new Voltage("Voltage #7", 6, true));
416 v.Add(new Voltage("Voltage #8", 7, true));
417 v.Add(new Voltage("VBat", 8));
418 for (int i = 0; i < superIO.Temperatures.Length; i++)
419 t.Add(new Temperature("Temperature #" + (i + 1), i));
420 for (int i = 0; i < superIO.Fans.Length; i++)
421 f.Add(new Fan("Fan #" + (i + 1), i));
427 switch (manufacturer) {
428 case Manufacturer.ECS:
430 case Model.A890GXM_A: // IT8721F
431 v.Add(new Voltage("CPU VCore", 0));
432 v.Add(new Voltage("VDIMM", 1));
433 v.Add(new Voltage("NB Voltage", 2));
434 v.Add(new Voltage("Analog +3.3V", 3, 10, 10));
435 // v.Add(new Voltage("VDIMM", 6, true));
436 v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
437 v.Add(new Voltage("VBat", 8, 10, 10));
438 t.Add(new Temperature("CPU", 0));
439 t.Add(new Temperature("System", 1));
440 t.Add(new Temperature("Northbridge", 2));
441 f.Add(new Fan("CPU Fan", 0));
442 f.Add(new Fan("System Fan", 1));
443 f.Add(new Fan("Power Fan", 2));
446 v.Add(new Voltage("Voltage #1", 0, true));
447 v.Add(new Voltage("Voltage #2", 1, true));
448 v.Add(new Voltage("Voltage #3", 2, true));
449 v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
450 v.Add(new Voltage("Voltage #5", 4, true));
451 v.Add(new Voltage("Voltage #6", 5, true));
452 v.Add(new Voltage("Voltage #7", 6, true));
453 v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
454 v.Add(new Voltage("VBat", 8, 10, 10));
455 for (int i = 0; i < superIO.Temperatures.Length; i++)
456 t.Add(new Temperature("Temperature #" + (i + 1), i));
457 for (int i = 0; i < superIO.Fans.Length; i++)
458 f.Add(new Fan("Fan #" + (i + 1), i));
463 v.Add(new Voltage("Voltage #1", 0, true));
464 v.Add(new Voltage("Voltage #2", 1, true));
465 v.Add(new Voltage("Voltage #3", 2, true));
466 v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
467 v.Add(new Voltage("Voltage #5", 4, true));
468 v.Add(new Voltage("Voltage #6", 5, true));
469 v.Add(new Voltage("Voltage #7", 6, true));
470 v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
471 v.Add(new Voltage("VBat", 8, 10, 10));
472 for (int i = 0; i < superIO.Temperatures.Length; i++)
473 t.Add(new Temperature("Temperature #" + (i + 1), i));
474 for (int i = 0; i < superIO.Fans.Length; i++)
475 f.Add(new Fan("Fan #" + (i + 1), i));
481 v.Add(new Voltage("VCC3V", 0, 150, 150));
482 v.Add(new Voltage("VSB3V", 1, 150, 150));
483 v.Add(new Voltage("Battery", 2, 150, 150));
484 for (int i = 0; i < superIO.Temperatures.Length; i++)
485 t.Add(new Temperature("Temperature #" + (i + 1), i));
486 for (int i = 0; i < superIO.Fans.Length; i++)
487 f.Add(new Fan("Fan #" + (i + 1), i));
494 switch (manufacturer) {
495 case Manufacturer.EVGA:
497 case Model.X58_SLI_Classified: // F71882
498 v.Add(new Voltage("VCC3V", 0, 150, 150));
499 v.Add(new Voltage("CPU VCore", 1, 47, 100));
500 v.Add(new Voltage("DIMM", 2, 47, 100));
501 v.Add(new Voltage("CPU VTT", 3, 24, 100));
502 v.Add(new Voltage("IOH Vcore", 4, 24, 100));
503 v.Add(new Voltage("+5V", 5, 51, 12));
504 v.Add(new Voltage("+12V", 6, 56, 6.8f));
505 v.Add(new Voltage("3VSB", 7, 150, 150));
506 v.Add(new Voltage("VBat", 8, 150, 150));
507 t.Add(new Temperature("CPU", 0));
508 t.Add(new Temperature("VREG", 1));
509 t.Add(new Temperature("System", 2));
510 f.Add(new Fan("CPU Fan", 0));
511 f.Add(new Fan("Power Fan", 1));
512 f.Add(new Fan("Chassis Fan", 2));
515 v.Add(new Voltage("VCC3V", 0, 150, 150));
516 v.Add(new Voltage("CPU VCore", 1));
517 v.Add(new Voltage("Voltage #3", 2, true));
518 v.Add(new Voltage("Voltage #4", 3, true));
519 v.Add(new Voltage("Voltage #5", 4, true));
520 v.Add(new Voltage("Voltage #6", 5, true));
521 v.Add(new Voltage("Voltage #7", 6, true));
522 v.Add(new Voltage("VSB3V", 7, 150, 150));
523 v.Add(new Voltage("VBat", 8, 150, 150));
524 for (int i = 0; i < superIO.Temperatures.Length; i++)
525 t.Add(new Temperature("Temperature #" + (i + 1), i));
526 for (int i = 0; i < superIO.Fans.Length; i++)
527 f.Add(new Fan("Fan #" + (i + 1), i));
532 v.Add(new Voltage("VCC3V", 0, 150, 150));
533 v.Add(new Voltage("CPU VCore", 1));
534 v.Add(new Voltage("Voltage #3", 2, true));
535 v.Add(new Voltage("Voltage #4", 3, true));
536 v.Add(new Voltage("Voltage #5", 4, true));
537 v.Add(new Voltage("Voltage #6", 5, true));
538 v.Add(new Voltage("Voltage #7", 6, true));
539 v.Add(new Voltage("VSB3V", 7, 150, 150));
540 v.Add(new Voltage("VBat", 8, 150, 150));
541 for (int i = 0; i < superIO.Temperatures.Length; i++)
542 t.Add(new Temperature("Temperature #" + (i + 1), i));
543 for (int i = 0; i < superIO.Fans.Length; i++)
544 f.Add(new Fan("Fan #" + (i + 1), i));
550 switch (manufacturer) {
551 case Manufacturer.ASRock:
553 case Model.AOD790GX_128M: // W83627EHF
554 v.Add(new Voltage("CPU VCore", 0));
555 v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
556 v.Add(new Voltage("+3.3V", 4, 10, 10));
557 v.Add(new Voltage("+5V", 5, 20, 10));
558 v.Add(new Voltage("+12V", 6, 28, 5));
559 v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
560 v.Add(new Voltage("VBAT", 8, 34, 34));
561 t.Add(new Temperature("CPU", 0));
562 t.Add(new Temperature("Motherboard", 2));
563 f.Add(new Fan("CPU Fan", 0));
564 f.Add(new Fan("Chassis Fan", 1));
567 v.Add(new Voltage("CPU VCore", 0));
568 v.Add(new Voltage("Voltage #2", 1, true));
569 v.Add(new Voltage("AVCC", 2, 34, 34));
570 v.Add(new Voltage("3VCC", 3, 34, 34));
571 v.Add(new Voltage("Voltage #5", 4, true));
572 v.Add(new Voltage("Voltage #6", 5, true));
573 v.Add(new Voltage("Voltage #7", 6, true));
574 v.Add(new Voltage("3VSB", 7, 34, 34));
575 v.Add(new Voltage("VBAT", 8, 34, 34));
576 v.Add(new Voltage("Voltage #10", 9, true));
577 t.Add(new Temperature("CPU", 0));
578 t.Add(new Temperature("Auxiliary", 1));
579 t.Add(new Temperature("System", 2));
580 f.Add(new Fan("System Fan", 0));
581 f.Add(new Fan("CPU Fan", 1));
582 f.Add(new Fan("Auxiliary Fan", 2));
583 f.Add(new Fan("CPU Fan #2", 3));
584 f.Add(new Fan("Auxiliary Fan #2", 4));
588 v.Add(new Voltage("CPU VCore", 0));
589 v.Add(new Voltage("Voltage #2", 1, true));
590 v.Add(new Voltage("AVCC", 2, 34, 34));
591 v.Add(new Voltage("3VCC", 3, 34, 34));
592 v.Add(new Voltage("Voltage #5", 4, true));
593 v.Add(new Voltage("Voltage #6", 5, true));
594 v.Add(new Voltage("Voltage #7", 6, true));
595 v.Add(new Voltage("3VSB", 7, 34, 34));
596 v.Add(new Voltage("VBAT", 8, 34, 34));
597 v.Add(new Voltage("Voltage #10", 9, true));
598 t.Add(new Temperature("CPU", 0));
599 t.Add(new Temperature("Auxiliary", 1));
600 t.Add(new Temperature("System", 2));
601 f.Add(new Fan("System Fan", 0));
602 f.Add(new Fan("CPU Fan", 1));
603 f.Add(new Fan("Auxiliary Fan", 2));
604 f.Add(new Fan("CPU Fan #2", 3));
605 f.Add(new Fan("Auxiliary Fan #2", 4));
610 case Chip.W83627DHGP:
613 switch (manufacturer) {
614 case Manufacturer.ASRock:
616 case Model._880GMH_USB3: // W83627DHG-P
617 v.Add(new Voltage("CPU VCore", 0));
618 v.Add(new Voltage("+3.3V", 3, 34, 34));
619 v.Add(new Voltage("+5V", 5, 15, 7.5f));
620 v.Add(new Voltage("+12V", 6, 56, 10));
621 v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
622 v.Add(new Voltage("VBAT", 8, 34, 34));
623 t.Add(new Temperature("CPU", 0));
624 t.Add(new Temperature("Motherboard", 2));
625 f.Add(new Fan("Chassis Fan", 0));
626 f.Add(new Fan("CPU Fan", 1));
627 f.Add(new Fan("Power Fan", 2));
630 v.Add(new Voltage("CPU VCore", 0));
631 v.Add(new Voltage("Voltage #2", 1, true));
632 v.Add(new Voltage("AVCC", 2, 34, 34));
633 v.Add(new Voltage("3VCC", 3, 34, 34));
634 v.Add(new Voltage("Voltage #5", 4, true));
635 v.Add(new Voltage("Voltage #6", 5, true));
636 v.Add(new Voltage("Voltage #7", 6, true));
637 v.Add(new Voltage("3VSB", 7, 34, 34));
638 v.Add(new Voltage("VBAT", 8, 34, 34));
639 t.Add(new Temperature("CPU", 0));
640 t.Add(new Temperature("Auxiliary", 1));
641 t.Add(new Temperature("System", 2));
642 f.Add(new Fan("System Fan", 0));
643 f.Add(new Fan("CPU Fan", 1));
644 f.Add(new Fan("Auxiliary Fan", 2));
645 f.Add(new Fan("CPU Fan #2", 3));
646 f.Add(new Fan("Auxiliary Fan #2", 4));
650 case Manufacturer.ASUS:
652 case Model.P6X58D_E: // W83667HG
653 case Model.Rampage_II_GENE: // W83667HG
654 v.Add(new Voltage("CPU VCore", 0));
655 v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
656 v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
657 v.Add(new Voltage("+3.3V", 3, 34, 34));
658 v.Add(new Voltage("+5V", 4, 15, 7.5f));
659 v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
660 v.Add(new Voltage("VBAT", 8, 34, 34));
661 t.Add(new Temperature("CPU", 0));
662 t.Add(new Temperature("Motherboard", 2));
663 f.Add(new Fan("Chassis Fan #1", 0));
664 f.Add(new Fan("CPU Fan", 1));
665 f.Add(new Fan("Power Fan", 2));
666 f.Add(new Fan("Chassis Fan #2", 3));
667 f.Add(new Fan("Chassis Fan #3", 4));
669 case Model.Rampage_Extreme: // W83667HG
670 v.Add(new Voltage("CPU VCore", 0));
671 v.Add(new Voltage("+12V", 1, 12, 2));
672 v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
673 v.Add(new Voltage("+3.3V", 3, 34, 34));
674 v.Add(new Voltage("+5V", 4, 15, 7.5f));
675 v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
676 v.Add(new Voltage("VBAT", 8, 34, 34));
677 t.Add(new Temperature("CPU", 0));
678 t.Add(new Temperature("Motherboard", 2));
679 f.Add(new Fan("Chassis Fan #1", 0));
680 f.Add(new Fan("CPU Fan", 1));
681 f.Add(new Fan("Power Fan", 2));
682 f.Add(new Fan("Chassis Fan #2", 3));
683 f.Add(new Fan("Chassis Fan #3", 4));
686 v.Add(new Voltage("CPU VCore", 0));
687 v.Add(new Voltage("Voltage #2", 1, true));
688 v.Add(new Voltage("AVCC", 2, 34, 34));
689 v.Add(new Voltage("3VCC", 3, 34, 34));
690 v.Add(new Voltage("Voltage #5", 4, true));
691 v.Add(new Voltage("Voltage #6", 5, true));
692 v.Add(new Voltage("Voltage #7", 6, true));
693 v.Add(new Voltage("3VSB", 7, 34, 34));
694 v.Add(new Voltage("VBAT", 8, 34, 34));
695 t.Add(new Temperature("CPU", 0));
696 t.Add(new Temperature("Auxiliary", 1));
697 t.Add(new Temperature("System", 2));
698 f.Add(new Fan("System Fan", 0));
699 f.Add(new Fan("CPU Fan", 1));
700 f.Add(new Fan("Auxiliary Fan", 2));
701 f.Add(new Fan("CPU Fan #2", 3));
702 f.Add(new Fan("Auxiliary Fan #2", 4));
707 v.Add(new Voltage("CPU VCore", 0));
708 v.Add(new Voltage("Voltage #2", 1, true));
709 v.Add(new Voltage("AVCC", 2, 34, 34));
710 v.Add(new Voltage("3VCC", 3, 34, 34));
711 v.Add(new Voltage("Voltage #5", 4, true));
712 v.Add(new Voltage("Voltage #6", 5, true));
713 v.Add(new Voltage("Voltage #7", 6, true));
714 v.Add(new Voltage("3VSB", 7, 34, 34));
715 v.Add(new Voltage("VBAT", 8, 34, 34));
716 t.Add(new Temperature("CPU", 0));
717 t.Add(new Temperature("Auxiliary", 1));
718 t.Add(new Temperature("System", 2));
719 f.Add(new Fan("System Fan", 0));
720 f.Add(new Fan("CPU Fan", 1));
721 f.Add(new Fan("Auxiliary Fan", 2));
722 f.Add(new Fan("CPU Fan #2", 3));
723 f.Add(new Fan("Auxiliary Fan #2", 4));
730 v.Add(new Voltage("CPU VCore", 0));
731 v.Add(new Voltage("Voltage #2", 1, true));
732 v.Add(new Voltage("Voltage #3", 2, true));
733 v.Add(new Voltage("AVCC", 3, 34, 51));
734 v.Add(new Voltage("Voltage #5", 4, true));
735 v.Add(new Voltage("5VSB", 5, 34, 51));
736 v.Add(new Voltage("VBAT", 6));
737 t.Add(new Temperature("CPU", 0));
738 t.Add(new Temperature("Auxiliary", 1));
739 t.Add(new Temperature("System", 2));
740 f.Add(new Fan("System Fan", 0));
741 f.Add(new Fan("CPU Fan", 1));
742 f.Add(new Fan("Auxiliary Fan", 2));
745 v.Add(new Voltage("CPU VCore", 0));
746 v.Add(new Voltage("Voltage #2", 1, true));
747 v.Add(new Voltage("AVCC", 2, 34, 34));
748 v.Add(new Voltage("3VCC", 3, 34, 34));
749 v.Add(new Voltage("Voltage #5", 4, true));
750 v.Add(new Voltage("Voltage #6", 5, true));
751 v.Add(new Voltage("Voltage #7", 6, true));
752 v.Add(new Voltage("3VSB", 7, 34, 34));
753 v.Add(new Voltage("VBAT", 8, 34, 34));
754 t.Add(new Temperature("CPU", 0));
755 t.Add(new Temperature("Auxiliary", 1));
756 t.Add(new Temperature("System", 2));
757 f.Add(new Fan("System Fan", 0));
758 f.Add(new Fan("CPU Fan", 1));
759 f.Add(new Fan("Auxiliary Fan", 2));
760 f.Add(new Fan("Auxiliary Fan #2", 4));
763 for (int i = 0; i < superIO.Voltages.Length; i++)
764 v.Add(new Voltage("Voltage #" + (i + 1), i, true));
765 for (int i = 0; i < superIO.Temperatures.Length; i++)
766 t.Add(new Temperature("Temperature #" + (i + 1), i));
767 for (int i = 0; i < superIO.Fans.Length; i++)
768 f.Add(new Fan("Fan #" + (i + 1), i));
772 const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
773 foreach (Voltage voltage in v)
774 if (voltage.Index < superIO.Voltages.Length) {
775 Sensor sensor = new Sensor(voltage.Name, voltage.Index,
776 voltage.Hidden, SensorType.Voltage, this, new [] {
777 new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
778 formula, voltage.Ri),
779 new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
780 formula, voltage.Rf),
781 new ParameterDescription("Vf [V]", "Reference voltage.\n" +
784 voltages.Add(sensor);
787 foreach (Temperature temperature in t)
788 if (temperature.Index < superIO.Temperatures.Length) {
789 Sensor sensor = new Sensor(temperature.Name, temperature.Index,
790 SensorType.Temperature, this, new [] {
791 new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
793 temperatures.Add(sensor);
796 foreach (Fan fan in f)
797 if (fan.Index < superIO.Fans.Length) {
798 Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
804 public override Identifier Identifier {
806 return new Identifier("lpc",
807 superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture));
811 public override HardwareType HardwareType {
812 get { return HardwareType.SuperIO; }
815 public override IHardware Parent {
816 get { return mainboard; }
819 public override string Name {
823 public override string GetReport() {
824 return superIO.GetReport();
827 public override void Update() {
830 foreach (Sensor sensor in voltages) {
831 float? value = readVoltage(sensor.Index);
832 if (value.HasValue) {
833 sensor.Value = value + (value - sensor.Parameters[2].Value) *
834 sensor.Parameters[0].Value / sensor.Parameters[1].Value;
835 ActivateSensor(sensor);
839 foreach (Sensor sensor in temperatures) {
840 float? value = readTemperature(sensor.Index);
841 if (value.HasValue) {
842 sensor.Value = value + sensor.Parameters[0].Value;
843 ActivateSensor(sensor);
847 foreach (Sensor sensor in fans) {
848 float? value = readFan(sensor.Index);
849 if (value.HasValue) {
850 sensor.Value = value;
852 ActivateSensor(sensor);
859 private class Voltage {
860 public readonly string Name;
861 public readonly int Index;
862 public readonly float Ri;
863 public readonly float Rf;
864 public readonly float Vf;
865 public readonly bool Hidden;
867 public Voltage(string name, int index) :
868 this(name, index, false) { }
870 public Voltage(string name, int index, bool hidden) :
871 this(name, index, 0, 1, 0, hidden) { }
873 public Voltage(string name, int index, float ri, float rf) :
874 this(name, index, ri, rf, 0, false) { }
876 // float ri = 0, float rf = 1, float vf = 0, bool hidden = false)
878 public Voltage(string name, int index,
879 float ri, float rf, float vf, bool hidden)
886 this.Hidden = hidden;
890 private class Temperature {
891 public readonly string Name;
892 public readonly int Index;
894 public Temperature(string name, int index) {
901 public readonly string Name;
902 public readonly int Index;
904 public Fan(string name, int index) {