Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Wed, 04 Aug 2010 19:10:20 +0000
changeset 161 65f2d62d7838
parent 153 62162db94359
child 165 813d8bc3192f
permissions -rw-r--r--
Adding missing class SensorVisitor.
     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         case Chip.Unknown: this.name = "Unkown"; break;
    81       }
    82 
    83       List<Voltage> v = new List<Voltage>();
    84       List<Temperature> t = new List<Temperature>();
    85       List<Fan> f = new List<Fan>();
    86 
    87       switch (superIO.Chip) {
    88         case Chip.IT8712F:
    89         case Chip.IT8716F:
    90         case Chip.IT8718F:
    91         case Chip.IT8720F:
    92         case Chip.IT8726F:
    93           switch (manufacturer) {
    94             case Manufacturer.ASUS:
    95               switch (model) {
    96                 case Model.Crosshair_III_Formula:
    97                   v.Add(new Voltage("VBat", 8));
    98                   t.Add(new Temperature("CPU", 0));
    99                   for (int i = 0; i < superIO.Fans.Length; i++)
   100                     f.Add(new Fan("Fan #" + (i + 1), i));
   101                   break;
   102                 case Model.M2N_SLI_DELUXE:                
   103                   v.Add(new Voltage("CPU VCore", 0));
   104                   v.Add(new Voltage("+3.3V", 1));
   105                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   106                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   107                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   108                   v.Add(new Voltage("VBat", 8));
   109                   t.Add(new Temperature("CPU", 0));
   110                   t.Add(new Temperature("Motherboard", 1));
   111                   f.Add(new Fan("CPU Fan", 0));
   112                   f.Add(new Fan("Chassis Fan #1", 1));
   113                   f.Add(new Fan("Power Fan", 2));
   114                   break;
   115                 case Model.M4A79XTD_EVO:              
   116                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   117                   v.Add(new Voltage("VBat", 8));
   118                   t.Add(new Temperature("CPU", 0));
   119                   t.Add(new Temperature("Motherboard", 1));
   120                   f.Add(new Fan("CPU Fan", 0));
   121                   f.Add(new Fan("Chassis Fan #1", 1));
   122                   f.Add(new Fan("Chassis Fan #2", 2));
   123                   break;
   124                 default:
   125                   v.Add(new Voltage("CPU VCore", 0));
   126                   v.Add(new Voltage("Voltage #2", 1, true));
   127                   v.Add(new Voltage("Voltage #3", 2, true));
   128                   v.Add(new Voltage("Voltage #4", 3, true));
   129                   v.Add(new Voltage("Voltage #5", 4, true));
   130                   v.Add(new Voltage("Voltage #6", 5, true));
   131                   v.Add(new Voltage("Voltage #7", 6, true));
   132                   v.Add(new Voltage("Voltage #8", 7, true));
   133                   v.Add(new Voltage("VBat", 8));
   134                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   135                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   136                   for (int i = 0; i < superIO.Fans.Length; i++)
   137                     f.Add(new Fan("Fan #" + (i + 1), i));
   138                   break;
   139               }
   140               break;
   141             case Manufacturer.DFI:
   142               switch (model) {
   143                 case Model.LP_BI_P45_T2RS_Elite:
   144                   v.Add(new Voltage("CPU VCore", 0));
   145                   v.Add(new Voltage("FSB VTT", 1));
   146                   v.Add(new Voltage("+3.3V", 2));
   147                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   148                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   149                   v.Add(new Voltage("NB Core", 5));
   150                   v.Add(new Voltage("VDIMM", 6));
   151                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   152                   v.Add(new Voltage("VBat", 8));
   153                   t.Add(new Temperature("CPU", 0));
   154                   t.Add(new Temperature("System", 1));
   155                   t.Add(new Temperature("Chipset", 2));
   156                   f.Add(new Fan("Fan #1", 0));
   157                   f.Add(new Fan("Fan #2", 1));
   158                   f.Add(new Fan("Fan #3", 2));
   159                   break;
   160                 case Model.LP_DK_P55_T3eH9:
   161                   v.Add(new Voltage("CPU VCore", 0));
   162                   v.Add(new Voltage("VTT", 1));
   163                   v.Add(new Voltage("+3.3V", 2));
   164                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   165                   v.Add(new Voltage("+12V", 4, 30, 10, 0));
   166                   v.Add(new Voltage("CPU PLL", 5));
   167                   v.Add(new Voltage("DRAM", 6));
   168                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0));
   169                   v.Add(new Voltage("VBat", 8));
   170                   t.Add(new Temperature("Chipset", 0));
   171                   t.Add(new Temperature("CPU PWM", 1));
   172                   t.Add(new Temperature("CPU", 2));
   173                   f.Add(new Fan("Fan #1", 0));
   174                   f.Add(new Fan("Fan #2", 1));
   175                   f.Add(new Fan("Fan #3", 2));
   176                   break;
   177                 default:
   178                   v.Add(new Voltage("CPU VCore", 0));
   179                   v.Add(new Voltage("VTT", 1, true));
   180                   v.Add(new Voltage("+3.3V", 2, true));
   181                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   182                   v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
   183                   v.Add(new Voltage("Voltage #6", 5, true));
   184                   v.Add(new Voltage("DRAM", 6, true));
   185                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
   186                   v.Add(new Voltage("VBat", 8));
   187                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   188                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   189                   for (int i = 0; i < superIO.Fans.Length; i++)
   190                     f.Add(new Fan("Fan #" + (i + 1), i));
   191                   break;
   192               }
   193               break;
   194 
   195             case Manufacturer.Gigabyte:
   196               switch (model) {
   197                 case Model._965P_S3:
   198                   v.Add(new Voltage("CPU VCore", 0));
   199                   v.Add(new Voltage("DRAM", 1));
   200                   v.Add(new Voltage("+3.3V", 2));
   201                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   202                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   203                   v.Add(new Voltage("VBat", 8));
   204                   t.Add(new Temperature("System", 0));
   205                   t.Add(new Temperature("CPU", 1));
   206                   f.Add(new Fan("CPU Fan", 0));
   207                   f.Add(new Fan("System Fan", 1));
   208                   break;
   209                 case Model.EP45_DS3R:
   210                 case Model.EP45_UD3R: 
   211                 case Model.X38_DS5:    
   212                   v.Add(new Voltage("CPU VCore", 0));
   213                   v.Add(new Voltage("DRAM", 1));
   214                   v.Add(new Voltage("+3.3V", 2));
   215                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   216                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   217                   v.Add(new Voltage("VBat", 8));
   218                   t.Add(new Temperature("System", 0));
   219                   t.Add(new Temperature("CPU", 1));
   220                   f.Add(new Fan("CPU Fan", 0));
   221                   f.Add(new Fan("System Fan #2", 1));
   222                   f.Add(new Fan("Power Fan", 2));
   223                   f.Add(new Fan("System Fan #1", 3));
   224                   break;
   225                 case Model.EX58_EXTREME:
   226                   v.Add(new Voltage("CPU VCore", 0));
   227                   v.Add(new Voltage("DRAM", 1));
   228                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   229                   v.Add(new Voltage("VBat", 8));
   230                   t.Add(new Temperature("System", 0));
   231                   t.Add(new Temperature("CPU", 1));
   232                   t.Add(new Temperature("Northbridge", 2));
   233                   f.Add(new Fan("CPU Fan", 0));
   234                   f.Add(new Fan("System Fan #2", 1));
   235                   f.Add(new Fan("Power Fan", 2));
   236                   f.Add(new Fan("System Fan #1", 3));
   237                   break;
   238                 case Model.P35_DS3:
   239                 case Model.P35_DS3L:
   240                   v.Add(new Voltage("CPU VCore", 0));
   241                   v.Add(new Voltage("DRAM", 1));
   242                   v.Add(new Voltage("+3.3V", 2));
   243                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   244                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0));
   245                   v.Add(new Voltage("VBat", 8));
   246                   t.Add(new Temperature("System", 0));
   247                   t.Add(new Temperature("CPU", 1));
   248                   f.Add(new Fan("CPU Fan", 0));
   249                   f.Add(new Fan("System Fan #1", 1));
   250                   f.Add(new Fan("System Fan #2", 2));
   251                   f.Add(new Fan("Power Fan", 3));
   252                   break;
   253                 case Model.P55_UD4:                
   254                   v.Add(new Voltage("CPU VCore", 0));
   255                   v.Add(new Voltage("DRAM", 1));
   256                   v.Add(new Voltage("+3.3V", 2));
   257                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   258                   v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
   259                   v.Add(new Voltage("VBat", 8));
   260                   t.Add(new Temperature("System", 0));
   261                   t.Add(new Temperature("CPU", 2));
   262                   f.Add(new Fan("CPU Fan", 0));
   263                   f.Add(new Fan("System Fan #2", 1));
   264                   f.Add(new Fan("Power Fan", 2));
   265                   f.Add(new Fan("System Fan #1", 3));
   266                   break;
   267                 case Model.GA_MA770T_UD3:
   268                   v.Add(new Voltage("CPU VCore", 0));
   269                   v.Add(new Voltage("DRAM", 1));
   270                   v.Add(new Voltage("+3.3V", 2));
   271                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   272                   v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   273                   v.Add(new Voltage("VBat", 8));
   274                   t.Add(new Temperature("System", 0));
   275                   t.Add(new Temperature("CPU", 1));
   276                   f.Add(new Fan("CPU Fan", 0));
   277                   f.Add(new Fan("System Fan #1", 1));
   278                   f.Add(new Fan("System Fan #2", 2));
   279                   f.Add(new Fan("Power Fan", 3));
   280                   break;
   281                 case Model.GA_MA785GMT_UD2H:
   282                   v.Add(new Voltage("CPU VCore", 0));
   283                   v.Add(new Voltage("DRAM", 1));
   284                   v.Add(new Voltage("+3.3V", 2));
   285                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   286                   v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   287                   v.Add(new Voltage("VBat", 8));
   288                   t.Add(new Temperature("System", 0));
   289                   t.Add(new Temperature("CPU", 1));
   290                   f.Add(new Fan("CPU Fan", 0));
   291                   f.Add(new Fan("System Fan", 1));
   292                   f.Add(new Fan("NB Fan", 2));
   293                   break;
   294                 case Model.X58A_UD3R:
   295                   v.Add(new Voltage("CPU VCore", 0));
   296                   v.Add(new Voltage("DRAM", 1));
   297                   v.Add(new Voltage("+3.3V", 2));
   298                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   299                   v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
   300                   v.Add(new Voltage("VBat", 8));
   301                   t.Add(new Temperature("System", 0));
   302                   t.Add(new Temperature("CPU", 1));
   303                   t.Add(new Temperature("Northbridge", 2));
   304                   f.Add(new Fan("CPU Fan", 0));
   305                   f.Add(new Fan("System Fan #2", 1));
   306                   f.Add(new Fan("Power Fan", 2));
   307                   f.Add(new Fan("System Fan #1", 3));
   308                   break;
   309                 default:
   310                   v.Add(new Voltage("CPU VCore", 0));
   311                   v.Add(new Voltage("DRAM", 1, true));
   312                   v.Add(new Voltage("+3.3V", 2, true));
   313                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   314                   v.Add(new Voltage("Voltage #5", 4, true));
   315                   v.Add(new Voltage("Voltage #6", 5, true));
   316                   v.Add(new Voltage("Voltage #7", 6, true));
   317                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
   318                   v.Add(new Voltage("VBat", 8));
   319                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   320                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   321                   for (int i = 0; i < superIO.Fans.Length; i++)
   322                     f.Add(new Fan("Fan #" + (i + 1), i));
   323                   break;
   324               }
   325               break;
   326 
   327             default:
   328               v.Add(new Voltage("CPU VCore", 0));
   329               v.Add(new Voltage("Voltage #2", 1, true));
   330               v.Add(new Voltage("Voltage #3", 2, true));
   331               v.Add(new Voltage("Voltage #4", 3, true));
   332               v.Add(new Voltage("Voltage #5", 4, true));
   333               v.Add(new Voltage("Voltage #6", 5, true));
   334               v.Add(new Voltage("Voltage #7", 6, true));
   335               v.Add(new Voltage("Voltage #8", 7, true));
   336               v.Add(new Voltage("VBat", 8));
   337               for (int i = 0; i < superIO.Temperatures.Length; i++)
   338                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   339               for (int i = 0; i < superIO.Fans.Length; i++)
   340                 f.Add(new Fan("Fan #" + (i + 1), i));
   341               break;
   342           }
   343           break;
   344           
   345         case Chip.F71858:
   346           v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   347           v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
   348           v.Add(new Voltage("Battery", 2, 150, 150, 0));
   349           for (int i = 0; i < superIO.Temperatures.Length; i++)
   350             t.Add(new Temperature("Temperature #" + (i + 1), i));
   351           for (int i = 0; i < superIO.Fans.Length; i++)
   352             f.Add(new Fan("Fan #" + (i + 1), i));
   353           break;
   354         case Chip.F71862: 
   355         case Chip.F71869: 
   356         case Chip.F71882:
   357         case Chip.F71889ED: 
   358         case Chip.F71889F:
   359           switch (manufacturer) {
   360             case Manufacturer.EVGA:
   361               switch (model) {
   362                 case Model.X58_SLI_Classified:
   363                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   364                   v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
   365                   v.Add(new Voltage("DIMM", 2, 47, 100, 0));
   366                   v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
   367                   v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
   368                   v.Add(new Voltage("+5V", 5, 51, 12, 0));
   369                   v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
   370                   v.Add(new Voltage("3VSB", 7, 150, 150, 0));
   371                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   372                   t.Add(new Temperature("CPU", 0));
   373                   t.Add(new Temperature("VREG", 1));
   374                   t.Add(new Temperature("System", 2));
   375                   f.Add(new Fan("CPU Fan", 0));
   376                   f.Add(new Fan("Power Fan", 1));
   377                   f.Add(new Fan("Chassis Fan", 2));
   378                   break;
   379                 default:
   380                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   381                   v.Add(new Voltage("CPU VCore", 1));
   382                   v.Add(new Voltage("Voltage #3", 2, true));
   383                   v.Add(new Voltage("Voltage #4", 3, true));
   384                   v.Add(new Voltage("Voltage #5", 4, true));
   385                   v.Add(new Voltage("Voltage #6", 5, true));
   386                   v.Add(new Voltage("Voltage #7", 6, true));
   387                   v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   388                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   389                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   390                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   391                   for (int i = 0; i < superIO.Fans.Length; i++)
   392                     f.Add(new Fan("Fan #" + (i + 1), i));
   393                   break;
   394               }
   395               break;
   396             default:
   397               v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   398               v.Add(new Voltage("CPU VCore", 1));
   399               v.Add(new Voltage("Voltage #3", 2, true));
   400               v.Add(new Voltage("Voltage #4", 3, true));
   401               v.Add(new Voltage("Voltage #5", 4, true));
   402               v.Add(new Voltage("Voltage #6", 5, true));
   403               v.Add(new Voltage("Voltage #7", 6, true));
   404               v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   405               v.Add(new Voltage("VBat", 8, 150, 150, 0));
   406               for (int i = 0; i < superIO.Temperatures.Length; i++)
   407                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   408               for (int i = 0; i < superIO.Fans.Length; i++)
   409                 f.Add(new Fan("Fan #" + (i + 1), i));
   410               break;
   411           }
   412           break;
   413 
   414         case Chip.W83627EHF:          
   415           v.Add(new Voltage("CPU VCore", 0));
   416           v.Add(new Voltage("Voltage #2", 1, true));
   417           v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   418           v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   419           v.Add(new Voltage("Voltage #5", 4, true));
   420           v.Add(new Voltage("Voltage #6", 5, true));
   421           v.Add(new Voltage("Voltage #7", 6, true));
   422           v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   423           v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   424           v.Add(new Voltage("Voltage #10", 9, true));
   425           t.Add(new Temperature("CPU", 0));
   426           t.Add(new Temperature("Auxiliary", 1));
   427           t.Add(new Temperature("System", 2));
   428           f.Add(new Fan("System Fan", 0));
   429           f.Add(new Fan("CPU Fan", 1));
   430           f.Add(new Fan("Auxiliary Fan", 2));
   431           f.Add(new Fan("CPU Fan #2", 3));
   432           f.Add(new Fan("Auxiliary Fan #2", 4));
   433           break;
   434         case Chip.W83627DHG: 
   435         case Chip.W83627DHGP:                      
   436         case Chip.W83667HG:
   437         case Chip.W83667HGB:
   438           switch (manufacturer) {
   439             case Manufacturer.ASRock:
   440               switch (model) {
   441                 case Model._880GMH_USB3: 
   442                   v.Add(new Voltage("CPU VCore", 0));
   443                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   444                   v.Add(new Voltage("+5V", 5, 15, 7.5f, 0));
   445                   v.Add(new Voltage("+12V", 6, 56, 10, 0));
   446                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   447                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   448                   t.Add(new Temperature("CPU", 0));
   449                   t.Add(new Temperature("Motherboard", 2));
   450                   f.Add(new Fan("Chassis Fan", 0));
   451                   f.Add(new Fan("CPU Fan", 1));
   452                   f.Add(new Fan("Power Fan", 2));
   453                   break;
   454                 default:
   455                   v.Add(new Voltage("CPU VCore", 0));
   456                   v.Add(new Voltage("Voltage #2", 1, true));
   457                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   458                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   459                   v.Add(new Voltage("Voltage #5", 4, true));
   460                   v.Add(new Voltage("Voltage #6", 5, true));
   461                   v.Add(new Voltage("Voltage #7", 6, true));
   462                   v.Add(new Voltage("3VSB", 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("Auxiliary", 1));
   466                   t.Add(new Temperature("System", 2));
   467                   f.Add(new Fan("System Fan", 0));
   468                   f.Add(new Fan("CPU Fan", 1));
   469                   f.Add(new Fan("Auxiliary Fan", 2));
   470                   f.Add(new Fan("CPU Fan #2", 3));
   471                   f.Add(new Fan("Auxiliary Fan #2", 4));
   472                   break;
   473               }
   474               break;
   475             case Manufacturer.ASUS:
   476               switch (model) {
   477                 case Model.P6X58D_E:
   478                   v.Add(new Voltage("CPU VCore", 0));
   479                   v.Add(new Voltage("+12V", 1, 11.5f, 1.91f, 0));
   480                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
   481                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   482                   v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
   483                   v.Add(new Voltage("Voltage #6", 5, true));
   484                   v.Add(new Voltage("Voltage #7", 6, true));
   485                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   486                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   487                   t.Add(new Temperature("CPU", 0));
   488                   t.Add(new Temperature("Auxiliary", 1, true));
   489                   t.Add(new Temperature("Motherboard", 2));
   490                   f.Add(new Fan("Chassis Fan #1", 0));
   491                   f.Add(new Fan("CPU Fan", 1));
   492                   f.Add(new Fan("Power Fan", 2));
   493                   f.Add(new Fan("Chassis Fan #2", 3));
   494                   f.Add(new Fan("Chassis Fan #3", 4));
   495                   break;
   496                 default:
   497                   v.Add(new Voltage("CPU VCore", 0));
   498                   v.Add(new Voltage("Voltage #2", 1, true));
   499                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   500                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   501                   v.Add(new Voltage("Voltage #5", 4, true));
   502                   v.Add(new Voltage("Voltage #6", 5, true));
   503                   v.Add(new Voltage("Voltage #7", 6, true));
   504                   v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   505                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   506                   t.Add(new Temperature("CPU", 0));
   507                   t.Add(new Temperature("Auxiliary", 1));
   508                   t.Add(new Temperature("System", 2));
   509                   f.Add(new Fan("System Fan", 0));
   510                   f.Add(new Fan("CPU Fan", 1));
   511                   f.Add(new Fan("Auxiliary Fan", 2));
   512                   f.Add(new Fan("CPU Fan #2", 3));
   513                   f.Add(new Fan("Auxiliary Fan #2", 4));
   514                   break;
   515               }
   516               break;
   517             default:
   518               v.Add(new Voltage("CPU VCore", 0));
   519               v.Add(new Voltage("Voltage #2", 1, true));
   520               v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   521               v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   522               v.Add(new Voltage("Voltage #5", 4, true));
   523               v.Add(new Voltage("Voltage #6", 5, true));
   524               v.Add(new Voltage("Voltage #7", 6, true));
   525               v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   526               v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   527               t.Add(new Temperature("CPU", 0));
   528               t.Add(new Temperature("Auxiliary", 1));
   529               t.Add(new Temperature("System", 2));
   530               f.Add(new Fan("System Fan", 0));
   531               f.Add(new Fan("CPU Fan", 1));
   532               f.Add(new Fan("Auxiliary Fan", 2));
   533               f.Add(new Fan("CPU Fan #2", 3));
   534               f.Add(new Fan("Auxiliary Fan #2", 4));
   535               break;
   536           } 
   537           break;
   538         case Chip.W83627HF: 
   539         case Chip.W83627THF: 
   540         case Chip.W83687THF:
   541           v.Add(new Voltage("CPU VCore", 0));
   542           v.Add(new Voltage("Voltage #2", 1, true));
   543           v.Add(new Voltage("Voltage #3", 2, true));
   544           v.Add(new Voltage("AVCC", 3, 34, 51, 0));
   545           v.Add(new Voltage("Voltage #5", 4, true));
   546           v.Add(new Voltage("5VSB", 5, 34, 51, 0));
   547           v.Add(new Voltage("VBAT", 6));
   548           t.Add(new Temperature("CPU", 0));
   549           t.Add(new Temperature("Auxiliary", 1));
   550           t.Add(new Temperature("System", 2));
   551           f.Add(new Fan("System Fan", 0));
   552           f.Add(new Fan("CPU Fan", 1));
   553           f.Add(new Fan("Auxiliary Fan", 2));
   554           break;
   555         default:
   556           for (int i = 0; i < superIO.Voltages.Length; i++)
   557             v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   558           for (int i = 0; i < superIO.Temperatures.Length; i++)
   559             t.Add(new Temperature("Temperature #" + (i + 1), i));
   560           for (int i = 0; i < superIO.Fans.Length; i++)
   561             f.Add(new Fan("Fan #" + (i + 1), i));
   562           break;
   563       }
   564 
   565       string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   566       foreach (Voltage voltage in v) 
   567         if (voltage.Index < superIO.Voltages.Length) {
   568           Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   569             voltage.Hidden, SensorType.Voltage, this, 
   570             new ParameterDescription[] {
   571             new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   572               formula, voltage.Ri),
   573             new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   574               formula, voltage.Rf),
   575             new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   576               formula, voltage.Vf)
   577             });
   578           voltages.Add(sensor);
   579       }
   580 
   581       foreach (Temperature temperature in t) 
   582         if (temperature.Index < superIO.Temperatures.Length) {
   583         Sensor sensor = new Sensor(temperature.Name, temperature.Index,
   584           SensorType.Temperature, this, new ParameterDescription[] {
   585           new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   586         });
   587         temperatures.Add(sensor);
   588       }
   589 
   590       foreach (Fan fan in f)
   591         if (fan.Index < superIO.Fans.Length) {
   592           Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
   593             this, null);
   594           fans.Add(sensor);
   595         }
   596     }
   597 
   598     public override Identifier Identifier {
   599       get { return new Identifier("lpc", superIO.Chip.ToString().ToLower()); }
   600     }
   601 
   602     public override Image Icon {
   603       get { return icon; }
   604     }
   605 
   606     public override string Name {
   607       get { return name; }
   608     }
   609 
   610     public override string GetReport() {
   611       return superIO.GetReport();
   612     }
   613 
   614     public override void Update() {
   615       superIO.Update();
   616 
   617       foreach (Sensor sensor in voltages) {
   618         float? value = superIO.Voltages[sensor.Index];
   619         if (value.HasValue) {
   620           sensor.Value = value + (value - sensor.Parameters[2].Value) *
   621             sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   622           ActivateSensor(sensor);
   623         }
   624       }
   625 
   626       foreach (Sensor sensor in temperatures) {
   627         float? value = superIO.Temperatures[sensor.Index];
   628         if (value.HasValue) {
   629           sensor.Value = value + sensor.Parameters[0].Value;
   630           ActivateSensor(sensor);
   631         }
   632       }
   633 
   634       foreach (Sensor sensor in fans) {
   635         float? value = superIO.Fans[sensor.Index];
   636         if (value.HasValue) {
   637           sensor.Value = value;
   638           if (value.Value > 0)
   639             ActivateSensor(sensor);
   640         }
   641       }
   642     }
   643 
   644     private class Voltage {
   645       public readonly string Name;
   646       public readonly int Index;
   647       public readonly float Ri;
   648       public readonly float Rf;
   649       public readonly float Vf;
   650       public readonly bool Hidden;
   651 
   652       public Voltage(string name, int index) :
   653         this(name, index, 0, 1, 0, false) { }
   654 
   655       public Voltage(string name, int index, bool hidden) :
   656         this(name, index, 0, 1, 0, hidden) { }
   657 
   658       public Voltage(string name, int index, float ri, float rf, float vf) :
   659         this(name, index, ri, rf, vf, false) { }
   660 
   661       public Voltage(string name, int index, float ri, float rf, float vf,
   662         bool hidden) {
   663         this.Name = name;
   664         this.Index = index;
   665         this.Ri = ri;
   666         this.Rf = rf;
   667         this.Vf = vf;
   668         this.Hidden = hidden;
   669       }
   670     }
   671 
   672     private class Temperature {
   673       public readonly string Name;
   674       public readonly int Index;
   675       public readonly bool Hidden;
   676 
   677       public Temperature(string name, int index) :
   678         this(name, index, false) { }
   679 
   680       public Temperature(string name, int index, bool hidden) {
   681         this.Name = name;
   682         this.Index = index;
   683         this.Hidden = hidden;
   684       }
   685     }
   686 
   687     private class Fan {
   688       public readonly string Name;
   689       public readonly int Index;
   690 
   691       public Fan(string name, int index) {
   692         this.Name = name;
   693         this.Index = index;
   694       }
   695     }
   696   }
   697 }