Fixed some Code Analysis warnings.
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 ISuperIO superIO;
49 private List<Sensor> voltages = new List<Sensor>();
50 private List<Sensor> temperatures = new List<Sensor>();
51 private List<Sensor> fans = new List<Sensor>();
54 public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer,
55 Model model, ISettings settings)
57 this.superIO = superIO;
58 this.name = ChipName.GetName(superIO.Chip);
60 List<Voltage> v = new List<Voltage>();
61 List<Temperature> t = new List<Temperature>();
62 List<Fan> f = new List<Fan>();
64 switch (superIO.Chip) {
70 switch (manufacturer) {
71 case Manufacturer.ASUS:
73 case Model.Crosshair_III_Formula:
74 v.Add(new Voltage("VBat", 8));
75 t.Add(new Temperature("CPU", 0));
76 for (int i = 0; i < superIO.Fans.Length; i++)
77 f.Add(new Fan("Fan #" + (i + 1), i));
79 case Model.M2N_SLI_DELUXE:
80 v.Add(new Voltage("CPU VCore", 0));
81 v.Add(new Voltage("+3.3V", 1));
82 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
83 v.Add(new Voltage("+12V", 4, 30, 10, 0));
84 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
85 v.Add(new Voltage("VBat", 8));
86 t.Add(new Temperature("CPU", 0));
87 t.Add(new Temperature("Motherboard", 1));
88 f.Add(new Fan("CPU Fan", 0));
89 f.Add(new Fan("Chassis Fan #1", 1));
90 f.Add(new Fan("Power Fan", 2));
92 case Model.M4A79XTD_EVO:
93 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
94 v.Add(new Voltage("VBat", 8));
95 t.Add(new Temperature("CPU", 0));
96 t.Add(new Temperature("Motherboard", 1));
97 f.Add(new Fan("CPU Fan", 0));
98 f.Add(new Fan("Chassis Fan #1", 1));
99 f.Add(new Fan("Chassis Fan #2", 2));
102 v.Add(new Voltage("CPU VCore", 0));
103 v.Add(new Voltage("Voltage #2", 1, true));
104 v.Add(new Voltage("Voltage #3", 2, true));
105 v.Add(new Voltage("Voltage #4", 3, true));
106 v.Add(new Voltage("Voltage #5", 4, true));
107 v.Add(new Voltage("Voltage #6", 5, true));
108 v.Add(new Voltage("Voltage #7", 6, true));
109 v.Add(new Voltage("Voltage #8", 7, true));
110 v.Add(new Voltage("VBat", 8));
111 for (int i = 0; i < superIO.Temperatures.Length; i++)
112 t.Add(new Temperature("Temperature #" + (i + 1), i));
113 for (int i = 0; i < superIO.Fans.Length; i++)
114 f.Add(new Fan("Fan #" + (i + 1), i));
118 case Manufacturer.DFI:
120 case Model.LP_BI_P45_T2RS_Elite:
121 v.Add(new Voltage("CPU VCore", 0));
122 v.Add(new Voltage("FSB VTT", 1));
123 v.Add(new Voltage("+3.3V", 2));
124 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
125 v.Add(new Voltage("+12V", 4, 30, 10, 0));
126 v.Add(new Voltage("NB Core", 5));
127 v.Add(new Voltage("VDIMM", 6));
128 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
129 v.Add(new Voltage("VBat", 8));
130 t.Add(new Temperature("CPU", 0));
131 t.Add(new Temperature("System", 1));
132 t.Add(new Temperature("Chipset", 2));
133 f.Add(new Fan("Fan #1", 0));
134 f.Add(new Fan("Fan #2", 1));
135 f.Add(new Fan("Fan #3", 2));
137 case Model.LP_DK_P55_T3eH9:
138 v.Add(new Voltage("CPU VCore", 0));
139 v.Add(new Voltage("VTT", 1));
140 v.Add(new Voltage("+3.3V", 2));
141 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
142 v.Add(new Voltage("+12V", 4, 30, 10, 0));
143 v.Add(new Voltage("CPU PLL", 5));
144 v.Add(new Voltage("DRAM", 6));
145 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
146 v.Add(new Voltage("VBat", 8));
147 t.Add(new Temperature("Chipset", 0));
148 t.Add(new Temperature("CPU PWM", 1));
149 t.Add(new Temperature("CPU", 2));
150 f.Add(new Fan("Fan #1", 0));
151 f.Add(new Fan("Fan #2", 1));
152 f.Add(new Fan("Fan #3", 2));
155 v.Add(new Voltage("CPU VCore", 0));
156 v.Add(new Voltage("VTT", 1, true));
157 v.Add(new Voltage("+3.3V", 2, true));
158 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
159 v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
160 v.Add(new Voltage("Voltage #6", 5, true));
161 v.Add(new Voltage("DRAM", 6, true));
162 v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
163 v.Add(new Voltage("VBat", 8));
164 for (int i = 0; i < superIO.Temperatures.Length; i++)
165 t.Add(new Temperature("Temperature #" + (i + 1), i));
166 for (int i = 0; i < superIO.Fans.Length; i++)
167 f.Add(new Fan("Fan #" + (i + 1), i));
172 case Manufacturer.Gigabyte:
175 v.Add(new Voltage("CPU VCore", 0));
176 v.Add(new Voltage("DRAM", 1));
177 v.Add(new Voltage("+3.3V", 2));
178 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
179 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
180 v.Add(new Voltage("VBat", 8));
181 t.Add(new Temperature("System", 0));
182 t.Add(new Temperature("CPU", 1));
183 f.Add(new Fan("CPU Fan", 0));
184 f.Add(new Fan("System Fan", 1));
186 case Model.EP45_DS3R:
187 case Model.EP45_UD3R:
189 v.Add(new Voltage("CPU VCore", 0));
190 v.Add(new Voltage("DRAM", 1));
191 v.Add(new Voltage("+3.3V", 2));
192 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
193 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
194 v.Add(new Voltage("VBat", 8));
195 t.Add(new Temperature("System", 0));
196 t.Add(new Temperature("CPU", 1));
197 f.Add(new Fan("CPU Fan", 0));
198 f.Add(new Fan("System Fan #2", 1));
199 f.Add(new Fan("Power Fan", 2));
200 f.Add(new Fan("System Fan #1", 3));
202 case Model.EX58_EXTREME:
203 v.Add(new Voltage("CPU VCore", 0));
204 v.Add(new Voltage("DRAM", 1));
205 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
206 v.Add(new Voltage("VBat", 8));
207 t.Add(new Temperature("System", 0));
208 t.Add(new Temperature("CPU", 1));
209 t.Add(new Temperature("Northbridge", 2));
210 f.Add(new Fan("CPU Fan", 0));
211 f.Add(new Fan("System Fan #2", 1));
212 f.Add(new Fan("Power Fan", 2));
213 f.Add(new Fan("System Fan #1", 3));
217 v.Add(new Voltage("CPU VCore", 0));
218 v.Add(new Voltage("DRAM", 1));
219 v.Add(new Voltage("+3.3V", 2));
220 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
221 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
222 v.Add(new Voltage("VBat", 8));
223 t.Add(new Temperature("System", 0));
224 t.Add(new Temperature("CPU", 1));
225 f.Add(new Fan("CPU Fan", 0));
226 f.Add(new Fan("System Fan #1", 1));
227 f.Add(new Fan("System Fan #2", 2));
228 f.Add(new Fan("Power Fan", 3));
231 v.Add(new Voltage("CPU VCore", 0));
232 v.Add(new Voltage("DRAM", 1));
233 v.Add(new Voltage("+3.3V", 2));
234 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
235 v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
236 v.Add(new Voltage("VBat", 8));
237 t.Add(new Temperature("System", 0));
238 t.Add(new Temperature("CPU", 2));
239 f.Add(new Fan("CPU Fan", 0));
240 f.Add(new Fan("System Fan #2", 1));
241 f.Add(new Fan("Power Fan", 2));
242 f.Add(new Fan("System Fan #1", 3));
244 case Model.GA_MA770T_UD3:
245 v.Add(new Voltage("CPU VCore", 0));
246 v.Add(new Voltage("DRAM", 1));
247 v.Add(new Voltage("+3.3V", 2));
248 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
249 v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
250 v.Add(new Voltage("VBat", 8));
251 t.Add(new Temperature("System", 0));
252 t.Add(new Temperature("CPU", 1));
253 f.Add(new Fan("CPU Fan", 0));
254 f.Add(new Fan("System Fan #1", 1));
255 f.Add(new Fan("System Fan #2", 2));
256 f.Add(new Fan("Power Fan", 3));
258 case Model.GA_MA785GMT_UD2H:
259 v.Add(new Voltage("CPU VCore", 0));
260 v.Add(new Voltage("DRAM", 1));
261 v.Add(new Voltage("+3.3V", 2));
262 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
263 v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
264 v.Add(new Voltage("VBat", 8));
265 t.Add(new Temperature("System", 0));
266 t.Add(new Temperature("CPU", 1));
267 f.Add(new Fan("CPU Fan", 0));
268 f.Add(new Fan("System Fan", 1));
269 f.Add(new Fan("NB Fan", 2));
271 case Model.X58A_UD3R:
272 v.Add(new Voltage("CPU VCore", 0));
273 v.Add(new Voltage("DRAM", 1));
274 v.Add(new Voltage("+3.3V", 2));
275 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
276 v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
277 v.Add(new Voltage("VBat", 8));
278 t.Add(new Temperature("System", 0));
279 t.Add(new Temperature("CPU", 1));
280 t.Add(new Temperature("Northbridge", 2));
281 f.Add(new Fan("CPU Fan", 0));
282 f.Add(new Fan("System Fan #2", 1));
283 f.Add(new Fan("Power Fan", 2));
284 f.Add(new Fan("System Fan #1", 3));
287 v.Add(new Voltage("CPU VCore", 0));
288 v.Add(new Voltage("DRAM", 1, true));
289 v.Add(new Voltage("+3.3V", 2, true));
290 v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
291 v.Add(new Voltage("Voltage #5", 4, true));
292 v.Add(new Voltage("Voltage #6", 5, true));
293 v.Add(new Voltage("Voltage #7", 6, true));
294 v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
295 v.Add(new Voltage("VBat", 8));
296 for (int i = 0; i < superIO.Temperatures.Length; i++)
297 t.Add(new Temperature("Temperature #" + (i + 1), i));
298 for (int i = 0; i < superIO.Fans.Length; i++)
299 f.Add(new Fan("Fan #" + (i + 1), i));
305 v.Add(new Voltage("CPU VCore", 0));
306 v.Add(new Voltage("Voltage #2", 1, true));
307 v.Add(new Voltage("Voltage #3", 2, true));
308 v.Add(new Voltage("Voltage #4", 3, true));
309 v.Add(new Voltage("Voltage #5", 4, true));
310 v.Add(new Voltage("Voltage #6", 5, true));
311 v.Add(new Voltage("Voltage #7", 6, true));
312 v.Add(new Voltage("Voltage #8", 7, true));
313 v.Add(new Voltage("VBat", 8));
314 for (int i = 0; i < superIO.Temperatures.Length; i++)
315 t.Add(new Temperature("Temperature #" + (i + 1), i));
316 for (int i = 0; i < superIO.Fans.Length; i++)
317 f.Add(new Fan("Fan #" + (i + 1), i));
323 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
324 v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
325 v.Add(new Voltage("Battery", 2, 150, 150, 0));
326 for (int i = 0; i < superIO.Temperatures.Length; i++)
327 t.Add(new Temperature("Temperature #" + (i + 1), i));
328 for (int i = 0; i < superIO.Fans.Length; i++)
329 f.Add(new Fan("Fan #" + (i + 1), i));
336 switch (manufacturer) {
337 case Manufacturer.EVGA:
339 case Model.X58_SLI_Classified:
340 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
341 v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
342 v.Add(new Voltage("DIMM", 2, 47, 100, 0));
343 v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
344 v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
345 v.Add(new Voltage("+5V", 5, 51, 12, 0));
346 v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
347 v.Add(new Voltage("3VSB", 7, 150, 150, 0));
348 v.Add(new Voltage("VBat", 8, 150, 150, 0));
349 t.Add(new Temperature("CPU", 0));
350 t.Add(new Temperature("VREG", 1));
351 t.Add(new Temperature("System", 2));
352 f.Add(new Fan("CPU Fan", 0));
353 f.Add(new Fan("Power Fan", 1));
354 f.Add(new Fan("Chassis Fan", 2));
357 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
358 v.Add(new Voltage("CPU VCore", 1));
359 v.Add(new Voltage("Voltage #3", 2, true));
360 v.Add(new Voltage("Voltage #4", 3, true));
361 v.Add(new Voltage("Voltage #5", 4, true));
362 v.Add(new Voltage("Voltage #6", 5, true));
363 v.Add(new Voltage("Voltage #7", 6, true));
364 v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
365 v.Add(new Voltage("VBat", 8, 150, 150, 0));
366 for (int i = 0; i < superIO.Temperatures.Length; i++)
367 t.Add(new Temperature("Temperature #" + (i + 1), i));
368 for (int i = 0; i < superIO.Fans.Length; i++)
369 f.Add(new Fan("Fan #" + (i + 1), i));
374 v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
375 v.Add(new Voltage("CPU VCore", 1));
376 v.Add(new Voltage("Voltage #3", 2, true));
377 v.Add(new Voltage("Voltage #4", 3, true));
378 v.Add(new Voltage("Voltage #5", 4, true));
379 v.Add(new Voltage("Voltage #6", 5, true));
380 v.Add(new Voltage("Voltage #7", 6, true));
381 v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
382 v.Add(new Voltage("VBat", 8, 150, 150, 0));
383 for (int i = 0; i < superIO.Temperatures.Length; i++)
384 t.Add(new Temperature("Temperature #" + (i + 1), i));
385 for (int i = 0; i < superIO.Fans.Length; i++)
386 f.Add(new Fan("Fan #" + (i + 1), i));
392 v.Add(new Voltage("CPU VCore", 0));
393 v.Add(new Voltage("Voltage #2", 1, true));
394 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
395 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
396 v.Add(new Voltage("Voltage #5", 4, true));
397 v.Add(new Voltage("Voltage #6", 5, true));
398 v.Add(new Voltage("Voltage #7", 6, true));
399 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
400 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
401 v.Add(new Voltage("Voltage #10", 9, true));
402 t.Add(new Temperature("CPU", 0));
403 t.Add(new Temperature("Auxiliary", 1));
404 t.Add(new Temperature("System", 2));
405 f.Add(new Fan("System Fan", 0));
406 f.Add(new Fan("CPU Fan", 1));
407 f.Add(new Fan("Auxiliary Fan", 2));
408 f.Add(new Fan("CPU Fan #2", 3));
409 f.Add(new Fan("Auxiliary Fan #2", 4));
412 case Chip.W83627DHGP:
415 switch (manufacturer) {
416 case Manufacturer.ASRock:
418 case Model._880GMH_USB3:
419 v.Add(new Voltage("CPU VCore", 0));
420 v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
421 v.Add(new Voltage("+5V", 5, 15, 7.5f, 0));
422 v.Add(new Voltage("+12V", 6, 56, 10, 0));
423 v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
424 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
425 t.Add(new Temperature("CPU", 0));
426 t.Add(new Temperature("Motherboard", 2));
427 f.Add(new Fan("Chassis Fan", 0));
428 f.Add(new Fan("CPU Fan", 1));
429 f.Add(new Fan("Power Fan", 2));
432 v.Add(new Voltage("CPU VCore", 0));
433 v.Add(new Voltage("Voltage #2", 1, true));
434 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
435 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
436 v.Add(new Voltage("Voltage #5", 4, true));
437 v.Add(new Voltage("Voltage #6", 5, true));
438 v.Add(new Voltage("Voltage #7", 6, true));
439 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
440 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
441 t.Add(new Temperature("CPU", 0));
442 t.Add(new Temperature("Auxiliary", 1));
443 t.Add(new Temperature("System", 2));
444 f.Add(new Fan("System Fan", 0));
445 f.Add(new Fan("CPU Fan", 1));
446 f.Add(new Fan("Auxiliary Fan", 2));
447 f.Add(new Fan("CPU Fan #2", 3));
448 f.Add(new Fan("Auxiliary Fan #2", 4));
452 case Manufacturer.ASUS:
455 v.Add(new Voltage("CPU VCore", 0));
456 v.Add(new Voltage("+12V", 1, 11.5f, 1.91f, 0));
457 v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
458 v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
459 v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
460 v.Add(new Voltage("Voltage #6", 5, true));
461 v.Add(new Voltage("Voltage #7", 6, true));
462 v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
463 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
464 t.Add(new Temperature("CPU", 0));
465 t.Add(new Temperature("Motherboard", 2));
466 f.Add(new Fan("Chassis Fan #1", 0));
467 f.Add(new Fan("CPU Fan", 1));
468 f.Add(new Fan("Power Fan", 2));
469 f.Add(new Fan("Chassis Fan #2", 3));
470 f.Add(new Fan("Chassis Fan #3", 4));
473 v.Add(new Voltage("CPU VCore", 0));
474 v.Add(new Voltage("Voltage #2", 1, true));
475 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
476 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
477 v.Add(new Voltage("Voltage #5", 4, true));
478 v.Add(new Voltage("Voltage #6", 5, true));
479 v.Add(new Voltage("Voltage #7", 6, true));
480 v.Add(new Voltage("3VSB", 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("Auxiliary", 1));
484 t.Add(new Temperature("System", 2));
485 f.Add(new Fan("System Fan", 0));
486 f.Add(new Fan("CPU Fan", 1));
487 f.Add(new Fan("Auxiliary Fan", 2));
488 f.Add(new Fan("CPU Fan #2", 3));
489 f.Add(new Fan("Auxiliary Fan #2", 4));
494 v.Add(new Voltage("CPU VCore", 0));
495 v.Add(new Voltage("Voltage #2", 1, true));
496 v.Add(new Voltage("AVCC", 2, 34, 34, 0));
497 v.Add(new Voltage("3VCC", 3, 34, 34, 0));
498 v.Add(new Voltage("Voltage #5", 4, true));
499 v.Add(new Voltage("Voltage #6", 5, true));
500 v.Add(new Voltage("Voltage #7", 6, true));
501 v.Add(new Voltage("3VSB", 7, 34, 34, 0));
502 v.Add(new Voltage("VBAT", 8, 34, 34, 0));
503 t.Add(new Temperature("CPU", 0));
504 t.Add(new Temperature("Auxiliary", 1));
505 t.Add(new Temperature("System", 2));
506 f.Add(new Fan("System Fan", 0));
507 f.Add(new Fan("CPU Fan", 1));
508 f.Add(new Fan("Auxiliary Fan", 2));
509 f.Add(new Fan("CPU Fan #2", 3));
510 f.Add(new Fan("Auxiliary Fan #2", 4));
517 v.Add(new Voltage("CPU VCore", 0));
518 v.Add(new Voltage("Voltage #2", 1, true));
519 v.Add(new Voltage("Voltage #3", 2, true));
520 v.Add(new Voltage("AVCC", 3, 34, 51, 0));
521 v.Add(new Voltage("Voltage #5", 4, true));
522 v.Add(new Voltage("5VSB", 5, 34, 51, 0));
523 v.Add(new Voltage("VBAT", 6));
524 t.Add(new Temperature("CPU", 0));
525 t.Add(new Temperature("Auxiliary", 1));
526 t.Add(new Temperature("System", 2));
527 f.Add(new Fan("System Fan", 0));
528 f.Add(new Fan("CPU Fan", 1));
529 f.Add(new Fan("Auxiliary Fan", 2));
532 for (int i = 0; i < superIO.Voltages.Length; i++)
533 v.Add(new Voltage("Voltage #" + (i + 1), i, true));
534 for (int i = 0; i < superIO.Temperatures.Length; i++)
535 t.Add(new Temperature("Temperature #" + (i + 1), i));
536 for (int i = 0; i < superIO.Fans.Length; i++)
537 f.Add(new Fan("Fan #" + (i + 1), i));
541 string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
542 foreach (Voltage voltage in v)
543 if (voltage.Index < superIO.Voltages.Length) {
544 Sensor sensor = new Sensor(voltage.Name, voltage.Index,
545 voltage.Hidden, SensorType.Voltage, this,
546 new ParameterDescription[] {
547 new ParameterDescription("Ri [kΩ]", "Input resistance.\n" +
548 formula, voltage.Ri),
549 new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" +
550 formula, voltage.Rf),
551 new ParameterDescription("Vf [V]", "Reference voltage.\n" +
554 voltages.Add(sensor);
557 foreach (Temperature temperature in t)
558 if (temperature.Index < superIO.Temperatures.Length) {
559 Sensor sensor = new Sensor(temperature.Name, temperature.Index,
560 SensorType.Temperature, this, new ParameterDescription[] {
561 new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
563 temperatures.Add(sensor);
566 foreach (Fan fan in f)
567 if (fan.Index < superIO.Fans.Length) {
568 Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
574 public override Identifier Identifier {
576 return new Identifier("lpc",
577 superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture));
581 public override HardwareType HardwareType {
582 get { return HardwareType.SuperIO; }
585 public override string Name {
589 public override string GetReport() {
590 return superIO.GetReport();
593 public override void Update() {
596 foreach (Sensor sensor in voltages) {
597 float? value = superIO.Voltages[sensor.Index];
598 if (value.HasValue) {
599 sensor.Value = value + (value - sensor.Parameters[2].Value) *
600 sensor.Parameters[0].Value / sensor.Parameters[1].Value;
601 ActivateSensor(sensor);
605 foreach (Sensor sensor in temperatures) {
606 float? value = superIO.Temperatures[sensor.Index];
607 if (value.HasValue) {
608 sensor.Value = value + sensor.Parameters[0].Value;
609 ActivateSensor(sensor);
613 foreach (Sensor sensor in fans) {
614 float? value = superIO.Fans[sensor.Index];
615 if (value.HasValue) {
616 sensor.Value = value;
618 ActivateSensor(sensor);
623 private class Voltage {
624 public readonly string Name;
625 public readonly int Index;
626 public readonly float Ri;
627 public readonly float Rf;
628 public readonly float Vf;
629 public readonly bool Hidden;
631 public Voltage(string name, int index) :
632 this(name, index, 0, 1, 0, false) { }
634 public Voltage(string name, int index, bool hidden) :
635 this(name, index, 0, 1, 0, hidden) { }
637 public Voltage(string name, int index, float ri, float rf, float vf) :
638 this(name, index, ri, rf, vf, false) { }
640 public Voltage(string name, int index, float ri, float rf, float vf,
647 this.Hidden = hidden;
651 private class Temperature {
652 public readonly string Name;
653 public readonly int Index;
655 public Temperature(string name, int index) {
662 public readonly string Name;
663 public readonly int Index;
665 public Fan(string name, int index) {