Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Sun, 06 Jun 2010 11:07:57 +0000
changeset 134 8b3b9b2e28e5
parent 133 9ad699538c89
child 135 51a15cf90d22
permissions -rw-r--r--
Fixed Issue 69.
     1 /*
     2   
     3   Version: MPL 1.1/GPL 2.0/LGPL 2.1
     4 
     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
     8  
     9   http://www.mozilla.org/MPL/
    10 
    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.
    14 
    15   The Original Code is the Open Hardware Monitor code.
    16 
    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.
    21 
    22   Contributor(s):
    23 
    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.
    35  
    36 */
    37 
    38 using System;
    39 using System.Collections.Generic;
    40 using System.Drawing;
    41 using OpenHardwareMonitor.Hardware.LPC;
    42 
    43 namespace OpenHardwareMonitor.Hardware.Mainboard {
    44   public class SuperIOHardware : Hardware {
    45 
    46     private ISuperIO superIO;
    47     private Image icon;
    48     protected readonly string name;
    49 
    50     private List<Sensor> voltages = new List<Sensor>();
    51     private List<Sensor> temperatures = new List<Sensor>();
    52     private List<Sensor> fans = new List<Sensor>();  
    53 
    54     public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer, 
    55       Model model) 
    56     {
    57       this.superIO = superIO;
    58       this.icon = Utilities.EmbeddedResources.GetImage("chip.png");
    59 
    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;
    80       }
    81 
    82       List<Voltage> v = new List<Voltage>();
    83       List<Temperature> t = new List<Temperature>();
    84       List<Fan> f = new List<Fan>();
    85 
    86       switch (superIO.Chip) {
    87         case Chip.IT8712F:
    88         case Chip.IT8716F:
    89         case Chip.IT8718F:
    90         case Chip.IT8720F:
    91         case Chip.IT8726F:
    92           switch (manufacturer) {
    93             case Manufacturer.ASUS:
    94               switch (model) {
    95                 case Model.Crosshair_III_Formula:
    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));
   100                   break;
   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, 0));
   105                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   106                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   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));
   113                   break;
   114                 default:
   115                   v.Add(new Voltage("CPU VCore", 0));
   116                   v.Add(new Voltage("Voltage #2", 1, true));
   117                   v.Add(new Voltage("Voltage #3", 2, true));
   118                   v.Add(new Voltage("Voltage #4", 3, true));
   119                   v.Add(new Voltage("Voltage #5", 4, true));
   120                   v.Add(new Voltage("Voltage #6", 5, true));
   121                   v.Add(new Voltage("Voltage #7", 6, true));
   122                   v.Add(new Voltage("Voltage #8", 7, true));
   123                   v.Add(new Voltage("VBat", 8));
   124                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   125                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   126                   for (int i = 0; i < superIO.Fans.Length; i++)
   127                     f.Add(new Fan("Fan #" + (i + 1), i));
   128                   break;
   129               }
   130               break;
   131             case Manufacturer.DFI:
   132               switch (model) {
   133                 case Model.LP_BI_P45_T2RS_Elite:
   134                   v.Add(new Voltage("CPU VCore", 0));
   135                   v.Add(new Voltage("FSB VTT", 1));
   136                   v.Add(new Voltage("+3.3V", 2));
   137                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   138                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   139                   v.Add(new Voltage("NB Core", 5));
   140                   v.Add(new Voltage("VDIMM", 6));
   141                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   142                   v.Add(new Voltage("VBat", 8));
   143                   t.Add(new Temperature("CPU", 0));
   144                   t.Add(new Temperature("System", 1));
   145                   t.Add(new Temperature("Chipset", 2));
   146                   f.Add(new Fan("Fan #1", 0));
   147                   f.Add(new Fan("Fan #2", 1));
   148                   f.Add(new Fan("Fan #3", 2));
   149                   break;
   150                 case Model.LP_DK_P55_T3eH9:
   151                   v.Add(new Voltage("CPU VCore", 0));
   152                   v.Add(new Voltage("VTT", 1));
   153                   v.Add(new Voltage("+3.3V", 2));
   154                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   155                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   156                   v.Add(new Voltage("CPU PLL", 5));
   157                   v.Add(new Voltage("DRAM", 6));
   158                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   159                   v.Add(new Voltage("VBat", 8));
   160                   t.Add(new Temperature("Chipset", 0));
   161                   t.Add(new Temperature("CPU PWM", 1));
   162                   t.Add(new Temperature("CPU", 2));
   163                   f.Add(new Fan("Fan #1", 0));
   164                   f.Add(new Fan("Fan #2", 1));
   165                   f.Add(new Fan("Fan #3", 2));
   166                   break;
   167                 default:
   168                   v.Add(new Voltage("CPU VCore", 0));
   169                   v.Add(new Voltage("VTT", 1, true));
   170                   v.Add(new Voltage("+3.3V", 2, true));
   171                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   172                   v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
   173                   v.Add(new Voltage("Voltage #6", 5, true));
   174                   v.Add(new Voltage("DRAM", 6, true));
   175                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
   176                   v.Add(new Voltage("VBat", 8));
   177                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   178                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   179                   for (int i = 0; i < superIO.Fans.Length; i++)
   180                     f.Add(new Fan("Fan #" + (i + 1), i));
   181                   break;
   182               }
   183               break;
   184 
   185             case Manufacturer.Gigabyte:
   186               switch (model) {
   187                 case Model._965P_S3:
   188                   v.Add(new Voltage("CPU VCore", 0));
   189                   v.Add(new Voltage("DRAM", 1));
   190                   v.Add(new Voltage("+3.3V", 2));
   191                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   192                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   193                   v.Add(new Voltage("VBat", 8));
   194                   t.Add(new Temperature("System", 0));
   195                   t.Add(new Temperature("CPU", 1));
   196                   f.Add(new Fan("CPU Fan", 0));
   197                   f.Add(new Fan("System Fan", 1));
   198                   break;
   199                 case Model.EP45_DS3R:
   200                 case Model.EP45_UD3R: 
   201                 case Model.X38_DS5:                
   202                   v.Add(new Voltage("CPU VCore", 0));
   203                   v.Add(new Voltage("DRAM", 1));
   204                   v.Add(new Voltage("+3.3V", 2));
   205                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   206                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   207                   v.Add(new Voltage("VBat", 8));
   208                   t.Add(new Temperature("System", 0));
   209                   t.Add(new Temperature("CPU", 1));
   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));
   214                   break;
   215                 case Model.EX58_EXTREME:
   216                   v.Add(new Voltage("CPU VCore", 0));
   217                   v.Add(new Voltage("DRAM", 1));
   218                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   219                   v.Add(new Voltage("VBat", 8));
   220                   t.Add(new Temperature("System", 0));
   221                   t.Add(new Temperature("CPU", 1));
   222                   t.Add(new Temperature("MCH", 2));
   223                   f.Add(new Fan("CPU Fan", 0));
   224                   f.Add(new Fan("System Fan #2", 1));
   225                   f.Add(new Fan("Power Fan", 2));
   226                   f.Add(new Fan("System Fan #1", 3));
   227                   break;
   228                 case Model.P35_DS3:
   229                 case Model.P35_DS3L:
   230                   v.Add(new Voltage("CPU VCore", 0));
   231                   v.Add(new Voltage("DRAM", 1));
   232                   v.Add(new Voltage("+3.3V", 2));
   233                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   234                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   235                   v.Add(new Voltage("VBat", 8));
   236                   t.Add(new Temperature("System", 0));
   237                   t.Add(new Temperature("CPU", 1));
   238                   f.Add(new Fan("CPU Fan", 0));
   239                   f.Add(new Fan("System Fan #1", 1));
   240                   f.Add(new Fan("System Fan #2", 2));
   241                   f.Add(new Fan("Power Fan", 3));
   242                   break;
   243                 case Model.GA_MA785GMT_UD2H:
   244                   v.Add(new Voltage("CPU VCore", 0));
   245                   v.Add(new Voltage("DRAM", 1));
   246                   v.Add(new Voltage("+3.3V", 2));
   247                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   248                   v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   249                   v.Add(new Voltage("VBat", 8));
   250                   t.Add(new Temperature("System", 0));
   251                   t.Add(new Temperature("CPU", 1));
   252                   f.Add(new Fan("CPU Fan", 0));
   253                   f.Add(new Fan("System Fan", 1));
   254                   f.Add(new Fan("NB Fan", 2));
   255                   break;
   256                 default:
   257                   v.Add(new Voltage("CPU VCore", 0));
   258                   v.Add(new Voltage("DRAM", 1, true));
   259                   v.Add(new Voltage("+3.3V", 2, true));
   260                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   261                   v.Add(new Voltage("Voltage #5", 4, true));
   262                   v.Add(new Voltage("Voltage #6", 5, true));
   263                   v.Add(new Voltage("Voltage #7", 6, true));
   264                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
   265                   v.Add(new Voltage("VBat", 8));
   266                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   267                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   268                   for (int i = 0; i < superIO.Fans.Length; i++)
   269                     f.Add(new Fan("Fan #" + (i + 1), i));
   270                   break;
   271               }
   272               break;
   273 
   274             default:
   275               v.Add(new Voltage("CPU VCore", 0));
   276               v.Add(new Voltage("Voltage #2", 1, true));
   277               v.Add(new Voltage("Voltage #3", 2, true));
   278               v.Add(new Voltage("Voltage #4", 3, true));
   279               v.Add(new Voltage("Voltage #5", 4, true));
   280               v.Add(new Voltage("Voltage #6", 5, true));
   281               v.Add(new Voltage("Voltage #7", 6, true));
   282               v.Add(new Voltage("Voltage #8", 7, true));
   283               v.Add(new Voltage("VBat", 8));
   284               for (int i = 0; i < superIO.Temperatures.Length; i++)
   285                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   286               for (int i = 0; i < superIO.Fans.Length; i++)
   287                 f.Add(new Fan("Fan #" + (i + 1), i));
   288               break;
   289           }
   290           break;
   291           
   292         case Chip.F71858:
   293           v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   294           v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
   295           v.Add(new Voltage("Battery", 2, 150, 150, 0));
   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));
   300           break;
   301         case Chip.F71862: 
   302         case Chip.F71869: 
   303         case Chip.F71882:
   304         case Chip.F71889ED: 
   305         case Chip.F71889F:
   306           switch (manufacturer) {
   307             case Manufacturer.EVGA:
   308               switch (model) {
   309                 case Model.X58_SLI_Classified:
   310                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   311                   v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
   312                   v.Add(new Voltage("DIMM", 2, 47, 100, 0));
   313                   v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
   314                   v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
   315                   v.Add(new Voltage("+5V", 5, 51, 12, 0));
   316                   v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
   317                   v.Add(new Voltage("3VSB", 7, 150, 150, 0));
   318                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   319                   t.Add(new Temperature("CPU", 0));
   320                   t.Add(new Temperature("VREG", 1));
   321                   t.Add(new Temperature("System", 2));
   322                   f.Add(new Fan("CPU Fan", 0));
   323                   f.Add(new Fan("Power Fan", 1));
   324                   f.Add(new Fan("Chassis Fan", 2));
   325                   break;
   326                 default:
   327                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   328                   v.Add(new Voltage("CPU VCore", 1));
   329                   v.Add(new Voltage("Voltage #3", 2, true));
   330                   v.Add(new Voltage("Voltage #4", 3, true));
   331                   v.Add(new Voltage("Voltage #5", 4, true));
   332                   v.Add(new Voltage("Voltage #6", 5, true));
   333                   v.Add(new Voltage("Voltage #7", 6, true));
   334                   v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   335                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   336                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   337                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   338                   for (int i = 0; i < superIO.Fans.Length; i++)
   339                     f.Add(new Fan("Fan #" + (i + 1), i));
   340                   break;
   341               }
   342               break;
   343             default:
   344               v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   345               v.Add(new Voltage("CPU VCore", 1));
   346               v.Add(new Voltage("Voltage #3", 2, true));
   347               v.Add(new Voltage("Voltage #4", 3, true));
   348               v.Add(new Voltage("Voltage #5", 4, true));
   349               v.Add(new Voltage("Voltage #6", 5, true));
   350               v.Add(new Voltage("Voltage #7", 6, true));
   351               v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   352               v.Add(new Voltage("VBat", 8, 150, 150, 0));
   353               for (int i = 0; i < superIO.Temperatures.Length; i++)
   354                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   355               for (int i = 0; i < superIO.Fans.Length; i++)
   356                 f.Add(new Fan("Fan #" + (i + 1), i));
   357               break;
   358           }
   359           break;
   360 
   361         case Chip.W83627EHF:          
   362           v.Add(new Voltage("CPU VCore", 0));
   363           v.Add(new Voltage("Voltage #2", 1, true));
   364           v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   365           v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   366           v.Add(new Voltage("Voltage #5", 4, true));
   367           v.Add(new Voltage("Voltage #6", 5, true));
   368           v.Add(new Voltage("Voltage #7", 6, true));
   369           v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   370           v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   371           v.Add(new Voltage("Voltage #10", 9, true));
   372           t.Add(new Temperature("CPU", 0));
   373           t.Add(new Temperature("Auxiliary", 1));
   374           t.Add(new Temperature("System", 2));
   375           f.Add(new Fan("System", 0));
   376           f.Add(new Fan("CPU", 1));
   377           f.Add(new Fan("Auxiliary", 2));
   378           f.Add(new Fan("CPU #2", 3));
   379           f.Add(new Fan("Auxiliary #2", 4));
   380           break;
   381         case Chip.W83627DHG: 
   382         case Chip.W83627DHGP:                      
   383         case Chip.W83667HG:
   384         case Chip.W83667HGB:
   385           v.Add(new Voltage("CPU VCore", 0));
   386           v.Add(new Voltage("Voltage #2", 1, true));
   387           v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   388           v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   389           v.Add(new Voltage("Voltage #5", 4, true));
   390           v.Add(new Voltage("Voltage #6", 5, true));
   391           v.Add(new Voltage("Voltage #7", 6, true));
   392           v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   393           v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   394           t.Add(new Temperature("CPU", 0));
   395           t.Add(new Temperature("Auxiliary", 1));
   396           t.Add(new Temperature("System", 2));
   397           f.Add(new Fan("System", 0));
   398           f.Add(new Fan("CPU", 1));
   399           f.Add(new Fan("Auxiliary", 2));
   400           f.Add(new Fan("CPU #2", 3));
   401           f.Add(new Fan("Auxiliary #2", 4));            
   402           break;
   403         case Chip.W83627HF: 
   404         case Chip.W83627THF: 
   405         case Chip.W83687THF:
   406           v.Add(new Voltage("CPU VCore", 0));
   407           v.Add(new Voltage("Voltage #2", 1, true));
   408           v.Add(new Voltage("Voltage #3", 2, true));
   409           v.Add(new Voltage("AVCC", 3, 34, 51, 0));
   410           v.Add(new Voltage("Voltage #5", 4, true));
   411           v.Add(new Voltage("5VSB", 5, 34, 51, 0));
   412           v.Add(new Voltage("VBAT", 6));
   413           t.Add(new Temperature("CPU", 0));
   414           t.Add(new Temperature("Auxiliary", 1));
   415           t.Add(new Temperature("System", 2));
   416           f.Add(new Fan("System", 0));
   417           f.Add(new Fan("CPU", 1));
   418           f.Add(new Fan("Auxiliary", 2));
   419           break;
   420         default:
   421           for (int i = 0; i < superIO.Voltages.Length; i++)
   422             v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   423           for (int i = 0; i < superIO.Temperatures.Length; i++)
   424             t.Add(new Temperature("Temperature #" + (i + 1), i));
   425           for (int i = 0; i < superIO.Fans.Length; i++)
   426             f.Add(new Fan("Fan #" + (i + 1), i));
   427           break;
   428       }
   429 
   430       string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   431       foreach (Voltage voltage in v) 
   432         if (voltage.Index < superIO.Voltages.Length) {
   433           Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   434             voltage.Hidden, SensorType.Voltage, this, 
   435             new ParameterDescription[] {
   436             new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   437               formula, voltage.Ri),
   438             new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   439               formula, voltage.Rf),
   440             new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   441               formula, voltage.Vf)
   442             });
   443           voltages.Add(sensor);
   444       }
   445 
   446       foreach (Temperature temperature in t) 
   447         if (temperature.Index < superIO.Temperatures.Length) {
   448         Sensor sensor = new Sensor(temperature.Name, temperature.Index,
   449           SensorType.Temperature, this, new ParameterDescription[] {
   450           new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   451         });
   452         temperatures.Add(sensor);
   453       }
   454 
   455       foreach (Fan fan in f)
   456         if (fan.Index < superIO.Fans.Length) {
   457           Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
   458             this, null);
   459           fans.Add(sensor);
   460         }
   461     }
   462 
   463     public override Identifier Identifier {
   464       get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
   465     }
   466 
   467     public override Image Icon {
   468       get { return icon; }
   469     }
   470 
   471     public override string Name {
   472       get { return name; }
   473     }
   474 
   475     public override string GetReport() {
   476       return superIO.GetReport();
   477     }
   478 
   479     public override void Update() {
   480       superIO.Update();
   481 
   482       foreach (Sensor sensor in voltages) {
   483         float? value = superIO.Voltages[sensor.Index];
   484         if (value.HasValue) {
   485           sensor.Value = value + (value - sensor.Parameters[2].Value) *
   486             sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   487           ActivateSensor(sensor);
   488         }
   489       }
   490 
   491       foreach (Sensor sensor in temperatures) {
   492         float? value = superIO.Temperatures[sensor.Index];
   493         if (value.HasValue) {
   494           sensor.Value = value + sensor.Parameters[0].Value;
   495           ActivateSensor(sensor);
   496         }
   497       }
   498 
   499       foreach (Sensor sensor in fans) {
   500         float? value = superIO.Fans[sensor.Index];
   501         if (value.HasValue) {
   502           sensor.Value = value;
   503           if (value.Value > 0)
   504             ActivateSensor(sensor);
   505         }
   506       }
   507     }
   508 
   509     private class Voltage {
   510       public readonly string Name;
   511       public readonly int Index;
   512       public readonly float Ri;
   513       public readonly float Rf;
   514       public readonly float Vf;
   515       public readonly bool Hidden;
   516 
   517       public Voltage(string name, int index) :
   518         this(name, index, 0, 1, 0, false) { }
   519 
   520       public Voltage(string name, int index, bool hidden) :
   521         this(name, index, 0, 1, 0, hidden) { }
   522 
   523       public Voltage(string name, int index, float ri, float rf, float vf) :
   524         this(name, index, ri, rf, vf, false) { }
   525 
   526       public Voltage(string name, int index, float ri, float rf, float vf,
   527         bool hidden) {
   528         this.Name = name;
   529         this.Index = index;
   530         this.Ri = ri;
   531         this.Rf = rf;
   532         this.Vf = vf;
   533         this.Hidden = hidden;
   534       }
   535     }
   536 
   537     private class Temperature {
   538       public readonly string Name;
   539       public readonly int Index;
   540 
   541       public Temperature(string name, int index) {
   542         this.Name = name;
   543         this.Index = index;
   544       }
   545     }
   546 
   547     private class Fan {
   548       public readonly string Name;
   549       public readonly int Index;
   550 
   551       public Fan(string name, int index) {
   552         this.Name = name;
   553         this.Index = index;
   554       }
   555     }
   556   }
   557 }