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