Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Tue, 24 Aug 2010 22:11:10 +0000
changeset 175 e4ee19d583bd
parent 170 31858ba46e9c
child 176 c16fd81b520a
permissions -rw-r--r--
Search all possible registry locations for the Heatmaster serial port.
     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.Globalization;
    41 using OpenHardwareMonitor.Hardware.LPC;
    42 
    43 namespace OpenHardwareMonitor.Hardware.Mainboard {
    44   internal class SuperIOHardware : Hardware {
    45 
    46     private ISuperIO superIO;
    47     private string name;
    48 
    49     private List<Sensor> voltages = new List<Sensor>();
    50     private List<Sensor> temperatures = new List<Sensor>();
    51     private List<Sensor> fans = new List<Sensor>();
    52 
    53 
    54     public SuperIOHardware(ISuperIO superIO, Manufacturer manufacturer,
    55       Model model, ISettings settings) 
    56     {
    57       this.superIO = superIO;
    58       this.name = ChipName.GetName(superIO.Chip);
    59 
    60       List<Voltage> v = new List<Voltage>();
    61       List<Temperature> t = new List<Temperature>();
    62       List<Fan> f = new List<Fan>();
    63 
    64       switch (superIO.Chip) {
    65         case Chip.IT8712F:
    66         case Chip.IT8716F:
    67         case Chip.IT8718F:
    68         case Chip.IT8720F:        
    69         case Chip.IT8726F:
    70           switch (manufacturer) {
    71             case Manufacturer.ASUS:
    72               switch (model) {
    73                 case Model.Crosshair_III_Formula: // IT8720F
    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));
    78                   break;
    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));
    91                   break;
    92                 case Model.M4A79XTD_EVO: // IT8720F           
    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));
   100                   break;
   101                 default:
   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));
   115                   break;
   116               }
   117               break;
   118             case Manufacturer.DFI:
   119               switch (model) {
   120                 case Model.LP_BI_P45_T2RS_Elite: // IT8718F
   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));
   136                   break;
   137                 case Model.LP_DK_P55_T3eH9: // IT8720F
   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));
   153                   break;
   154                 default:
   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));
   168                   break;
   169               }
   170               break;
   171 
   172             case Manufacturer.Gigabyte:
   173               switch (model) {
   174                 case Model._965P_S3: // IT8718F
   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));
   185                   break;
   186                 case Model.EP45_DS3R: // IT8718F
   187                 case Model.EP45_UD3R: 
   188                 case Model.X38_DS5:    
   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));
   201                   break;
   202                 case Model.EX58_EXTREME: // IT8720F 
   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));
   214                   break;
   215                 case Model.P35_DS3: // IT8718F 
   216                 case Model.P35_DS3L: // IT8718F
   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));
   229                   break;
   230                 case Model.P55_UD4: // IT8720F
   231                 case Model.P55M_UD4: // IT8720F
   232                   v.Add(new Voltage("CPU VCore", 0));
   233                   v.Add(new Voltage("DRAM", 1));
   234                   v.Add(new Voltage("+3.3V", 2));
   235                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   236                   v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
   237                   v.Add(new Voltage("VBat", 8));
   238                   t.Add(new Temperature("System", 0));
   239                   t.Add(new Temperature("CPU", 2));
   240                   f.Add(new Fan("CPU Fan", 0));
   241                   f.Add(new Fan("System Fan #2", 1));
   242                   f.Add(new Fan("Power Fan", 2));
   243                   f.Add(new Fan("System Fan #1", 3));
   244                   break;
   245                 case Model.GA_MA770T_UD3: // IT8720F
   246                   v.Add(new Voltage("CPU VCore", 0));
   247                   v.Add(new Voltage("DRAM", 1));
   248                   v.Add(new Voltage("+3.3V", 2));
   249                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   250                   v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   251                   v.Add(new Voltage("VBat", 8));
   252                   t.Add(new Temperature("System", 0));
   253                   t.Add(new Temperature("CPU", 1));
   254                   f.Add(new Fan("CPU Fan", 0));
   255                   f.Add(new Fan("System Fan #1", 1));
   256                   f.Add(new Fan("System Fan #2", 2));
   257                   f.Add(new Fan("Power Fan", 3));
   258                   break;
   259                 case Model.GA_MA785GMT_UD2H: // IT8718F
   260                   v.Add(new Voltage("CPU VCore", 0));
   261                   v.Add(new Voltage("DRAM", 1));
   262                   v.Add(new Voltage("+3.3V", 2));
   263                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   264                   v.Add(new Voltage("+12V", 4, 27, 9.1f, 0));
   265                   v.Add(new Voltage("VBat", 8));
   266                   t.Add(new Temperature("System", 0));
   267                   t.Add(new Temperature("CPU", 1));
   268                   f.Add(new Fan("CPU Fan", 0));
   269                   f.Add(new Fan("System Fan", 1));
   270                   f.Add(new Fan("NB Fan", 2));
   271                   break;
   272                 case Model.X58A_UD3R: // IT8720F 
   273                   v.Add(new Voltage("CPU VCore", 0));
   274                   v.Add(new Voltage("DRAM", 1));
   275                   v.Add(new Voltage("+3.3V", 2));
   276                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0));
   277                   v.Add(new Voltage("+12V", 5, 27, 9.1f, 0));
   278                   v.Add(new Voltage("VBat", 8));
   279                   t.Add(new Temperature("System", 0));
   280                   t.Add(new Temperature("CPU", 1));
   281                   t.Add(new Temperature("Northbridge", 2));
   282                   f.Add(new Fan("CPU Fan", 0));
   283                   f.Add(new Fan("System Fan #2", 1));
   284                   f.Add(new Fan("Power Fan", 2));
   285                   f.Add(new Fan("System Fan #1", 3));
   286                   break;
   287                 default:
   288                   v.Add(new Voltage("CPU VCore", 0));
   289                   v.Add(new Voltage("DRAM", 1, true));
   290                   v.Add(new Voltage("+3.3V", 2, true));
   291                   v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
   292                   v.Add(new Voltage("Voltage #5", 4, true));
   293                   v.Add(new Voltage("Voltage #6", 5, true));
   294                   v.Add(new Voltage("Voltage #7", 6, true));
   295                   v.Add(new Voltage("+12V", 7, 27, 9.1f, 0, true));
   296                   v.Add(new Voltage("VBat", 8));
   297                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   298                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   299                   for (int i = 0; i < superIO.Fans.Length; i++)
   300                     f.Add(new Fan("Fan #" + (i + 1), i));
   301                   break;
   302               }
   303               break;
   304 
   305             default:
   306               v.Add(new Voltage("CPU VCore", 0));
   307               v.Add(new Voltage("Voltage #2", 1, true));
   308               v.Add(new Voltage("Voltage #3", 2, true));
   309               v.Add(new Voltage("Voltage #4", 3, true));
   310               v.Add(new Voltage("Voltage #5", 4, true));
   311               v.Add(new Voltage("Voltage #6", 5, true));
   312               v.Add(new Voltage("Voltage #7", 6, true));
   313               v.Add(new Voltage("Voltage #8", 7, true));
   314               v.Add(new Voltage("VBat", 8));
   315               for (int i = 0; i < superIO.Temperatures.Length; i++)
   316                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   317               for (int i = 0; i < superIO.Fans.Length; i++)
   318                 f.Add(new Fan("Fan #" + (i + 1), i));
   319               break;
   320           }
   321           break;
   322 
   323         case Chip.IT8721F:
   324           v.Add(new Voltage("Voltage #1", 0, true));
   325           v.Add(new Voltage("Voltage #2", 1, true));
   326           v.Add(new Voltage("Voltage #3", 2, true));
   327           v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
   328           v.Add(new Voltage("Voltage #5", 4, true));
   329           v.Add(new Voltage("Voltage #6", 5, true));
   330           v.Add(new Voltage("Voltage #7", 6, true));
   331           v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
   332           v.Add(new Voltage("VBat", 8, 10, 10, 0));
   333           for (int i = 0; i < superIO.Temperatures.Length; i++)
   334             t.Add(new Temperature("Temperature #" + (i + 1), i));
   335           for (int i = 0; i < superIO.Fans.Length; i++)
   336             f.Add(new Fan("Fan #" + (i + 1), i));
   337           break;
   338           
   339         case Chip.F71858:
   340           v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   341           v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
   342           v.Add(new Voltage("Battery", 2, 150, 150, 0));
   343           for (int i = 0; i < superIO.Temperatures.Length; i++)
   344             t.Add(new Temperature("Temperature #" + (i + 1), i));
   345           for (int i = 0; i < superIO.Fans.Length; i++)
   346             f.Add(new Fan("Fan #" + (i + 1), i));
   347           break;
   348         case Chip.F71862: 
   349         case Chip.F71869: 
   350         case Chip.F71882:
   351         case Chip.F71889ED: 
   352         case Chip.F71889F:
   353           switch (manufacturer) {
   354             case Manufacturer.EVGA:
   355               switch (model) {
   356                 case Model.X58_SLI_Classified: // F71882 
   357                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   358                   v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
   359                   v.Add(new Voltage("DIMM", 2, 47, 100, 0));
   360                   v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
   361                   v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
   362                   v.Add(new Voltage("+5V", 5, 51, 12, 0));
   363                   v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
   364                   v.Add(new Voltage("3VSB", 7, 150, 150, 0));
   365                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   366                   t.Add(new Temperature("CPU", 0));
   367                   t.Add(new Temperature("VREG", 1));
   368                   t.Add(new Temperature("System", 2));
   369                   f.Add(new Fan("CPU Fan", 0));
   370                   f.Add(new Fan("Power Fan", 1));
   371                   f.Add(new Fan("Chassis Fan", 2));
   372                   break;
   373                 default:
   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));
   387                   break;
   388               }
   389               break;
   390             default:
   391               v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   392               v.Add(new Voltage("CPU VCore", 1));
   393               v.Add(new Voltage("Voltage #3", 2, true));
   394               v.Add(new Voltage("Voltage #4", 3, true));
   395               v.Add(new Voltage("Voltage #5", 4, true));
   396               v.Add(new Voltage("Voltage #6", 5, true));
   397               v.Add(new Voltage("Voltage #7", 6, true));
   398               v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   399               v.Add(new Voltage("VBat", 8, 150, 150, 0));
   400               for (int i = 0; i < superIO.Temperatures.Length; i++)
   401                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   402               for (int i = 0; i < superIO.Fans.Length; i++)
   403                 f.Add(new Fan("Fan #" + (i + 1), i));
   404               break;
   405           }
   406           break;
   407 
   408         case Chip.W83627EHF:          
   409           v.Add(new Voltage("CPU VCore", 0));
   410           v.Add(new Voltage("Voltage #2", 1, true));
   411           v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   412           v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   413           v.Add(new Voltage("Voltage #5", 4, true));
   414           v.Add(new Voltage("Voltage #6", 5, true));
   415           v.Add(new Voltage("Voltage #7", 6, true));
   416           v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   417           v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   418           v.Add(new Voltage("Voltage #10", 9, true));
   419           t.Add(new Temperature("CPU", 0));
   420           t.Add(new Temperature("Auxiliary", 1));
   421           t.Add(new Temperature("System", 2));
   422           f.Add(new Fan("System Fan", 0));
   423           f.Add(new Fan("CPU Fan", 1));
   424           f.Add(new Fan("Auxiliary Fan", 2));
   425           f.Add(new Fan("CPU Fan #2", 3));
   426           f.Add(new Fan("Auxiliary Fan #2", 4));
   427           break;
   428         case Chip.W83627DHG: 
   429         case Chip.W83627DHGP:                      
   430         case Chip.W83667HG:
   431         case Chip.W83667HGB:
   432           switch (manufacturer) {
   433             case Manufacturer.ASRock:
   434               switch (model) {
   435                 case Model._880GMH_USB3: // W83627DHG-P
   436                   v.Add(new Voltage("CPU VCore", 0));
   437                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   438                   v.Add(new Voltage("+5V", 5, 15, 7.5f, 0));
   439                   v.Add(new Voltage("+12V", 6, 56, 10, 0));
   440                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   441                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   442                   t.Add(new Temperature("CPU", 0));
   443                   t.Add(new Temperature("Motherboard", 2));
   444                   f.Add(new Fan("Chassis Fan", 0));
   445                   f.Add(new Fan("CPU Fan", 1));
   446                   f.Add(new Fan("Power Fan", 2));
   447                   break;
   448                 default:
   449                   v.Add(new Voltage("CPU VCore", 0));
   450                   v.Add(new Voltage("Voltage #2", 1, true));
   451                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   452                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   453                   v.Add(new Voltage("Voltage #5", 4, true));
   454                   v.Add(new Voltage("Voltage #6", 5, true));
   455                   v.Add(new Voltage("Voltage #7", 6, true));
   456                   v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   457                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   458                   t.Add(new Temperature("CPU", 0));
   459                   t.Add(new Temperature("Auxiliary", 1));
   460                   t.Add(new Temperature("System", 2));
   461                   f.Add(new Fan("System Fan", 0));
   462                   f.Add(new Fan("CPU Fan", 1));
   463                   f.Add(new Fan("Auxiliary Fan", 2));
   464                   f.Add(new Fan("CPU Fan #2", 3));
   465                   f.Add(new Fan("Auxiliary Fan #2", 4));
   466                   break;
   467               }
   468               break;
   469             case Manufacturer.ASUS:
   470               switch (model) {
   471                 case Model.P6X58D_E: // W83667HG                 
   472                 case Model.Rampage_II_GENE: // W83667HG 
   473                   v.Add(new Voltage("CPU VCore", 0));
   474                   v.Add(new Voltage("+12V", 1, 11.5f, 1.91f, 0));
   475                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
   476                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   477                   v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
   478                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   479                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   480                   t.Add(new Temperature("CPU", 0));
   481                   t.Add(new Temperature("Motherboard", 2));
   482                   f.Add(new Fan("Chassis Fan #1", 0));
   483                   f.Add(new Fan("CPU Fan", 1));
   484                   f.Add(new Fan("Power Fan", 2));
   485                   f.Add(new Fan("Chassis Fan #2", 3));
   486                   f.Add(new Fan("Chassis Fan #3", 4));
   487                   break;
   488                 case Model.Rampage_Extreme: // W83667HG 
   489                   v.Add(new Voltage("CPU VCore", 0));
   490                   v.Add(new Voltage("+12V", 1, 12, 2, 0));
   491                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
   492                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   493                   v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
   494                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   495                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   496                   t.Add(new Temperature("CPU", 0));
   497                   t.Add(new Temperature("Motherboard", 2));
   498                   f.Add(new Fan("Chassis Fan #1", 0));
   499                   f.Add(new Fan("CPU Fan", 1));
   500                   f.Add(new Fan("Power Fan", 2));
   501                   f.Add(new Fan("Chassis Fan #2", 3));
   502                   f.Add(new Fan("Chassis Fan #3", 4));
   503                   break;
   504                 default:
   505                   v.Add(new Voltage("CPU VCore", 0));
   506                   v.Add(new Voltage("Voltage #2", 1, true));
   507                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   508                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   509                   v.Add(new Voltage("Voltage #5", 4, true));
   510                   v.Add(new Voltage("Voltage #6", 5, true));
   511                   v.Add(new Voltage("Voltage #7", 6, true));
   512                   v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   513                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   514                   t.Add(new Temperature("CPU", 0));
   515                   t.Add(new Temperature("Auxiliary", 1));
   516                   t.Add(new Temperature("System", 2));
   517                   f.Add(new Fan("System Fan", 0));
   518                   f.Add(new Fan("CPU Fan", 1));
   519                   f.Add(new Fan("Auxiliary Fan", 2));
   520                   f.Add(new Fan("CPU Fan #2", 3));
   521                   f.Add(new Fan("Auxiliary Fan #2", 4));
   522                   break;
   523               }
   524               break;
   525             default:
   526               v.Add(new Voltage("CPU VCore", 0));
   527               v.Add(new Voltage("Voltage #2", 1, true));
   528               v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   529               v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   530               v.Add(new Voltage("Voltage #5", 4, true));
   531               v.Add(new Voltage("Voltage #6", 5, true));
   532               v.Add(new Voltage("Voltage #7", 6, true));
   533               v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   534               v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   535               t.Add(new Temperature("CPU", 0));
   536               t.Add(new Temperature("Auxiliary", 1));
   537               t.Add(new Temperature("System", 2));
   538               f.Add(new Fan("System Fan", 0));
   539               f.Add(new Fan("CPU Fan", 1));
   540               f.Add(new Fan("Auxiliary Fan", 2));
   541               f.Add(new Fan("CPU Fan #2", 3));
   542               f.Add(new Fan("Auxiliary Fan #2", 4));
   543               break;
   544           } 
   545           break;
   546         case Chip.W83627HF: 
   547         case Chip.W83627THF: 
   548         case Chip.W83687THF:
   549           v.Add(new Voltage("CPU VCore", 0));
   550           v.Add(new Voltage("Voltage #2", 1, true));
   551           v.Add(new Voltage("Voltage #3", 2, true));
   552           v.Add(new Voltage("AVCC", 3, 34, 51, 0));
   553           v.Add(new Voltage("Voltage #5", 4, true));
   554           v.Add(new Voltage("5VSB", 5, 34, 51, 0));
   555           v.Add(new Voltage("VBAT", 6));
   556           t.Add(new Temperature("CPU", 0));
   557           t.Add(new Temperature("Auxiliary", 1));
   558           t.Add(new Temperature("System", 2));
   559           f.Add(new Fan("System Fan", 0));
   560           f.Add(new Fan("CPU Fan", 1));
   561           f.Add(new Fan("Auxiliary Fan", 2));
   562           break;
   563         default:
   564           for (int i = 0; i < superIO.Voltages.Length; i++)
   565             v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   566           for (int i = 0; i < superIO.Temperatures.Length; i++)
   567             t.Add(new Temperature("Temperature #" + (i + 1), i));
   568           for (int i = 0; i < superIO.Fans.Length; i++)
   569             f.Add(new Fan("Fan #" + (i + 1), i));
   570           break;
   571       }
   572 
   573       string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   574       foreach (Voltage voltage in v) 
   575         if (voltage.Index < superIO.Voltages.Length) {
   576           Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   577             voltage.Hidden, SensorType.Voltage, this, 
   578             new ParameterDescription[] {
   579             new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   580               formula, voltage.Ri),
   581             new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   582               formula, voltage.Rf),
   583             new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   584               formula, voltage.Vf)
   585             }, settings);
   586           voltages.Add(sensor);
   587       }
   588 
   589       foreach (Temperature temperature in t) 
   590         if (temperature.Index < superIO.Temperatures.Length) {
   591         Sensor sensor = new Sensor(temperature.Name, temperature.Index,
   592           SensorType.Temperature, this, new ParameterDescription[] {
   593           new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   594         }, settings);
   595         temperatures.Add(sensor);
   596       }
   597 
   598       foreach (Fan fan in f)
   599         if (fan.Index < superIO.Fans.Length) {
   600           Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
   601             this, settings);
   602           fans.Add(sensor);
   603         }
   604     }
   605 
   606     public override Identifier Identifier {
   607       get { 
   608         return new Identifier("lpc", 
   609           superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)); 
   610       }
   611     }
   612 
   613     public override HardwareType HardwareType {
   614       get { return HardwareType.SuperIO; }
   615     }
   616 
   617     public override string Name {
   618       get { return name; }
   619     }
   620 
   621     public override string GetReport() {
   622       return superIO.GetReport();
   623     }
   624 
   625     public override void Update() {
   626       superIO.Update();
   627 
   628       foreach (Sensor sensor in voltages) {
   629         float? value = superIO.Voltages[sensor.Index];
   630         if (value.HasValue) {
   631           sensor.Value = value + (value - sensor.Parameters[2].Value) *
   632             sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   633           ActivateSensor(sensor);
   634         }
   635       }
   636 
   637       foreach (Sensor sensor in temperatures) {
   638         float? value = superIO.Temperatures[sensor.Index];
   639         if (value.HasValue) {
   640           sensor.Value = value + sensor.Parameters[0].Value;
   641           ActivateSensor(sensor);
   642         }
   643       }
   644 
   645       foreach (Sensor sensor in fans) {
   646         float? value = superIO.Fans[sensor.Index];
   647         if (value.HasValue) {
   648           sensor.Value = value;
   649           if (value.Value > 0)
   650             ActivateSensor(sensor);
   651         }
   652       }
   653     }
   654 
   655     private class Voltage {
   656       public readonly string Name;
   657       public readonly int Index;
   658       public readonly float Ri;
   659       public readonly float Rf;
   660       public readonly float Vf;
   661       public readonly bool Hidden;
   662 
   663       public Voltage(string name, int index) :
   664         this(name, index, 0, 1, 0, false) { }
   665 
   666       public Voltage(string name, int index, bool hidden) :
   667         this(name, index, 0, 1, 0, hidden) { }
   668 
   669       public Voltage(string name, int index, float ri, float rf, float vf) :
   670         this(name, index, ri, rf, vf, false) { }
   671 
   672       public Voltage(string name, int index, float ri, float rf, float vf,
   673         bool hidden) {
   674         this.Name = name;
   675         this.Index = index;
   676         this.Ri = ri;
   677         this.Rf = rf;
   678         this.Vf = vf;
   679         this.Hidden = hidden;
   680       }
   681     }
   682 
   683     private class Temperature {
   684       public readonly string Name;
   685       public readonly int Index;
   686 
   687       public Temperature(string name, int index) {
   688         this.Name = name;
   689         this.Index = index;
   690       }
   691     }
   692 
   693     private class Fan {
   694       public readonly string Name;
   695       public readonly int Index;
   696 
   697       public Fan(string name, int index) {
   698         this.Name = name;
   699         this.Index = index;
   700       }
   701     }
   702   }
   703 }