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