Added a desktop gadget implementation.
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 OpenHardwareMonitor.Hardware.LPC;
43 namespace OpenHardwareMonitor.Hardware.Mainboard {
44 internal class SuperIOHardware : Hardware {
46 private Mainboard mainboard;
47 private ISuperIO superIO;
50 private List<Sensor> voltages = new List<Sensor>();
51 private List<Sensor> temperatures = new List<Sensor>();
52 private List<Sensor> fans = new List<Sensor>();
55 public SuperIOHardware(Mainboard mainboard, ISuperIO superIO,
56 Manufacturer manufacturer, Model model, ISettings settings)
58 this.mainboard = mainboard;
59 this.superIO = superIO;
60 this.name = ChipName.GetName(superIO.Chip);
62 List<Voltage> v = new List<Voltage>();
63 List<Temperature> t = new List<Temperature>();
64 List<Fan> f = new List<Fan>();
66 switch (superIO.Chip) {
72 switch (manufacturer) {
73 case Manufacturer.ASUS:
75 case Model.Crosshair_III_Formula: // IT8720F
76 v.Add(new Voltage("VBat", 8));
77 t.Add(new Temperature("CPU", 0));
78 for (int i = 0; i < superIO.Fans.Length; i++)
79 f.Add(new Fan("Fan #" + (i + 1), i));
81 case Model.M2N_SLI_DELUXE:
82 v.Add(new Voltage("CPU VCore", 0));
83 v.Add(new Voltage("+3.3V", 1));
84 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
85 v.Add(new Voltage("+12V", 4, 30, 10, 0));
86 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
87 v.Add(new Voltage("VBat", 8));
88 t.Add(new Temperature("CPU", 0));
89 t.Add(new Temperature("Motherboard", 1));
90 f.Add(new Fan("CPU Fan", 0));
91 f.Add(new Fan("Chassis Fan #1", 1));
92 f.Add(new Fan("Power Fan", 2));
94 case Model.M4A79XTD_EVO: // IT8720F
95 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
96 v.Add(new Voltage("VBat", 8));
97 t.Add(new Temperature("CPU", 0));
98 t.Add(new Temperature("Motherboard", 1));
99 f.Add(new Fan("CPU Fan", 0));
100 f.Add(new Fan("Chassis Fan #1", 1));
101 f.Add(new Fan("Chassis Fan #2", 2));
104 v.Add(new Voltage("CPU VCore", 0));
105 v.Add(new Voltage("Voltage #2", 1, true));
106 v.Add(new Voltage("Voltage #3", 2, true));
107 v.Add(new Voltage("Voltage #4", 3, true));
108 v.Add(new Voltage("Voltage #5", 4, true));
109 v.Add(new Voltage("Voltage #6", 5, true));
110 v.Add(new Voltage("Voltage #7", 6, true));
111 v.Add(new Voltage("Voltage #8", 7, true));
112 v.Add(new Voltage("VBat", 8));
113 for (int i = 0; i < superIO.Temperatures.Length; i++)
114 t.Add(new Temperature("Temperature #" + (i + 1), i));
115 for (int i = 0; i < superIO.Fans.Length; i++)
116 f.Add(new Fan("Fan #" + (i + 1), i));
120 case Manufacturer.DFI:
122 case Model.LP_BI_P45_T2RS_Elite: // IT8718F
123 v.Add(new Voltage("CPU VCore", 0));
124 v.Add(new Voltage("FSB VTT", 1));
125 v.Add(new Voltage("+3.3V", 2));
126 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
127 v.Add(new Voltage("+12V", 4, 30, 10, 0));
128 v.Add(new Voltage("NB Core", 5));
129 v.Add(new Voltage("VDIMM", 6));
130 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
131 v.Add(new Voltage("VBat", 8));
132 t.Add(new Temperature("CPU", 0));
133 t.Add(new Temperature("System", 1));
134 t.Add(new Temperature("Chipset", 2));
135 f.Add(new Fan("Fan #1", 0));
136 f.Add(new Fan("Fan #2", 1));
137 f.Add(new Fan("Fan #3", 2));
139 case Model.LP_DK_P55_T3eH9: // IT8720F
140 v.Add(new Voltage("CPU VCore", 0));
141 v.Add(new Voltage("VTT", 1));
142 v.Add(new Voltage("+3.3V", 2));
143 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
144 v.Add(new Voltage("+12V", 4, 30, 10, 0));
145 v.Add(new Voltage("CPU PLL", 5));
146 v.Add(new Voltage("DRAM", 6));
147 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
148 v.Add(new Voltage("VBat", 8));
149 t.Add(new Temperature("Chipset", 0));
150 t.Add(new Temperature("CPU PWM", 1));
151 t.Add(new Temperature("CPU", 2));
152 f.Add(new Fan("Fan #1", 0));
153 f.Add(new Fan("Fan #2", 1));
154 f.Add(new Fan("Fan #3", 2));
157 v.Add(new Voltage("CPU VCore", 0));
158 v.Add(new Voltage("VTT", 1, true));
159 v.Add(new Voltage("+3.3V", 2, true));
160 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
161 v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
162 v.Add(new Voltage("Voltage #6", 5, true));
163 v.Add(new Voltage("DRAM", 6, true));
164 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
165 v.Add(new Voltage("VBat", 8));
166 for (int i = 0; i < superIO.Temperatures.Length; i++)
167 t.Add(new Temperature("Temperature #" + (i + 1), i));
168 for (int i = 0; i < superIO.Fans.Length; i++)
169 f.Add(new Fan("Fan #" + (i + 1), i));
174 case Manufacturer.Gigabyte:
176 case Model._965P_S3: // IT8718F
177 v.Add(new Voltage("CPU VCore", 0));
178 v.Add(new Voltage("DRAM", 1));
179 v.Add(new Voltage("+3.3V", 2));
180 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
181 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
182 v.Add(new Voltage("VBat", 8));
183 t.Add(new Temperature("System", 0));
184 t.Add(new Temperature("CPU", 1));
185 f.Add(new Fan("CPU Fan", 0));
186 f.Add(new Fan("System Fan", 1));
188 case Model.EP45_DS3R: // IT8718F
189 case Model.EP45_UD3R:
191 v.Add(new Voltage("CPU VCore", 0));
192 v.Add(new Voltage("DRAM", 1));
193 v.Add(new Voltage("+3.3V", 2));
194 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
195 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
196 v.Add(new Voltage("VBat", 8));
197 t.Add(new Temperature("System", 0));
198 t.Add(new Temperature("CPU", 1));
199 f.Add(new Fan("CPU Fan", 0));
200 f.Add(new Fan("System Fan #2", 1));
201 f.Add(new Fan("Power Fan", 2));
202 f.Add(new Fan("System Fan #1", 3));
204 case Model.EX58_EXTREME: // IT8720F
205 v.Add(new Voltage("CPU VCore", 0));
206 v.Add(new Voltage("DRAM", 1));
207 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
208 v.Add(new Voltage("VBat", 8));
209 t.Add(new Temperature("System", 0));
210 t.Add(new Temperature("CPU", 1));
211 t.Add(new Temperature("Northbridge", 2));
212 f.Add(new Fan("CPU Fan", 0));
213 f.Add(new Fan("System Fan #2", 1));
214 f.Add(new Fan("Power Fan", 2));
215 f.Add(new Fan("System Fan #1", 3));
217 case Model.P35_DS3: // IT8718F
218 case Model.P35_DS3L: // IT8718F
219 v.Add(new Voltage("CPU VCore", 0));
220 v.Add(new Voltage("DRAM", 1));
221 v.Add(new Voltage("+3.3V", 2));
222 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
223 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
224 v.Add(new Voltage("VBat", 8));
225 t.Add(new Temperature("System", 0));
226 t.Add(new Temperature("CPU", 1));
227 f.Add(new Fan("CPU Fan", 0));
228 f.Add(new Fan("System Fan #1", 1));
229 f.Add(new Fan("System Fan #2", 2));
230 f.Add(new Fan("Power Fan", 3));
232 case Model.P55_UD4: // IT8720F
233 case Model.P55M_UD4: // IT8720F
234 v.Add(new Voltage("CPU VCore", 0));
235 v.Add(new Voltage("DRAM", 1));
236 v.Add(new Voltage("+3.3V", 2));
237 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
238 v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
239 v.Add(new Voltage("VBat", 8));
240 t.Add(new Temperature("System", 0));
241 t.Add(new Temperature("CPU", 2));
242 f.Add(new Fan("CPU Fan", 0));
243 f.Add(new Fan("System Fan #2", 1));
244 f.Add(new Fan("Power Fan", 2));
245 f.Add(new Fan("System Fan #1", 3));
247 case Model.GA_MA770T_UD3: // IT8720F
248 v.Add(new Voltage("CPU VCore", 0));
249 v.Add(new Voltage("DRAM", 1));
250 v.Add(new Voltage("+3.3V", 2));
251 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
252 v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
253 v.Add(new Voltage("VBat", 8));
254 t.Add(new Temperature("System", 0));
255 t.Add(new Temperature("CPU", 1));
256 f.Add(new Fan("CPU Fan", 0));
257 f.Add(new Fan("System Fan #1", 1));
258 f.Add(new Fan("System Fan #2", 2));
259 f.Add(new Fan("Power Fan", 3));
261 case Model.GA_MA785GMT_UD2H: // IT8718F
262 v.Add(new Voltage("CPU VCore", 0));
263 v.Add(new Voltage("DRAM", 1));
264 v.Add(new Voltage("+3.3V", 2));
265 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
266 v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
267 v.Add(new Voltage("VBat", 8));
268 t.Add(new Temperature("System", 0));
269 t.Add(new Temperature("CPU", 1));
270 f.Add(new Fan("CPU Fan", 0));
271 f.Add(new Fan("System Fan", 1));
272 f.Add(new Fan("NB Fan", 2));
274 case Model.X58A_UD3R: // IT8720F
275 v.Add(new Voltage("CPU VCore", 0));
276 v.Add(new Voltage("DRAM", 1));
277 v.Add(new Voltage("+3.3V", 2));
278 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
279 v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
280 v.Add(new Voltage("VBat", 8));
281 t.Add(new Temperature("System", 0));
282 t.Add(new Temperature("CPU", 1));
283 t.Add(new Temperature("Northbridge", 2));
284 f.Add(new Fan("CPU Fan", 0));
285 f.Add(new Fan("System Fan #2", 1));
286 f.Add(new Fan("Power Fan", 2));
287 f.Add(new Fan("System Fan #1", 3));
290 v.Add(new Voltage("CPU VCore", 0));
291 v.Add(new Voltage("DRAM", 1, true));
292 v.Add(new Voltage("+3.3V", 2, true));
293 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
294 v.Add(new Voltage("Voltage #5", 4, true));
295 v.Add(new Voltage("Voltage #6", 5, true));
296 v.Add(new Voltage("Voltage #7", 6, true));
297 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
298 v.Add(new Voltage("VBat", 8));
299 for (int i = 0; i < superIO.Temperatures.Length; i++)
300 t.Add(new Temperature("Temperature #" + (i + 1), i));
301 for (int i = 0; i < superIO.Fans.Length; i++)
302 f.Add(new Fan("Fan #" + (i + 1), i));
308 v.Add(new Voltage("CPU VCore", 0));
309 v.Add(new Voltage("Voltage #2", 1, true));
310 v.Add(new Voltage("Voltage #3", 2, true));
311 v.Add(new Voltage("Voltage #4", 3, true));
312 v.Add(new Voltage("Voltage #5", 4, true));
313 v.Add(new Voltage("Voltage #6", 5, true));
314 v.Add(new Voltage("Voltage #7", 6, true));
315 v.Add(new Voltage("Voltage #8", 7, true));
316 v.Add(new Voltage("VBat", 8));
317 for (int i = 0; i < superIO.Temperatures.Length; i++)
318 t.Add(new Temperature("Temperature #" + (i + 1), i));
319 for (int i = 0; i < superIO.Fans.Length; i++)
320 f.Add(new Fan("Fan #" + (i + 1), i));
326 v.Add(new Voltage("Voltage #1", 0, true));
327 v.Add(new Voltage("Voltage #2", 1, true));
328 v.Add(new Voltage("Voltage #3", 2, true));
329 v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
330 v.Add(new Voltage("Voltage #5", 4, true));
331 v.Add(new Voltage("Voltage #6", 5, true));
332 v.Add(new Voltage("Voltage #7", 6, true));
333 v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
334 v.Add(new Voltage("VBat", 8, 10, 10, 0));
335 for (int i = 0; i < superIO.Temperatures.Length; i++)
336 t.Add(new Temperature("Temperature #" + (i + 1), i));
337 for (int i = 0; i < superIO.Fans.Length; i++)
338 f.Add(new Fan("Fan #" + (i + 1), i));
342 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
343 v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
344 v.Add(new Voltage("Battery", 2, 150, 150, 0));
345 for (int i = 0; i < superIO.Temperatures.Length; i++)
346 t.Add(new Temperature("Temperature #" + (i + 1), i));
347 for (int i = 0; i < superIO.Fans.Length; i++)
348 f.Add(new Fan("Fan #" + (i + 1), i));
355 switch (manufacturer) {
356 case Manufacturer.EVGA:
358 case Model.X58_SLI_Classified: // F71882
359 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
360 v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
361 v.Add(new Voltage("DIMM", 2, 47, 100, 0));
362 v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
363 v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
364 v.Add(new Voltage("+5V", 5, 51, 12, 0));
365 v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
366 v.Add(new Voltage("3VSB", 7, 150, 150, 0));
367 v.Add(new Voltage("VBat", 8, 150, 150, 0));
368 t.Add(new Temperature("CPU", 0));
369 t.Add(new Temperature("VREG", 1));
370 t.Add(new Temperature("System", 2));
371 f.Add(new Fan("CPU Fan", 0));
372 f.Add(new Fan("Power Fan", 1));
373 f.Add(new Fan("Chassis Fan", 2));
376 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
377 v.Add(new Voltage("CPU VCore", 1));
378 v.Add(new Voltage("Voltage #3", 2, true));
379 v.Add(new Voltage("Voltage #4", 3, true));
380 v.Add(new Voltage("Voltage #5", 4, true));
381 v.Add(new Voltage("Voltage #6", 5, true));
382 v.Add(new Voltage("Voltage #7", 6, true));
383 v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
384 v.Add(new Voltage("VBat", 8, 150, 150, 0));
385 for (int i = 0; i < superIO.Temperatures.Length; i++)
386 t.Add(new Temperature("Temperature #" + (i + 1), i));
387 for (int i = 0; i < superIO.Fans.Length; i++)
388 f.Add(new Fan("Fan #" + (i + 1), i));
393 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
394 v.Add(new Voltage("CPU VCore", 1));
395 v.Add(new Voltage("Voltage #3", 2, true));
396 v.Add(new Voltage("Voltage #4", 3, true));
397 v.Add(new Voltage("Voltage #5", 4, true));
398 v.Add(new Voltage("Voltage #6", 5, true));
399 v.Add(new Voltage("Voltage #7", 6, true));
400 v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
401 v.Add(new Voltage("VBat", 8, 150, 150, 0));
402 for (int i = 0; i < superIO.Temperatures.Length; i++)
403 t.Add(new Temperature("Temperature #" + (i + 1), i));
404 for (int i = 0; i < superIO.Fans.Length; i++)
405 f.Add(new Fan("Fan #" + (i + 1), i));
411 v.Add(new Voltage("CPU VCore", 0));
412 v.Add(new Voltage("Voltage #2", 1, true));
413 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
414 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
415 v.Add(new Voltage("Voltage #5", 4, true));
416 v.Add(new Voltage("Voltage #6", 5, true));
417 v.Add(new Voltage("Voltage #7", 6, true));
418 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
419 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
420 v.Add(new Voltage("Voltage #10", 9, true));
421 t.Add(new Temperature("CPU", 0));
422 t.Add(new Temperature("Auxiliary", 1));
423 t.Add(new Temperature("System", 2));
424 f.Add(new Fan("System Fan", 0));
425 f.Add(new Fan("CPU Fan", 1));
426 f.Add(new Fan("Auxiliary Fan", 2));
427 f.Add(new Fan("CPU Fan #2", 3));
428 f.Add(new Fan("Auxiliary Fan #2", 4));
431 case Chip.W83627DHGP:
434 switch (manufacturer) {
435 case Manufacturer.ASRock:
437 case Model._880GMH_USB3: // W83627DHG-P
438 v.Add(new Voltage("CPU VCore", 0));
439 v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
440 v.Add(new Voltage("+5V", 5, 15, 7.5f, 0));
441 v.Add(new Voltage("+12V", 6, 56, 10, 0));
442 v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
443 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
444 t.Add(new Temperature("CPU", 0));
445 t.Add(new Temperature("Motherboard", 2));
446 f.Add(new Fan("Chassis Fan", 0));
447 f.Add(new Fan("CPU Fan", 1));
448 f.Add(new Fan("Power Fan", 2));
451 v.Add(new Voltage("CPU VCore", 0));
452 v.Add(new Voltage("Voltage #2", 1, true));
453 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
454 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
455 v.Add(new Voltage("Voltage #5", 4, true));
456 v.Add(new Voltage("Voltage #6", 5, true));
457 v.Add(new Voltage("Voltage #7", 6, true));
458 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
459 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
460 t.Add(new Temperature("CPU", 0));
461 t.Add(new Temperature("Auxiliary", 1));
462 t.Add(new Temperature("System", 2));
463 f.Add(new Fan("System Fan", 0));
464 f.Add(new Fan("CPU Fan", 1));
465 f.Add(new Fan("Auxiliary Fan", 2));
466 f.Add(new Fan("CPU Fan #2", 3));
467 f.Add(new Fan("Auxiliary Fan #2", 4));
471 case Manufacturer.ASUS:
473 case Model.P6X58D_E: // W83667HG
474 case Model.Rampage_II_GENE: // W83667HG
475 v.Add(new Voltage("CPU VCore", 0));
476 v.Add(new Voltage("+12V", 1, 11.5f, 1.91f, 0));
477 v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
478 v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
479 v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
480 v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
481 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
482 t.Add(new Temperature("CPU", 0));
483 t.Add(new Temperature("Motherboard", 2));
484 f.Add(new Fan("Chassis Fan #1", 0));
485 f.Add(new Fan("CPU Fan", 1));
486 f.Add(new Fan("Power Fan", 2));
487 f.Add(new Fan("Chassis Fan #2", 3));
488 f.Add(new Fan("Chassis Fan #3", 4));
490 case Model.Rampage_Extreme: // W83667HG
491 v.Add(new Voltage("CPU VCore", 0));
492 v.Add(new Voltage("+12V", 1, 12, 2, 0));
493 v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
494 v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
495 v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
496 v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
497 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
498 t.Add(new Temperature("CPU", 0));
499 t.Add(new Temperature("Motherboard", 2));
500 f.Add(new Fan("Chassis Fan #1", 0));
501 f.Add(new Fan("CPU Fan", 1));
502 f.Add(new Fan("Power Fan", 2));
503 f.Add(new Fan("Chassis Fan #2", 3));
504 f.Add(new Fan("Chassis Fan #3", 4));
507 v.Add(new Voltage("CPU VCore", 0));
508 v.Add(new Voltage("Voltage #2", 1, true));
509 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
510 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
511 v.Add(new Voltage("Voltage #5", 4, true));
512 v.Add(new Voltage("Voltage #6", 5, true));
513 v.Add(new Voltage("Voltage #7", 6, true));
514 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
515 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
516 t.Add(new Temperature("CPU", 0));
517 t.Add(new Temperature("Auxiliary", 1));
518 t.Add(new Temperature("System", 2));
519 f.Add(new Fan("System Fan", 0));
520 f.Add(new Fan("CPU Fan", 1));
521 f.Add(new Fan("Auxiliary Fan", 2));
522 f.Add(new Fan("CPU Fan #2", 3));
523 f.Add(new Fan("Auxiliary Fan #2", 4));
528 v.Add(new Voltage("CPU VCore", 0));
529 v.Add(new Voltage("Voltage #2", 1, true));
530 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
531 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
532 v.Add(new Voltage("Voltage #5", 4, true));
533 v.Add(new Voltage("Voltage #6", 5, true));
534 v.Add(new Voltage("Voltage #7", 6, true));
535 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
536 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
537 t.Add(new Temperature("CPU", 0));
538 t.Add(new Temperature("Auxiliary", 1));
539 t.Add(new Temperature("System", 2));
540 f.Add(new Fan("System Fan", 0));
541 f.Add(new Fan("CPU Fan", 1));
542 f.Add(new Fan("Auxiliary Fan", 2));
543 f.Add(new Fan("CPU Fan #2", 3));
544 f.Add(new Fan("Auxiliary Fan #2", 4));
551 v.Add(new Voltage("CPU VCore", 0));
552 v.Add(new Voltage("Voltage #2", 1, true));
553 v.Add(new Voltage("Voltage #3", 2, true));
554 v.Add(new Voltage("AVCC", 3, 34, 51, 0));
555 v.Add(new Voltage("Voltage #5", 4, true));
556 v.Add(new Voltage("5VSB", 5, 34, 51, 0));
557 v.Add(new Voltage("VBAT", 6));
558 t.Add(new Temperature("CPU", 0));
559 t.Add(new Temperature("Auxiliary", 1));
560 t.Add(new Temperature("System", 2));
561 f.Add(new Fan("System Fan", 0));
562 f.Add(new Fan("CPU Fan", 1));
563 f.Add(new Fan("Auxiliary Fan", 2));
566 for (int i = 0; i < superIO.Voltages.Length; i++)
567 v.Add(new Voltage("Voltage #" + (i + 1), i, true));
568 for (int i = 0; i < superIO.Temperatures.Length; i++)
569 t.Add(new Temperature("Temperature #" + (i + 1), i));
570 for (int i = 0; i < superIO.Fans.Length; i++)
571 f.Add(new Fan("Fan #" + (i + 1), i));
575 string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
576 foreach (Voltage voltage in v)
577 if (voltage.Index < superIO.Voltages.Length) {
578 Sensor sensor = new Sensor(voltage.Name, voltage.Index,
579 voltage.Hidden, SensorType.Voltage, this,
580 new ParameterDescription[] {
581 new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
582 formula, voltage.Ri),
583 new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
584 formula, voltage.Rf),
585 new ParameterDescription("Vf [V]", "Reference voltage.\n" +
588 voltages.Add(sensor);
591 foreach (Temperature temperature in t)
592 if (temperature.Index < superIO.Temperatures.Length) {
593 Sensor sensor = new Sensor(temperature.Name, temperature.Index,
594 SensorType.Temperature, this, new ParameterDescription[] {
595 new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
597 temperatures.Add(sensor);
600 foreach (Fan fan in f)
601 if (fan.Index < superIO.Fans.Length) {
602 Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
608 public override Identifier Identifier {
610 return new Identifier("lpc",
611 superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture));
615 public override HardwareType HardwareType {
616 get { return HardwareType.SuperIO; }
619 public override IHardware Parent {
620 get { return mainboard; }
623 public override string Name {
627 public override string GetReport() {
628 return superIO.GetReport();
631 public override void Update() {
634 foreach (Sensor sensor in voltages) {
635 float? value = superIO.Voltages[sensor.Index];
636 if (value.HasValue) {
637 sensor.Value = value + (value - sensor.Parameters[2].Value) *
638 sensor.Parameters[0].Value / sensor.Parameters[1].Value;
639 ActivateSensor(sensor);
643 foreach (Sensor sensor in temperatures) {
644 float? value = superIO.Temperatures[sensor.Index];
645 if (value.HasValue) {
646 sensor.Value = value + sensor.Parameters[0].Value;
647 ActivateSensor(sensor);
651 foreach (Sensor sensor in fans) {
652 float? value = superIO.Fans[sensor.Index];
653 if (value.HasValue) {
654 sensor.Value = value;
656 ActivateSensor(sensor);
661 private class Voltage {
662 public readonly string Name;
663 public readonly int Index;
664 public readonly float Ri;
665 public readonly float Rf;
666 public readonly float Vf;
667 public readonly bool Hidden;
669 public Voltage(string name, int index) :
670 this(name, index, 0, 1, 0, false) { }
672 public Voltage(string name, int index, bool hidden) :
673 this(name, index, 0, 1, 0, hidden) { }
675 public Voltage(string name, int index, float ri, float rf, float vf) :
676 this(name, index, ri, rf, vf, false) { }
678 public Voltage(string name, int index, float ri, float rf, float vf,
685 this.Hidden = hidden;
689 private class Temperature {
690 public readonly string Name;
691 public readonly int Index;
693 public Temperature(string name, int index) {
700 public readonly string Name;
701 public readonly int Index;
703 public Fan(string name, int index) {