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