Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Sun, 15 Aug 2010 17:56:57 +0000
changeset 168 7f90baeb96b0
parent 167 b7cc9d09aefe
child 170 31858ba46e9c
permissions -rw-r--r--
Fixed Issue 104.
     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.F71858:
   324           v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   325           v.Add(new Voltage("VSB3V", 1, 150, 150, 0));
   326           v.Add(new Voltage("Battery", 2, 150, 150, 0));
   327           for (int i = 0; i < superIO.Temperatures.Length; i++)
   328             t.Add(new Temperature("Temperature #" + (i + 1), i));
   329           for (int i = 0; i < superIO.Fans.Length; i++)
   330             f.Add(new Fan("Fan #" + (i + 1), i));
   331           break;
   332         case Chip.F71862: 
   333         case Chip.F71869: 
   334         case Chip.F71882:
   335         case Chip.F71889ED: 
   336         case Chip.F71889F:
   337           switch (manufacturer) {
   338             case Manufacturer.EVGA:
   339               switch (model) {
   340                 case Model.X58_SLI_Classified: // F71882 
   341                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   342                   v.Add(new Voltage("CPU VCore", 1, 47, 100, 0));
   343                   v.Add(new Voltage("DIMM", 2, 47, 100, 0));
   344                   v.Add(new Voltage("CPU VTT", 3, 24, 100, 0));
   345                   v.Add(new Voltage("IOH Vcore", 4, 24, 100, 0));
   346                   v.Add(new Voltage("+5V", 5, 51, 12, 0));
   347                   v.Add(new Voltage("+12V", 6, 56, 6.8f, 0));
   348                   v.Add(new Voltage("3VSB", 7, 150, 150, 0));
   349                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   350                   t.Add(new Temperature("CPU", 0));
   351                   t.Add(new Temperature("VREG", 1));
   352                   t.Add(new Temperature("System", 2));
   353                   f.Add(new Fan("CPU Fan", 0));
   354                   f.Add(new Fan("Power Fan", 1));
   355                   f.Add(new Fan("Chassis Fan", 2));
   356                   break;
   357                 default:
   358                   v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   359                   v.Add(new Voltage("CPU VCore", 1));
   360                   v.Add(new Voltage("Voltage #3", 2, true));
   361                   v.Add(new Voltage("Voltage #4", 3, true));
   362                   v.Add(new Voltage("Voltage #5", 4, true));
   363                   v.Add(new Voltage("Voltage #6", 5, true));
   364                   v.Add(new Voltage("Voltage #7", 6, true));
   365                   v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   366                   v.Add(new Voltage("VBat", 8, 150, 150, 0));
   367                   for (int i = 0; i < superIO.Temperatures.Length; i++)
   368                     t.Add(new Temperature("Temperature #" + (i + 1), i));
   369                   for (int i = 0; i < superIO.Fans.Length; i++)
   370                     f.Add(new Fan("Fan #" + (i + 1), i));
   371                   break;
   372               }
   373               break;
   374             default:
   375               v.Add(new Voltage("VCC3V", 0, 150, 150, 0));
   376               v.Add(new Voltage("CPU VCore", 1));
   377               v.Add(new Voltage("Voltage #3", 2, true));
   378               v.Add(new Voltage("Voltage #4", 3, true));
   379               v.Add(new Voltage("Voltage #5", 4, true));
   380               v.Add(new Voltage("Voltage #6", 5, true));
   381               v.Add(new Voltage("Voltage #7", 6, true));
   382               v.Add(new Voltage("VSB3V", 7, 150, 150, 0));
   383               v.Add(new Voltage("VBat", 8, 150, 150, 0));
   384               for (int i = 0; i < superIO.Temperatures.Length; i++)
   385                 t.Add(new Temperature("Temperature #" + (i + 1), i));
   386               for (int i = 0; i < superIO.Fans.Length; i++)
   387                 f.Add(new Fan("Fan #" + (i + 1), i));
   388               break;
   389           }
   390           break;
   391 
   392         case Chip.W83627EHF:          
   393           v.Add(new Voltage("CPU VCore", 0));
   394           v.Add(new Voltage("Voltage #2", 1, true));
   395           v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   396           v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   397           v.Add(new Voltage("Voltage #5", 4, true));
   398           v.Add(new Voltage("Voltage #6", 5, true));
   399           v.Add(new Voltage("Voltage #7", 6, true));
   400           v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   401           v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   402           v.Add(new Voltage("Voltage #10", 9, true));
   403           t.Add(new Temperature("CPU", 0));
   404           t.Add(new Temperature("Auxiliary", 1));
   405           t.Add(new Temperature("System", 2));
   406           f.Add(new Fan("System Fan", 0));
   407           f.Add(new Fan("CPU Fan", 1));
   408           f.Add(new Fan("Auxiliary Fan", 2));
   409           f.Add(new Fan("CPU Fan #2", 3));
   410           f.Add(new Fan("Auxiliary Fan #2", 4));
   411           break;
   412         case Chip.W83627DHG: 
   413         case Chip.W83627DHGP:                      
   414         case Chip.W83667HG:
   415         case Chip.W83667HGB:
   416           switch (manufacturer) {
   417             case Manufacturer.ASRock:
   418               switch (model) {
   419                 case Model._880GMH_USB3: // W83627DHG-P
   420                   v.Add(new Voltage("CPU VCore", 0));
   421                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   422                   v.Add(new Voltage("+5V", 5, 15, 7.5f, 0));
   423                   v.Add(new Voltage("+12V", 6, 56, 10, 0));
   424                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   425                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   426                   t.Add(new Temperature("CPU", 0));
   427                   t.Add(new Temperature("Motherboard", 2));
   428                   f.Add(new Fan("Chassis Fan", 0));
   429                   f.Add(new Fan("CPU Fan", 1));
   430                   f.Add(new Fan("Power Fan", 2));
   431                   break;
   432                 default:
   433                   v.Add(new Voltage("CPU VCore", 0));
   434                   v.Add(new Voltage("Voltage #2", 1, true));
   435                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   436                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   437                   v.Add(new Voltage("Voltage #5", 4, true));
   438                   v.Add(new Voltage("Voltage #6", 5, true));
   439                   v.Add(new Voltage("Voltage #7", 6, true));
   440                   v.Add(new Voltage("3VSB", 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("Auxiliary", 1));
   444                   t.Add(new Temperature("System", 2));
   445                   f.Add(new Fan("System Fan", 0));
   446                   f.Add(new Fan("CPU Fan", 1));
   447                   f.Add(new Fan("Auxiliary Fan", 2));
   448                   f.Add(new Fan("CPU Fan #2", 3));
   449                   f.Add(new Fan("Auxiliary Fan #2", 4));
   450                   break;
   451               }
   452               break;
   453             case Manufacturer.ASUS:
   454               switch (model) {
   455                 case Model.P6X58D_E: // W83667HG 
   456                   v.Add(new Voltage("CPU VCore", 0));
   457                   v.Add(new Voltage("+12V", 1, 11.5f, 1.91f, 0));
   458                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34, 0));
   459                   v.Add(new Voltage("+3.3V", 3, 34, 34, 0));
   460                   v.Add(new Voltage("+5V", 4, 15, 7.5f, 0));
   461                   v.Add(new Voltage("Voltage #6", 5, true));
   462                   v.Add(new Voltage("Voltage #7", 6, true));
   463                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34, 0));
   464                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   465                   t.Add(new Temperature("CPU", 0));
   466                   t.Add(new Temperature("Motherboard", 2));
   467                   f.Add(new Fan("Chassis Fan #1", 0));
   468                   f.Add(new Fan("CPU Fan", 1));
   469                   f.Add(new Fan("Power Fan", 2));
   470                   f.Add(new Fan("Chassis Fan #2", 3));
   471                   f.Add(new Fan("Chassis Fan #3", 4));
   472                   break;
   473                 default:
   474                   v.Add(new Voltage("CPU VCore", 0));
   475                   v.Add(new Voltage("Voltage #2", 1, true));
   476                   v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   477                   v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   478                   v.Add(new Voltage("Voltage #5", 4, true));
   479                   v.Add(new Voltage("Voltage #6", 5, true));
   480                   v.Add(new Voltage("Voltage #7", 6, true));
   481                   v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   482                   v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   483                   t.Add(new Temperature("CPU", 0));
   484                   t.Add(new Temperature("Auxiliary", 1));
   485                   t.Add(new Temperature("System", 2));
   486                   f.Add(new Fan("System Fan", 0));
   487                   f.Add(new Fan("CPU Fan", 1));
   488                   f.Add(new Fan("Auxiliary Fan", 2));
   489                   f.Add(new Fan("CPU Fan #2", 3));
   490                   f.Add(new Fan("Auxiliary Fan #2", 4));
   491                   break;
   492               }
   493               break;
   494             default:
   495               v.Add(new Voltage("CPU VCore", 0));
   496               v.Add(new Voltage("Voltage #2", 1, true));
   497               v.Add(new Voltage("AVCC", 2, 34, 34, 0));
   498               v.Add(new Voltage("3VCC", 3, 34, 34, 0));
   499               v.Add(new Voltage("Voltage #5", 4, true));
   500               v.Add(new Voltage("Voltage #6", 5, true));
   501               v.Add(new Voltage("Voltage #7", 6, true));
   502               v.Add(new Voltage("3VSB", 7, 34, 34, 0));
   503               v.Add(new Voltage("VBAT", 8, 34, 34, 0));
   504               t.Add(new Temperature("CPU", 0));
   505               t.Add(new Temperature("Auxiliary", 1));
   506               t.Add(new Temperature("System", 2));
   507               f.Add(new Fan("System Fan", 0));
   508               f.Add(new Fan("CPU Fan", 1));
   509               f.Add(new Fan("Auxiliary Fan", 2));
   510               f.Add(new Fan("CPU Fan #2", 3));
   511               f.Add(new Fan("Auxiliary Fan #2", 4));
   512               break;
   513           } 
   514           break;
   515         case Chip.W83627HF: 
   516         case Chip.W83627THF: 
   517         case Chip.W83687THF:
   518           v.Add(new Voltage("CPU VCore", 0));
   519           v.Add(new Voltage("Voltage #2", 1, true));
   520           v.Add(new Voltage("Voltage #3", 2, true));
   521           v.Add(new Voltage("AVCC", 3, 34, 51, 0));
   522           v.Add(new Voltage("Voltage #5", 4, true));
   523           v.Add(new Voltage("5VSB", 5, 34, 51, 0));
   524           v.Add(new Voltage("VBAT", 6));
   525           t.Add(new Temperature("CPU", 0));
   526           t.Add(new Temperature("Auxiliary", 1));
   527           t.Add(new Temperature("System", 2));
   528           f.Add(new Fan("System Fan", 0));
   529           f.Add(new Fan("CPU Fan", 1));
   530           f.Add(new Fan("Auxiliary Fan", 2));
   531           break;
   532         default:
   533           for (int i = 0; i < superIO.Voltages.Length; i++)
   534             v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   535           for (int i = 0; i < superIO.Temperatures.Length; i++)
   536             t.Add(new Temperature("Temperature #" + (i + 1), i));
   537           for (int i = 0; i < superIO.Fans.Length; i++)
   538             f.Add(new Fan("Fan #" + (i + 1), i));
   539           break;
   540       }
   541 
   542       string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   543       foreach (Voltage voltage in v) 
   544         if (voltage.Index < superIO.Voltages.Length) {
   545           Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   546             voltage.Hidden, SensorType.Voltage, this, 
   547             new ParameterDescription[] {
   548             new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   549               formula, voltage.Ri),
   550             new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   551               formula, voltage.Rf),
   552             new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   553               formula, voltage.Vf)
   554             }, settings);
   555           voltages.Add(sensor);
   556       }
   557 
   558       foreach (Temperature temperature in t) 
   559         if (temperature.Index < superIO.Temperatures.Length) {
   560         Sensor sensor = new Sensor(temperature.Name, temperature.Index,
   561           SensorType.Temperature, this, new ParameterDescription[] {
   562           new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   563         }, settings);
   564         temperatures.Add(sensor);
   565       }
   566 
   567       foreach (Fan fan in f)
   568         if (fan.Index < superIO.Fans.Length) {
   569           Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
   570             this, settings);
   571           fans.Add(sensor);
   572         }
   573     }
   574 
   575     public override Identifier Identifier {
   576       get { 
   577         return new Identifier("lpc", 
   578           superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)); 
   579       }
   580     }
   581 
   582     public override HardwareType HardwareType {
   583       get { return HardwareType.SuperIO; }
   584     }
   585 
   586     public override string Name {
   587       get { return name; }
   588     }
   589 
   590     public override string GetReport() {
   591       return superIO.GetReport();
   592     }
   593 
   594     public override void Update() {
   595       superIO.Update();
   596 
   597       foreach (Sensor sensor in voltages) {
   598         float? value = superIO.Voltages[sensor.Index];
   599         if (value.HasValue) {
   600           sensor.Value = value + (value - sensor.Parameters[2].Value) *
   601             sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   602           ActivateSensor(sensor);
   603         }
   604       }
   605 
   606       foreach (Sensor sensor in temperatures) {
   607         float? value = superIO.Temperatures[sensor.Index];
   608         if (value.HasValue) {
   609           sensor.Value = value + sensor.Parameters[0].Value;
   610           ActivateSensor(sensor);
   611         }
   612       }
   613 
   614       foreach (Sensor sensor in fans) {
   615         float? value = superIO.Fans[sensor.Index];
   616         if (value.HasValue) {
   617           sensor.Value = value;
   618           if (value.Value > 0)
   619             ActivateSensor(sensor);
   620         }
   621       }
   622     }
   623 
   624     private class Voltage {
   625       public readonly string Name;
   626       public readonly int Index;
   627       public readonly float Ri;
   628       public readonly float Rf;
   629       public readonly float Vf;
   630       public readonly bool Hidden;
   631 
   632       public Voltage(string name, int index) :
   633         this(name, index, 0, 1, 0, false) { }
   634 
   635       public Voltage(string name, int index, bool hidden) :
   636         this(name, index, 0, 1, 0, hidden) { }
   637 
   638       public Voltage(string name, int index, float ri, float rf, float vf) :
   639         this(name, index, ri, rf, vf, false) { }
   640 
   641       public Voltage(string name, int index, float ri, float rf, float vf,
   642         bool hidden) {
   643         this.Name = name;
   644         this.Index = index;
   645         this.Ri = ri;
   646         this.Rf = rf;
   647         this.Vf = vf;
   648         this.Hidden = hidden;
   649       }
   650     }
   651 
   652     private class Temperature {
   653       public readonly string Name;
   654       public readonly int Index;
   655 
   656       public Temperature(string name, int index) {
   657         this.Name = name;
   658         this.Index = index;
   659       }
   660     }
   661 
   662     private class Fan {
   663       public readonly string Name;
   664       public readonly int Index;
   665 
   666       public Fan(string name, int index) {
   667         this.Name = name;
   668         this.Index = index;
   669       }
   670     }
   671   }
   672 }