Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Mon, 11 Oct 2010 20:37:37 +0000
changeset 220 e51749b206ee
parent 202 551243a66b32
child 221 a950ba30d4dd
permissions -rw-r--r--
Added a mainboard specific configuration for the ASRock AOD790GX-128M
     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 readonly Mainboard mainboard;
    46     private readonly ISuperIO superIO;
    47     private readonly string name;
    48 
    49     private readonly List<Sensor> voltages = new List<Sensor>();
    50     private readonly List<Sensor> temperatures = new List<Sensor>();
    51     private readonly 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));
    84                   v.Add(new Voltage("+12V", 4, 30, 10));
    85                   v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
    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));
    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));
   126                   v.Add(new Voltage("+12V", 4, 30, 10));
   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));
   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));
   143                   v.Add(new Voltage("+12V", 4, 30, 10));
   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));
   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));
   180                   v.Add(new Voltage("+12V", 7, 27, 9.1f));
   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));
   194                   v.Add(new Voltage("+12V", 7, 27, 9.1f));
   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));
   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));
   222                   v.Add(new Voltage("+12V", 7, 27, 9.1f));
   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));
   237                   v.Add(new Voltage("+12V", 5, 27, 9.1f));
   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));
   251                   v.Add(new Voltage("+12V", 4, 27, 9.1f));
   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));
   265                   v.Add(new Voltage("+12V", 4, 27, 9.1f));
   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));
   278                   v.Add(new Voltage("+12V", 5, 27, 9.1f));
   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));
   333                   // v.Add(new Voltage("VDIMM", 6, true));
   334                   v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
   335                   v.Add(new Voltage("VBat", 8, 10, 10));
   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));
   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));
   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));
   380           v.Add(new Voltage("VSB3V", 1, 150, 150));
   381           v.Add(new Voltage("Battery", 2, 150, 150));
   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));
   397                   v.Add(new Voltage("CPU VCore", 1, 47, 100));
   398                   v.Add(new Voltage("DIMM", 2, 47, 100));
   399                   v.Add(new Voltage("CPU VTT", 3, 24, 100));
   400                   v.Add(new Voltage("IOH Vcore", 4, 24, 100));
   401                   v.Add(new Voltage("+5V", 5, 51, 12));
   402                   v.Add(new Voltage("+12V", 6, 56, 6.8f));
   403                   v.Add(new Voltage("3VSB", 7, 150, 150));
   404                   v.Add(new Voltage("VBat", 8, 150, 150));
   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));
   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));
   421                   v.Add(new Voltage("VBat", 8, 150, 150));
   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));
   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));
   438               v.Add(new Voltage("VBat", 8, 150, 150));
   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           switch (manufacturer) {
   449             case Manufacturer.ASRock:
   450               switch (model) {
   451                 case Model.AOD790GX_128M: // W83627EHF
   452                   v.Add(new Voltage("CPU VCore", 0));
   453                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
   454                   v.Add(new Voltage("+3.3V", 4, 10, 10));
   455                   v.Add(new Voltage("+5V", 5, 20, 10));
   456                   v.Add(new Voltage("+12V", 6, 28, 5));
   457                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
   458                   v.Add(new Voltage("VBAT", 8, 34, 34));
   459                   t.Add(new Temperature("CPU", 0));
   460                   t.Add(new Temperature("Motherboard", 2));
   461                   f.Add(new Fan("Chassis Fan", 0));
   462                   f.Add(new Fan("CPU Fan", 1));
   463                   f.Add(new Fan("NB Fan", 2));
   464                   f.Add(new Fan("Power Fan", 4));
   465                   break;
   466                 default:
   467                   v.Add(new Voltage("CPU VCore", 0));
   468                   v.Add(new Voltage("Voltage #2", 1, true));
   469                   v.Add(new Voltage("AVCC", 2, 34, 34));
   470                   v.Add(new Voltage("3VCC", 3, 34, 34));
   471                   v.Add(new Voltage("Voltage #5", 4, true));
   472                   v.Add(new Voltage("Voltage #6", 5, true));
   473                   v.Add(new Voltage("Voltage #7", 6, true));
   474                   v.Add(new Voltage("3VSB", 7, 34, 34));
   475                   v.Add(new Voltage("VBAT", 8, 34, 34));
   476                   v.Add(new Voltage("Voltage #10", 9, true));
   477                   t.Add(new Temperature("CPU", 0));
   478                   t.Add(new Temperature("Auxiliary", 1));
   479                   t.Add(new Temperature("System", 2));
   480                   f.Add(new Fan("System Fan", 0));
   481                   f.Add(new Fan("CPU Fan", 1));
   482                   f.Add(new Fan("Auxiliary Fan", 2));
   483                   f.Add(new Fan("CPU Fan #2", 3));
   484                   f.Add(new Fan("Auxiliary Fan #2", 4));
   485                   break;
   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));
   491               v.Add(new Voltage("3VCC", 3, 34, 34));
   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));
   496               v.Add(new Voltage("VBAT", 8, 34, 34));
   497               v.Add(new Voltage("Voltage #10", 9, true));
   498               t.Add(new Temperature("CPU", 0));
   499               t.Add(new Temperature("Auxiliary", 1));
   500               t.Add(new Temperature("System", 2));
   501               f.Add(new Fan("System Fan", 0));
   502               f.Add(new Fan("CPU Fan", 1));
   503               f.Add(new Fan("Auxiliary Fan", 2));
   504               f.Add(new Fan("CPU Fan #2", 3));
   505               f.Add(new Fan("Auxiliary Fan #2", 4));
   506               break;
   507           }
   508           break;
   509         case Chip.W83627DHG: 
   510         case Chip.W83627DHGP:                      
   511         case Chip.W83667HG:
   512         case Chip.W83667HGB:
   513           switch (manufacturer) {
   514             case Manufacturer.ASRock:
   515               switch (model) {
   516                 case Model._880GMH_USB3: // W83627DHG-P
   517                   v.Add(new Voltage("CPU VCore", 0));
   518                   v.Add(new Voltage("+3.3V", 3, 34, 34));
   519                   v.Add(new Voltage("+5V", 5, 15, 7.5f));
   520                   v.Add(new Voltage("+12V", 6, 56, 10));
   521                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
   522                   v.Add(new Voltage("VBAT", 8, 34, 34));
   523                   t.Add(new Temperature("CPU", 0));
   524                   t.Add(new Temperature("Motherboard", 2));
   525                   f.Add(new Fan("Chassis Fan", 0));
   526                   f.Add(new Fan("CPU Fan", 1));
   527                   f.Add(new Fan("Power Fan", 2));
   528                   break;
   529                 default:
   530                   v.Add(new Voltage("CPU VCore", 0));
   531                   v.Add(new Voltage("Voltage #2", 1, true));
   532                   v.Add(new Voltage("AVCC", 2, 34, 34));
   533                   v.Add(new Voltage("3VCC", 3, 34, 34));
   534                   v.Add(new Voltage("Voltage #5", 4, true));
   535                   v.Add(new Voltage("Voltage #6", 5, true));
   536                   v.Add(new Voltage("Voltage #7", 6, true));
   537                   v.Add(new Voltage("3VSB", 7, 34, 34));
   538                   v.Add(new Voltage("VBAT", 8, 34, 34));
   539                   t.Add(new Temperature("CPU", 0));
   540                   t.Add(new Temperature("Auxiliary", 1));
   541                   t.Add(new Temperature("System", 2));
   542                   f.Add(new Fan("System Fan", 0));
   543                   f.Add(new Fan("CPU Fan", 1));
   544                   f.Add(new Fan("Auxiliary Fan", 2));
   545                   f.Add(new Fan("CPU Fan #2", 3));
   546                   f.Add(new Fan("Auxiliary Fan #2", 4));
   547                   break;
   548               }
   549               break;
   550             case Manufacturer.ASUS:
   551               switch (model) {
   552                 case Model.P6X58D_E: // W83667HG                 
   553                 case Model.Rampage_II_GENE: // W83667HG 
   554                   v.Add(new Voltage("CPU VCore", 0));
   555                   v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
   556                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
   557                   v.Add(new Voltage("+3.3V", 3, 34, 34));
   558                   v.Add(new Voltage("+5V", 4, 15, 7.5f));
   559                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
   560                   v.Add(new Voltage("VBAT", 8, 34, 34));
   561                   t.Add(new Temperature("CPU", 0));
   562                   t.Add(new Temperature("Motherboard", 2));
   563                   f.Add(new Fan("Chassis Fan #1", 0));
   564                   f.Add(new Fan("CPU Fan", 1));
   565                   f.Add(new Fan("Power Fan", 2));
   566                   f.Add(new Fan("Chassis Fan #2", 3));
   567                   f.Add(new Fan("Chassis Fan #3", 4));
   568                   break;
   569                 case Model.Rampage_Extreme: // W83667HG 
   570                   v.Add(new Voltage("CPU VCore", 0));
   571                   v.Add(new Voltage("+12V", 1, 12, 2));
   572                   v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
   573                   v.Add(new Voltage("+3.3V", 3, 34, 34));
   574                   v.Add(new Voltage("+5V", 4, 15, 7.5f));
   575                   v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
   576                   v.Add(new Voltage("VBAT", 8, 34, 34));
   577                   t.Add(new Temperature("CPU", 0));
   578                   t.Add(new Temperature("Motherboard", 2));
   579                   f.Add(new Fan("Chassis Fan #1", 0));
   580                   f.Add(new Fan("CPU Fan", 1));
   581                   f.Add(new Fan("Power Fan", 2));
   582                   f.Add(new Fan("Chassis Fan #2", 3));
   583                   f.Add(new Fan("Chassis Fan #3", 4));
   584                   break;
   585                 default:
   586                   v.Add(new Voltage("CPU VCore", 0));
   587                   v.Add(new Voltage("Voltage #2", 1, true));
   588                   v.Add(new Voltage("AVCC", 2, 34, 34));
   589                   v.Add(new Voltage("3VCC", 3, 34, 34));
   590                   v.Add(new Voltage("Voltage #5", 4, true));
   591                   v.Add(new Voltage("Voltage #6", 5, true));
   592                   v.Add(new Voltage("Voltage #7", 6, true));
   593                   v.Add(new Voltage("3VSB", 7, 34, 34));
   594                   v.Add(new Voltage("VBAT", 8, 34, 34));
   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                   f.Add(new Fan("CPU Fan #2", 3));
   602                   f.Add(new Fan("Auxiliary Fan #2", 4));
   603                   break;
   604               }
   605               break;
   606             default:
   607               v.Add(new Voltage("CPU VCore", 0));
   608               v.Add(new Voltage("Voltage #2", 1, true));
   609               v.Add(new Voltage("AVCC", 2, 34, 34));
   610               v.Add(new Voltage("3VCC", 3, 34, 34));
   611               v.Add(new Voltage("Voltage #5", 4, true));
   612               v.Add(new Voltage("Voltage #6", 5, true));
   613               v.Add(new Voltage("Voltage #7", 6, true));
   614               v.Add(new Voltage("3VSB", 7, 34, 34));
   615               v.Add(new Voltage("VBAT", 8, 34, 34));
   616               t.Add(new Temperature("CPU", 0));
   617               t.Add(new Temperature("Auxiliary", 1));
   618               t.Add(new Temperature("System", 2));
   619               f.Add(new Fan("System Fan", 0));
   620               f.Add(new Fan("CPU Fan", 1));
   621               f.Add(new Fan("Auxiliary Fan", 2));
   622               f.Add(new Fan("CPU Fan #2", 3));
   623               f.Add(new Fan("Auxiliary Fan #2", 4));
   624               break;
   625           } 
   626           break;
   627         case Chip.W83627HF: 
   628         case Chip.W83627THF: 
   629         case Chip.W83687THF:
   630           v.Add(new Voltage("CPU VCore", 0));
   631           v.Add(new Voltage("Voltage #2", 1, true));
   632           v.Add(new Voltage("Voltage #3", 2, true));
   633           v.Add(new Voltage("AVCC", 3, 34, 51));
   634           v.Add(new Voltage("Voltage #5", 4, true));
   635           v.Add(new Voltage("5VSB", 5, 34, 51));
   636           v.Add(new Voltage("VBAT", 6));
   637           t.Add(new Temperature("CPU", 0));
   638           t.Add(new Temperature("Auxiliary", 1));
   639           t.Add(new Temperature("System", 2));
   640           f.Add(new Fan("System Fan", 0));
   641           f.Add(new Fan("CPU Fan", 1));
   642           f.Add(new Fan("Auxiliary Fan", 2));
   643           break;
   644         default:
   645           for (int i = 0; i < superIO.Voltages.Length; i++)
   646             v.Add(new Voltage("Voltage #" + (i + 1), i, true));
   647           for (int i = 0; i < superIO.Temperatures.Length; i++)
   648             t.Add(new Temperature("Temperature #" + (i + 1), i));
   649           for (int i = 0; i < superIO.Fans.Length; i++)
   650             f.Add(new Fan("Fan #" + (i + 1), i));
   651           break;
   652       }
   653 
   654       const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
   655       foreach (Voltage voltage in v) 
   656         if (voltage.Index < superIO.Voltages.Length) {
   657           Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
   658             voltage.Hidden, SensorType.Voltage, this, new [] {
   659             new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
   660               formula, voltage.Ri),
   661             new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
   662               formula, voltage.Rf),
   663             new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
   664               formula, voltage.Vf)
   665             }, settings);
   666           voltages.Add(sensor);
   667       }
   668 
   669       foreach (Temperature temperature in t) 
   670         if (temperature.Index < superIO.Temperatures.Length) {
   671         Sensor sensor = new Sensor(temperature.Name, temperature.Index,
   672           SensorType.Temperature, this, new [] {
   673           new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
   674         }, settings);
   675         temperatures.Add(sensor);
   676       }
   677 
   678       foreach (Fan fan in f)
   679         if (fan.Index < superIO.Fans.Length) {
   680           Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
   681             this, settings);
   682           fans.Add(sensor);
   683         }
   684     }
   685 
   686     public override Identifier Identifier {
   687       get { 
   688         return new Identifier("lpc", 
   689           superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)); 
   690       }
   691     }
   692 
   693     public override HardwareType HardwareType {
   694       get { return HardwareType.SuperIO; }
   695     }
   696 
   697     public override IHardware Parent {
   698       get { return mainboard; }
   699     }
   700 
   701     public override string Name {
   702       get { return name; }
   703     }
   704 
   705     public override string GetReport() {
   706       return superIO.GetReport();
   707     }
   708 
   709     public override void Update() {
   710       superIO.Update();
   711 
   712       foreach (Sensor sensor in voltages) {
   713         float? value = superIO.Voltages[sensor.Index];
   714         if (value.HasValue) {
   715           sensor.Value = value + (value - sensor.Parameters[2].Value) *
   716             sensor.Parameters[0].Value / sensor.Parameters[1].Value;
   717           ActivateSensor(sensor);
   718         }
   719       }
   720 
   721       foreach (Sensor sensor in temperatures) {
   722         float? value = superIO.Temperatures[sensor.Index];
   723         if (value.HasValue) {
   724           sensor.Value = value + sensor.Parameters[0].Value;
   725           ActivateSensor(sensor);
   726         }
   727       }
   728 
   729       foreach (Sensor sensor in fans) {
   730         float? value = superIO.Fans[sensor.Index];
   731         if (value.HasValue) {
   732           sensor.Value = value;
   733           if (value.Value > 0)
   734             ActivateSensor(sensor);
   735         }
   736       }
   737     }
   738 
   739     private class Voltage {
   740       public readonly string Name;
   741       public readonly int Index;
   742       public readonly float Ri;
   743       public readonly float Rf;
   744       public readonly float Vf;
   745       public readonly bool Hidden;
   746 
   747       public Voltage(string name, int index) :
   748         this(name, index, false) { }
   749       
   750       public Voltage(string name, int index, bool hidden) :
   751         this(name, index, 0, 1, 0, hidden) { }
   752       
   753       public Voltage(string name, int index, float ri, float rf) :
   754         this(name, index, ri, rf, 0, false) { }
   755       
   756       // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) 
   757       
   758       public Voltage(string name, int index, 
   759         float ri, float rf, float vf, bool hidden) 
   760       {
   761         this.Name = name;
   762         this.Index = index;
   763         this.Ri = ri;
   764         this.Rf = rf;
   765         this.Vf = vf;
   766         this.Hidden = hidden;
   767       }
   768     }
   769 
   770     private class Temperature {
   771       public readonly string Name;
   772       public readonly int Index;
   773 
   774       public Temperature(string name, int index) {
   775         this.Name = name;
   776         this.Index = index;
   777       }
   778     }
   779 
   780     private class Fan {
   781       public readonly string Name;
   782       public readonly int Index;
   783 
   784       public Fan(string name, int index) {
   785         this.Name = name;
   786         this.Index = index;
   787       }
   788     }
   789   }
   790 }