Hardware/Mainboard/SuperIOHardware.cs
author moel.mich
Sat, 06 Aug 2011 17:27:55 +0000
changeset 320 df3493f75225
parent 319 35cda448fc5f
child 323 3f2d9ebacf38
permissions -rw-r--r--
Added Added a mainboard specific configuration for the Shuttle SH67Hx barebones. Added the SMBIOS system information to the report.
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@265
    19
  Portions created by the Initial Developer are Copyright (C) 2009-2011
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@228
    38
using System;
moel@130
    39
using System.Collections.Generic;
moel@166
    40
using System.Globalization;
moel@228
    41
using System.Threading;
moel@130
    42
using OpenHardwareMonitor.Hardware.LPC;
moel@130
    43
moel@130
    44
namespace OpenHardwareMonitor.Hardware.Mainboard {
moel@165
    45
  internal class SuperIOHardware : Hardware {
moel@130
    46
moel@195
    47
    private readonly Mainboard mainboard;
moel@195
    48
    private readonly ISuperIO superIO;
moel@130
    49
moel@195
    50
    private readonly List<Sensor> voltages = new List<Sensor>();
moel@195
    51
    private readonly List<Sensor> temperatures = new List<Sensor>();
moel@195
    52
    private readonly List<Sensor> fans = new List<Sensor>();
moel@167
    53
moel@228
    54
    private delegate float? ReadValueDelegate(int index);
moel@228
    55
    private delegate void UpdateDelegate();
moel@228
    56
moel@228
    57
    // delegates for mainboard specific sensor reading code
moel@228
    58
    private readonly ReadValueDelegate readVoltage;
moel@228
    59
    private readonly ReadValueDelegate readTemperature;
moel@228
    60
    private readonly ReadValueDelegate readFan;
moel@228
    61
moel@228
    62
    // delegate for post update mainboard specific code
moel@228
    63
    private readonly UpdateDelegate postUpdate;
moel@228
    64
moel@228
    65
    // mainboard specific mutex
moel@228
    66
    private readonly Mutex mutex;
moel@228
    67
moel@176
    68
    public SuperIOHardware(Mainboard mainboard, ISuperIO superIO, 
moel@176
    69
      Manufacturer manufacturer, Model model, ISettings settings) 
moel@275
    70
      : base(ChipName.GetName(superIO.Chip), new Identifier("lpc", 
moel@275
    71
        superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)), 
moel@275
    72
        settings)
moel@130
    73
    {
moel@176
    74
      this.mainboard = mainboard;
moel@130
    75
      this.superIO = superIO;
moel@130
    76
moel@228
    77
      this.readVoltage = (index) => superIO.Voltages[index];
moel@228
    78
      this.readTemperature = (index) => superIO.Temperatures[index];
moel@228
    79
      this.readFan = (index) => superIO.Fans[index];
moel@228
    80
moel@228
    81
      this.postUpdate = () => { };
moel@228
    82
moel@130
    83
      List<Voltage> v = new List<Voltage>();
moel@130
    84
      List<Temperature> t = new List<Temperature>();
moel@130
    85
      List<Fan> f = new List<Fan>();
moel@130
    86
moel@130
    87
      switch (superIO.Chip) {
moel@130
    88
        case Chip.IT8712F:
moel@130
    89
        case Chip.IT8716F:
moel@130
    90
        case Chip.IT8718F:
moel@177
    91
        case Chip.IT8720F: 
moel@319
    92
        case Chip.IT8726F:        
moel@130
    93
          switch (manufacturer) {
moel@133
    94
            case Manufacturer.ASUS:
moel@133
    95
              switch (model) {
moel@168
    96
                case Model.Crosshair_III_Formula: // IT8720F
moel@133
    97
                  v.Add(new Voltage("VBat", 8));
moel@133
    98
                  t.Add(new Temperature("CPU", 0));
moel@133
    99
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
   100
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@133
   101
                  break;
moel@144
   102
                case Model.M2N_SLI_DELUXE:                
moel@133
   103
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   104
                  v.Add(new Voltage("+3.3V", 1));
moel@195
   105
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   106
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@195
   107
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@133
   108
                  v.Add(new Voltage("VBat", 8));
moel@133
   109
                  t.Add(new Temperature("CPU", 0));
moel@133
   110
                  t.Add(new Temperature("Motherboard", 1));
moel@133
   111
                  f.Add(new Fan("CPU Fan", 0));
moel@133
   112
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@133
   113
                  f.Add(new Fan("Power Fan", 2));
moel@133
   114
                  break;
moel@168
   115
                case Model.M4A79XTD_EVO: // IT8720F           
moel@195
   116
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@144
   117
                  v.Add(new Voltage("VBat", 8));
moel@144
   118
                  t.Add(new Temperature("CPU", 0));
moel@144
   119
                  t.Add(new Temperature("Motherboard", 1));
moel@144
   120
                  f.Add(new Fan("CPU Fan", 0));
moel@144
   121
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@144
   122
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@144
   123
                  break;
moel@133
   124
                default:
moel@133
   125
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   126
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@133
   127
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@133
   128
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@133
   129
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@133
   130
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@133
   131
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@133
   132
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@133
   133
                  v.Add(new Voltage("VBat", 8));
moel@133
   134
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@133
   135
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@133
   136
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
   137
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@133
   138
                  break;
moel@133
   139
              }
moel@133
   140
              break;
moel@221
   141
moel@221
   142
            case Manufacturer.ASRock:
moel@221
   143
              switch (model) {
moel@221
   144
                case Model.P55_Deluxe: // IT8720F
moel@228
   145
                  
moel@221
   146
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   147
                  v.Add(new Voltage("+3.3V", 2));
moel@221
   148
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@221
   149
                  v.Add(new Voltage("+5V", 5, 6.8f, 10));
moel@221
   150
                  v.Add(new Voltage("VBat", 8));                  
moel@221
   151
                  t.Add(new Temperature("CPU", 0));
moel@221
   152
                  t.Add(new Temperature("Motherboard", 1));
moel@221
   153
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   154
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@228
   155
moel@228
   156
                  // this mutex is also used by the official ASRock tool
moel@228
   157
                  mutex = new Mutex(false, "ASRockOCMark");
moel@228
   158
                  
moel@228
   159
                  bool exclusiveAccess = false;
moel@228
   160
                  try {
moel@228
   161
                    exclusiveAccess = mutex.WaitOne(10, false);
moel@228
   162
                  } catch (AbandonedMutexException) { } 
moel@228
   163
                    catch (InvalidOperationException) { }  
moel@228
   164
moel@228
   165
                  // only read additional fans if we get exclusive access
moel@228
   166
                  if (exclusiveAccess) {
moel@228
   167
moel@228
   168
                    f.Add(new Fan("Chassis Fan #2", 2));
moel@228
   169
                    f.Add(new Fan("Chassis Fan #3", 3));
moel@228
   170
                    f.Add(new Fan("Power Fan", 4));
moel@228
   171
moel@228
   172
                    readFan = (index) => {
moel@228
   173
                      if (index < 2) {
moel@228
   174
                        return superIO.Fans[index];
moel@228
   175
                      } else {
moel@228
   176
                        // get GPIO 80-87
moel@228
   177
                        byte? gpio = superIO.ReadGPIO(7);
moel@228
   178
                        if (!gpio.HasValue)
moel@228
   179
                          return null;
moel@228
   180
moel@228
   181
                        // read the last 3 fans based on GPIO 83-85
moel@228
   182
                        int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   183
                        return (((gpio.Value >> 3) & 0x07) ==
moel@228
   184
                          masks[index - 2]) ? superIO.Fans[2] : null;
moel@228
   185
                      }
moel@228
   186
                    };
moel@228
   187
moel@228
   188
                    int fanIndex = 0;
moel@228
   189
                    postUpdate = () => {
moel@228
   190
                      // get GPIO 80-87
moel@228
   191
                      byte? gpio = superIO.ReadGPIO(7);
moel@228
   192
                      if (!gpio.HasValue)
moel@228
   193
                        return;
moel@228
   194
moel@228
   195
                      // prepare the GPIO 83-85 for the next update
moel@228
   196
                      int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   197
                      superIO.WriteGPIO(7,
moel@228
   198
                        (byte)((gpio.Value & 0xC7) | (masks[fanIndex] << 3)));
moel@228
   199
                      fanIndex = (fanIndex + 1) % 3;
moel@228
   200
                    };
moel@228
   201
                  }
moel@228
   202
moel@221
   203
                  break;
moel@221
   204
                default:
moel@221
   205
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   206
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@221
   207
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@221
   208
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@221
   209
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@221
   210
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@221
   211
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@221
   212
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@221
   213
                  v.Add(new Voltage("VBat", 8));
moel@221
   214
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@221
   215
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@221
   216
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@221
   217
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@221
   218
                  break;
moel@221
   219
              };
moel@221
   220
              break;
moel@221
   221
moel@130
   222
            case Manufacturer.DFI:
moel@130
   223
              switch (model) {
moel@168
   224
                case Model.LP_BI_P45_T2RS_Elite: // IT8718F
moel@130
   225
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   226
                  v.Add(new Voltage("FSB VTT", 1));
moel@130
   227
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   228
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   229
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   230
                  v.Add(new Voltage("NB Core", 5));
moel@130
   231
                  v.Add(new Voltage("VDIMM", 6));
moel@195
   232
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   233
                  v.Add(new Voltage("VBat", 8));
moel@130
   234
                  t.Add(new Temperature("CPU", 0));
moel@130
   235
                  t.Add(new Temperature("System", 1));
moel@130
   236
                  t.Add(new Temperature("Chipset", 2));
moel@130
   237
                  f.Add(new Fan("Fan #1", 0));
moel@130
   238
                  f.Add(new Fan("Fan #2", 1));
moel@130
   239
                  f.Add(new Fan("Fan #3", 2));
moel@130
   240
                  break;
moel@168
   241
                case Model.LP_DK_P55_T3eH9: // IT8720F
moel@130
   242
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   243
                  v.Add(new Voltage("VTT", 1));
moel@130
   244
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   245
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   246
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   247
                  v.Add(new Voltage("CPU PLL", 5));
moel@130
   248
                  v.Add(new Voltage("DRAM", 6));
moel@195
   249
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   250
                  v.Add(new Voltage("VBat", 8));
moel@130
   251
                  t.Add(new Temperature("Chipset", 0));
moel@130
   252
                  t.Add(new Temperature("CPU PWM", 1));
moel@130
   253
                  t.Add(new Temperature("CPU", 2));
moel@130
   254
                  f.Add(new Fan("Fan #1", 0));
moel@130
   255
                  f.Add(new Fan("Fan #2", 1));
moel@130
   256
                  f.Add(new Fan("Fan #3", 2));
moel@130
   257
                  break;
moel@130
   258
                default:
moel@130
   259
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   260
                  v.Add(new Voltage("VTT", 1, true));
moel@130
   261
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   262
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   263
                  v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
moel@130
   264
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   265
                  v.Add(new Voltage("DRAM", 6, true));
moel@130
   266
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
moel@130
   267
                  v.Add(new Voltage("VBat", 8));
moel@130
   268
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   269
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   270
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   271
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   272
                  break;
moel@130
   273
              }
moel@130
   274
              break;
moel@130
   275
moel@130
   276
            case Manufacturer.Gigabyte:
moel@130
   277
              switch (model) {
moel@168
   278
                case Model._965P_S3: // IT8718F
moel@130
   279
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   280
                  v.Add(new Voltage("DRAM", 1));
moel@130
   281
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   282
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   283
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   284
                  v.Add(new Voltage("VBat", 8));
moel@130
   285
                  t.Add(new Temperature("System", 0));
moel@130
   286
                  t.Add(new Temperature("CPU", 1));
moel@130
   287
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   288
                  f.Add(new Fan("System Fan", 1));
moel@130
   289
                  break;
moel@168
   290
                case Model.EP45_DS3R: // IT8718F
moel@130
   291
                case Model.EP45_UD3R: 
moel@138
   292
                case Model.X38_DS5:    
moel@130
   293
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   294
                  v.Add(new Voltage("DRAM", 1));
moel@130
   295
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   296
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   297
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   298
                  v.Add(new Voltage("VBat", 8));
moel@130
   299
                  t.Add(new Temperature("System", 0));
moel@130
   300
                  t.Add(new Temperature("CPU", 1));
moel@130
   301
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   302
                  f.Add(new Fan("System Fan #2", 1));
moel@130
   303
                  f.Add(new Fan("Power Fan", 2));
moel@130
   304
                  f.Add(new Fan("System Fan #1", 3));
moel@130
   305
                  break;
moel@168
   306
                case Model.EX58_EXTREME: // IT8720F 
moel@133
   307
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   308
                  v.Add(new Voltage("DRAM", 1));
moel@195
   309
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@133
   310
                  v.Add(new Voltage("VBat", 8));
moel@133
   311
                  t.Add(new Temperature("System", 0));
moel@133
   312
                  t.Add(new Temperature("CPU", 1));
moel@138
   313
                  t.Add(new Temperature("Northbridge", 2));
moel@133
   314
                  f.Add(new Fan("CPU Fan", 0));
moel@133
   315
                  f.Add(new Fan("System Fan #2", 1));
moel@133
   316
                  f.Add(new Fan("Power Fan", 2));
moel@133
   317
                  f.Add(new Fan("System Fan #1", 3));
moel@133
   318
                  break;
moel@168
   319
                case Model.P35_DS3: // IT8718F 
moel@168
   320
                case Model.P35_DS3L: // IT8718F
moel@130
   321
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   322
                  v.Add(new Voltage("DRAM", 1));
moel@130
   323
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   324
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   325
                  v.Add(new Voltage("+12V", 7, 27, 9.1f));
moel@130
   326
                  v.Add(new Voltage("VBat", 8));
moel@130
   327
                  t.Add(new Temperature("System", 0));
moel@130
   328
                  t.Add(new Temperature("CPU", 1));
moel@130
   329
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   330
                  f.Add(new Fan("System Fan #1", 1));
moel@130
   331
                  f.Add(new Fan("System Fan #2", 2));
moel@130
   332
                  f.Add(new Fan("Power Fan", 3));
moel@130
   333
                  break;
moel@168
   334
                case Model.P55_UD4: // IT8720F
moel@168
   335
                case Model.P55M_UD4: // IT8720F
moel@148
   336
                  v.Add(new Voltage("CPU VCore", 0));
moel@148
   337
                  v.Add(new Voltage("DRAM", 1));
moel@148
   338
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   339
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   340
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@148
   341
                  v.Add(new Voltage("VBat", 8));
moel@148
   342
                  t.Add(new Temperature("System", 0));
moel@148
   343
                  t.Add(new Temperature("CPU", 2));
moel@148
   344
                  f.Add(new Fan("CPU Fan", 0));
moel@148
   345
                  f.Add(new Fan("System Fan #2", 1));
moel@148
   346
                  f.Add(new Fan("Power Fan", 2));
moel@148
   347
                  f.Add(new Fan("System Fan #1", 3));
moel@148
   348
                  break;
moel@168
   349
                case Model.GA_MA770T_UD3: // IT8720F
moel@154
   350
                  v.Add(new Voltage("CPU VCore", 0));
moel@154
   351
                  v.Add(new Voltage("DRAM", 1));
moel@154
   352
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   353
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   354
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@154
   355
                  v.Add(new Voltage("VBat", 8));
moel@154
   356
                  t.Add(new Temperature("System", 0));
moel@154
   357
                  t.Add(new Temperature("CPU", 1));
moel@154
   358
                  f.Add(new Fan("CPU Fan", 0));
moel@154
   359
                  f.Add(new Fan("System Fan #1", 1));
moel@154
   360
                  f.Add(new Fan("System Fan #2", 2));
moel@154
   361
                  f.Add(new Fan("Power Fan", 3));
moel@154
   362
                  break;
moel@168
   363
                case Model.GA_MA785GMT_UD2H: // IT8718F
moel@130
   364
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   365
                  v.Add(new Voltage("DRAM", 1));
moel@130
   366
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   367
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   368
                  v.Add(new Voltage("+12V", 4, 27, 9.1f));
moel@130
   369
                  v.Add(new Voltage("VBat", 8));
moel@130
   370
                  t.Add(new Temperature("System", 0));
moel@130
   371
                  t.Add(new Temperature("CPU", 1));
moel@130
   372
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   373
                  f.Add(new Fan("System Fan", 1));
moel@130
   374
                  f.Add(new Fan("NB Fan", 2));
moel@130
   375
                  break;
moel@168
   376
                case Model.X58A_UD3R: // IT8720F 
moel@138
   377
                  v.Add(new Voltage("CPU VCore", 0));
moel@138
   378
                  v.Add(new Voltage("DRAM", 1));
moel@138
   379
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   380
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   381
                  v.Add(new Voltage("+12V", 5, 27, 9.1f));
moel@138
   382
                  v.Add(new Voltage("VBat", 8));
moel@138
   383
                  t.Add(new Temperature("System", 0));
moel@138
   384
                  t.Add(new Temperature("CPU", 1));
moel@138
   385
                  t.Add(new Temperature("Northbridge", 2));
moel@138
   386
                  f.Add(new Fan("CPU Fan", 0));
moel@138
   387
                  f.Add(new Fan("System Fan #2", 1));
moel@138
   388
                  f.Add(new Fan("Power Fan", 2));
moel@138
   389
                  f.Add(new Fan("System Fan #1", 3));
moel@138
   390
                  break;
moel@130
   391
                default:
moel@130
   392
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   393
                  v.Add(new Voltage("DRAM", 1, true));
moel@130
   394
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   395
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   396
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   397
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   398
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@257
   399
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   400
                  v.Add(new Voltage("VBat", 8));
moel@130
   401
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   402
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   403
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   404
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   405
                  break;
moel@130
   406
              }
moel@130
   407
              break;
moel@130
   408
moel@130
   409
            default:
moel@130
   410
              v.Add(new Voltage("CPU VCore", 0));
moel@130
   411
              v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   412
              v.Add(new Voltage("Voltage #3", 2, true));
moel@130
   413
              v.Add(new Voltage("Voltage #4", 3, true));
moel@130
   414
              v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   415
              v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   416
              v.Add(new Voltage("Voltage #7", 6, true));
moel@130
   417
              v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   418
              v.Add(new Voltage("VBat", 8));
moel@130
   419
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   420
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   421
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   422
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   423
              break;
moel@130
   424
          }
moel@130
   425
          break;
moel@170
   426
moel@170
   427
        case Chip.IT8721F:
moel@277
   428
        case Chip.IT8728F:
moel@319
   429
        case Chip.IT8772E:
moel@177
   430
          switch (manufacturer) {
moel@177
   431
            case Manufacturer.ECS:
moel@177
   432
              switch (model) {
moel@177
   433
                case Model.A890GXM_A: // IT8721F
moel@177
   434
                  v.Add(new Voltage("CPU VCore", 0));
moel@177
   435
                  v.Add(new Voltage("VDIMM", 1));
moel@177
   436
                  v.Add(new Voltage("NB Voltage", 2));
moel@195
   437
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10));
moel@177
   438
                  // v.Add(new Voltage("VDIMM", 6, true));
moel@195
   439
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@195
   440
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   441
                  t.Add(new Temperature("CPU", 0));
moel@177
   442
                  t.Add(new Temperature("System", 1));
moel@177
   443
                  t.Add(new Temperature("Northbridge", 2));
moel@177
   444
                  f.Add(new Fan("CPU Fan", 0));
moel@177
   445
                  f.Add(new Fan("System Fan", 1));
moel@177
   446
                  f.Add(new Fan("Power Fan", 2));
moel@177
   447
                  break;
moel@177
   448
                default:
moel@177
   449
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   450
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   451
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@177
   452
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
moel@177
   453
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   454
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   455
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   456
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   457
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   458
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   459
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   460
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   461
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   462
                  break;
moel@177
   463
              }
moel@177
   464
              break;
moel@278
   465
            case Manufacturer.Gigabyte:
moel@278
   466
              switch (model) {
moel@290
   467
                case Model.P67A_UD4_B3: // IT8728F
moel@278
   468
                  v.Add(new Voltage("+12V", 0, 100, 10));
moel@278
   469
                  v.Add(new Voltage("+5V", 1, 15, 10));
moel@278
   470
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@278
   471
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@278
   472
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@278
   473
                  v.Add(new Voltage("CPU VCore", 5));
moel@278
   474
                  v.Add(new Voltage("DRAM", 6));
moel@278
   475
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@278
   476
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   477
                  t.Add(new Temperature("System", 0));
moel@278
   478
                  t.Add(new Temperature("CPU", 2));
moel@278
   479
                  f.Add(new Fan("CPU Fan", 0));
moel@278
   480
                  f.Add(new Fan("System Fan #2", 1));
moel@278
   481
                  f.Add(new Fan("Power Fan", 2));
moel@278
   482
                  f.Add(new Fan("System Fan #1", 3));
moel@278
   483
                  break;
moel@290
   484
                case Model.H67A_UD3H_B3: // IT8728F
moel@290
   485
                  v.Add(new Voltage("VTT", 0));
moel@290
   486
                  v.Add(new Voltage("+5V", 1, 15, 10));
moel@290
   487
                  v.Add(new Voltage("+12V", 2, 68, 22));
moel@290
   488
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@290
   489
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@290
   490
                  v.Add(new Voltage("CPU VCore", 5));
moel@290
   491
                  v.Add(new Voltage("DRAM", 6));
moel@290
   492
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@290
   493
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@290
   494
                  t.Add(new Temperature("System", 0));
moel@290
   495
                  t.Add(new Temperature("CPU", 2));
moel@290
   496
                  f.Add(new Fan("CPU Fan", 0));
moel@290
   497
                  f.Add(new Fan("System Fan #1", 1));
moel@290
   498
                  f.Add(new Fan("Power Fan", 2));
moel@290
   499
                  f.Add(new Fan("System Fan #2", 3));
moel@290
   500
                  break;
moel@305
   501
                case Model.Z68X_UD7_B3: // IT8728F
moel@305
   502
                  v.Add(new Voltage("VTT", 0));
moel@307
   503
                  v.Add(new Voltage("+3.3V", 1, 13.3f, 20.5f));
moel@305
   504
                  v.Add(new Voltage("+12V", 2, 68, 22));
moel@307
   505
                  v.Add(new Voltage("+5V", 3, 14.3f, 20));
moel@305
   506
                  v.Add(new Voltage("CPU VCore", 5));
moel@305
   507
                  v.Add(new Voltage("DRAM", 6));
moel@305
   508
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@305
   509
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@305
   510
                  t.Add(new Temperature("System", 0));
moel@305
   511
                  t.Add(new Temperature("CPU", 1));
moel@305
   512
                  t.Add(new Temperature("System 3", 2));
moel@305
   513
                  f.Add(new Fan("CPU Fan", 0));
moel@305
   514
                  f.Add(new Fan("Power Fan", 1));
moel@305
   515
                  f.Add(new Fan("System Fan #1", 2));
moel@305
   516
                  f.Add(new Fan("System Fan #2", 3));
moel@305
   517
                  f.Add(new Fan("System Fan #3", 4));
moel@305
   518
                  break;
moel@278
   519
                default:
moel@278
   520
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@278
   521
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@278
   522
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@278
   523
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@278
   524
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@278
   525
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@278
   526
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@278
   527
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@278
   528
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   529
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@278
   530
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@278
   531
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@278
   532
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@278
   533
                  break;
moel@278
   534
              }
moel@278
   535
              break;
moel@320
   536
            case Manufacturer.Shuttle:
moel@320
   537
              switch (model) {
moel@320
   538
                case Model.FH67: // IT8772E 
moel@320
   539
                  v.Add(new Voltage("CPU VCore", 0));
moel@320
   540
                  v.Add(new Voltage("DRAM", 1));
moel@320
   541
                  v.Add(new Voltage("PCH VCCIO", 2));
moel@320
   542
                  v.Add(new Voltage("CPU VCCIO", 3));
moel@320
   543
                  v.Add(new Voltage("Graphic Voltage", 4));
moel@320
   544
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@320
   545
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   546
                  t.Add(new Temperature("System", 0));
moel@320
   547
                  t.Add(new Temperature("CPU", 1));                  
moel@320
   548
                  f.Add(new Fan("Fan #1", 0));
moel@320
   549
                  f.Add(new Fan("CPU Fan", 1));
moel@320
   550
                  break;
moel@320
   551
                default:
moel@320
   552
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@320
   553
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@320
   554
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@320
   555
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@320
   556
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@320
   557
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@320
   558
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@320
   559
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@320
   560
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   561
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@320
   562
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@320
   563
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@320
   564
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@320
   565
                  break;
moel@320
   566
              }
moel@320
   567
              break;
moel@177
   568
            default:
moel@177
   569
              v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   570
              v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   571
              v.Add(new Voltage("Voltage #3", 2, true));
moel@277
   572
              v.Add(new Voltage("Voltage #4", 3, true));
moel@177
   573
              v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   574
              v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   575
              v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   576
              v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   577
              v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   578
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   579
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   580
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   581
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@177
   582
              break;
moel@177
   583
          }
moel@170
   584
          break;
moel@130
   585
          
moel@130
   586
        case Chip.F71858:
moel@195
   587
          v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   588
          v.Add(new Voltage("VSB3V", 1, 150, 150));
moel@195
   589
          v.Add(new Voltage("Battery", 2, 150, 150));
moel@130
   590
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   591
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   592
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   593
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   594
          break;
moel@130
   595
        case Chip.F71862: 
moel@130
   596
        case Chip.F71869: 
moel@130
   597
        case Chip.F71882:
moel@296
   598
        case Chip.F71889AD: 
moel@130
   599
        case Chip.F71889ED: 
moel@130
   600
        case Chip.F71889F:
moel@132
   601
          switch (manufacturer) {
moel@132
   602
            case Manufacturer.EVGA:
moel@132
   603
              switch (model) {
moel@168
   604
                case Model.X58_SLI_Classified: // F71882 
moel@195
   605
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   606
                  v.Add(new Voltage("CPU VCore", 1, 47, 100));
moel@195
   607
                  v.Add(new Voltage("DIMM", 2, 47, 100));
moel@195
   608
                  v.Add(new Voltage("CPU VTT", 3, 24, 100));
moel@195
   609
                  v.Add(new Voltage("IOH Vcore", 4, 24, 100));
moel@195
   610
                  v.Add(new Voltage("+5V", 5, 51, 12));
moel@195
   611
                  v.Add(new Voltage("+12V", 6, 56, 6.8f));
moel@195
   612
                  v.Add(new Voltage("3VSB", 7, 150, 150));
moel@195
   613
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   614
                  t.Add(new Temperature("CPU", 0));
moel@132
   615
                  t.Add(new Temperature("VREG", 1));
moel@132
   616
                  t.Add(new Temperature("System", 2));
moel@132
   617
                  f.Add(new Fan("CPU Fan", 0));
moel@132
   618
                  f.Add(new Fan("Power Fan", 1));
moel@132
   619
                  f.Add(new Fan("Chassis Fan", 2));
moel@132
   620
                  break;
moel@132
   621
                default:
moel@195
   622
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   623
                  v.Add(new Voltage("CPU VCore", 1));
moel@132
   624
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   625
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   626
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   627
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   628
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   629
                  v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   630
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   631
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   632
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   633
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   634
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   635
                  break;
moel@132
   636
              }
moel@132
   637
              break;
moel@132
   638
            default:
moel@195
   639
              v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   640
              v.Add(new Voltage("CPU VCore", 1));
moel@132
   641
              v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   642
              v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   643
              v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   644
              v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   645
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   646
              v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   647
              v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   648
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   649
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   650
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   651
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   652
              break;
moel@132
   653
          }
moel@130
   654
          break;
moel@130
   655
moel@220
   656
        case Chip.W83627EHF:
moel@220
   657
          switch (manufacturer) {
moel@220
   658
            case Manufacturer.ASRock:
moel@220
   659
              switch (model) {
moel@220
   660
                case Model.AOD790GX_128M: // W83627EHF
moel@220
   661
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   662
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@220
   663
                  v.Add(new Voltage("+3.3V", 4, 10, 10));
moel@220
   664
                  v.Add(new Voltage("+5V", 5, 20, 10));
moel@220
   665
                  v.Add(new Voltage("+12V", 6, 28, 5));
moel@220
   666
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@220
   667
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   668
                  t.Add(new Temperature("CPU", 0));
moel@220
   669
                  t.Add(new Temperature("Motherboard", 2));
moel@221
   670
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   671
                  f.Add(new Fan("Chassis Fan", 1));                 
moel@220
   672
                  break;
moel@220
   673
                default:
moel@220
   674
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   675
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   676
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   677
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   678
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   679
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   680
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   681
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   682
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   683
                  v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   684
                  t.Add(new Temperature("CPU", 0));
moel@220
   685
                  t.Add(new Temperature("Auxiliary", 1));
moel@220
   686
                  t.Add(new Temperature("System", 2));
moel@220
   687
                  f.Add(new Fan("System Fan", 0));
moel@220
   688
                  f.Add(new Fan("CPU Fan", 1));
moel@220
   689
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   690
                  f.Add(new Fan("CPU Fan #2", 3));
moel@220
   691
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   692
                  break;
moel@220
   693
              } break;
moel@220
   694
            default:
moel@220
   695
              v.Add(new Voltage("CPU VCore", 0));
moel@220
   696
              v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   697
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   698
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   699
              v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   700
              v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   701
              v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   702
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   703
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   704
              v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   705
              t.Add(new Temperature("CPU", 0));
moel@220
   706
              t.Add(new Temperature("Auxiliary", 1));
moel@220
   707
              t.Add(new Temperature("System", 2));
moel@220
   708
              f.Add(new Fan("System Fan", 0));
moel@220
   709
              f.Add(new Fan("CPU Fan", 1));
moel@220
   710
              f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   711
              f.Add(new Fan("CPU Fan #2", 3));
moel@220
   712
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   713
              break;
moel@220
   714
          }
moel@130
   715
          break;
moel@130
   716
        case Chip.W83627DHG: 
moel@130
   717
        case Chip.W83627DHGP:                      
moel@130
   718
        case Chip.W83667HG:
moel@130
   719
        case Chip.W83667HGB:
moel@152
   720
          switch (manufacturer) {
moel@153
   721
            case Manufacturer.ASRock:
moel@153
   722
              switch (model) {
moel@168
   723
                case Model._880GMH_USB3: // W83627DHG-P
moel@153
   724
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   725
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   726
                  v.Add(new Voltage("+5V", 5, 15, 7.5f));
moel@195
   727
                  v.Add(new Voltage("+12V", 6, 56, 10));
moel@195
   728
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   729
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   730
                  t.Add(new Temperature("CPU", 0));
moel@153
   731
                  t.Add(new Temperature("Motherboard", 2));
moel@153
   732
                  f.Add(new Fan("Chassis Fan", 0));
moel@153
   733
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   734
                  f.Add(new Fan("Power Fan", 2));
moel@153
   735
                  break;
moel@153
   736
                default:
moel@153
   737
                  v.Add(new Voltage("CPU VCore", 0));
moel@153
   738
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   739
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   740
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@153
   741
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@153
   742
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@153
   743
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   744
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   745
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   746
                  t.Add(new Temperature("CPU", 0));
moel@153
   747
                  t.Add(new Temperature("Auxiliary", 1));
moel@153
   748
                  t.Add(new Temperature("System", 2));
moel@153
   749
                  f.Add(new Fan("System Fan", 0));
moel@153
   750
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   751
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   752
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   753
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@153
   754
                  break;
moel@153
   755
              }
moel@153
   756
              break;
moel@152
   757
            case Manufacturer.ASUS:
moel@152
   758
              switch (model) {
moel@174
   759
                case Model.P6X58D_E: // W83667HG                 
moel@174
   760
                case Model.Rampage_II_GENE: // W83667HG 
moel@152
   761
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   762
                  v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
moel@195
   763
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   764
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   765
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   766
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   767
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@174
   768
                  t.Add(new Temperature("CPU", 0));
moel@174
   769
                  t.Add(new Temperature("Motherboard", 2));
moel@174
   770
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@174
   771
                  f.Add(new Fan("CPU Fan", 1));
moel@174
   772
                  f.Add(new Fan("Power Fan", 2));
moel@174
   773
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@174
   774
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@174
   775
                  break;
moel@174
   776
                case Model.Rampage_Extreme: // W83667HG 
moel@174
   777
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   778
                  v.Add(new Voltage("+12V", 1, 12, 2));
moel@195
   779
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   780
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   781
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   782
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   783
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   784
                  t.Add(new Temperature("CPU", 0));
moel@152
   785
                  t.Add(new Temperature("Motherboard", 2));
moel@152
   786
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@153
   787
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   788
                  f.Add(new Fan("Power Fan", 2));
moel@152
   789
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@152
   790
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@152
   791
                  break;
moel@152
   792
                default:
moel@152
   793
                  v.Add(new Voltage("CPU VCore", 0));
moel@152
   794
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   795
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   796
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   797
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   798
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   799
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   800
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   801
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   802
                  t.Add(new Temperature("CPU", 0));
moel@152
   803
                  t.Add(new Temperature("Auxiliary", 1));
moel@152
   804
                  t.Add(new Temperature("System", 2));
moel@153
   805
                  f.Add(new Fan("System Fan", 0));
moel@153
   806
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   807
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   808
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   809
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   810
                  break;
moel@152
   811
              }
moel@152
   812
              break;
moel@152
   813
            default:
moel@152
   814
              v.Add(new Voltage("CPU VCore", 0));
moel@152
   815
              v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   816
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   817
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   818
              v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   819
              v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   820
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   821
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   822
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   823
              t.Add(new Temperature("CPU", 0));
moel@152
   824
              t.Add(new Temperature("Auxiliary", 1));
moel@152
   825
              t.Add(new Temperature("System", 2));
moel@153
   826
              f.Add(new Fan("System Fan", 0));
moel@153
   827
              f.Add(new Fan("CPU Fan", 1));
moel@153
   828
              f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   829
              f.Add(new Fan("CPU Fan #2", 3));
moel@153
   830
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   831
              break;
moel@152
   832
          } 
moel@130
   833
          break;
moel@130
   834
        case Chip.W83627HF: 
moel@130
   835
        case Chip.W83627THF: 
moel@130
   836
        case Chip.W83687THF:
moel@130
   837
          v.Add(new Voltage("CPU VCore", 0));
moel@130
   838
          v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   839
          v.Add(new Voltage("Voltage #3", 2, true));
moel@195
   840
          v.Add(new Voltage("AVCC", 3, 34, 51));
moel@130
   841
          v.Add(new Voltage("Voltage #5", 4, true));
moel@195
   842
          v.Add(new Voltage("5VSB", 5, 34, 51));
moel@130
   843
          v.Add(new Voltage("VBAT", 6));
moel@130
   844
          t.Add(new Temperature("CPU", 0));
moel@130
   845
          t.Add(new Temperature("Auxiliary", 1));
moel@130
   846
          t.Add(new Temperature("System", 2));
moel@153
   847
          f.Add(new Fan("System Fan", 0));
moel@153
   848
          f.Add(new Fan("CPU Fan", 1));
moel@153
   849
          f.Add(new Fan("Auxiliary Fan", 2));
moel@130
   850
          break;
moel@245
   851
        case Chip.NCT6771F:
moel@265
   852
        case Chip.NCT6776F:
moel@265
   853
          switch (manufacturer) {
moel@265
   854
            case Manufacturer.ASUS:
moel@265
   855
              switch (model) {
moel@312
   856
                case Model.P8P67: // NCT6776F
moel@311
   857
                case Model.P8P67_EVO: // NCT6776F
moel@265
   858
                case Model.P8P67_PRO: // NCT6776F
moel@265
   859
                  v.Add(new Voltage("CPU VCore", 0));
moel@310
   860
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@310
   861
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   862
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@310
   863
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@310
   864
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@265
   865
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@310
   866
                  t.Add(new Temperature("CPU", 0));
moel@276
   867
                  t.Add(new Temperature("Auxiliary", 2));
moel@310
   868
                  t.Add(new Temperature("Motherboard", 3));
moel@310
   869
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@265
   870
                  f.Add(new Fan("CPU Fan", 1));
moel@310
   871
                  f.Add(new Fan("Power Fan", 2));
moel@310
   872
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@265
   873
                  break;
moel@276
   874
                case Model.P8P67_M_PRO: // NCT6776F
moel@276
   875
                  v.Add(new Voltage("CPU VCore", 0));
moel@276
   876
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@276
   877
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   878
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@276
   879
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@276
   880
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@276
   881
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@276
   882
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@276
   883
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@276
   884
                  t.Add(new Temperature("CPU", 0));
moel@276
   885
                  t.Add(new Temperature("Motherboard", 3));
moel@276
   886
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@276
   887
                  f.Add(new Fan("CPU Fan", 1));
moel@276
   888
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@276
   889
                  f.Add(new Fan("Power Fan", 3));
moel@276
   890
                  f.Add(new Fan("Auxiliary Fan", 4));
moel@276
   891
                  break;
moel@265
   892
                default:
moel@265
   893
                  v.Add(new Voltage("CPU VCore", 0));
moel@265
   894
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@265
   895
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
   896
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
   897
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@265
   898
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@265
   899
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@265
   900
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
   901
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@265
   902
                  t.Add(new Temperature("CPU", 0));
moel@276
   903
                  t.Add(new Temperature("CPU", 1));
moel@276
   904
                  t.Add(new Temperature("Auxiliary", 2));
moel@276
   905
                  t.Add(new Temperature("System", 3));
moel@265
   906
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
   907
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@265
   908
                  break;
moel@265
   909
              }
moel@265
   910
              break;
moel@265
   911
            default:
moel@265
   912
              v.Add(new Voltage("CPU VCore", 0));
moel@265
   913
              v.Add(new Voltage("Voltage #2", 1, true));
moel@265
   914
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
   915
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
   916
              v.Add(new Voltage("Voltage #5", 4, true));
moel@265
   917
              v.Add(new Voltage("Voltage #6", 5, true));
moel@265
   918
              v.Add(new Voltage("Voltage #7", 6, true));
moel@265
   919
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
   920
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@265
   921
              t.Add(new Temperature("CPU", 0));
moel@276
   922
              t.Add(new Temperature("CPU", 1));
moel@276
   923
              t.Add(new Temperature("Auxiliary", 2));
moel@276
   924
              t.Add(new Temperature("System", 3));
moel@265
   925
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
   926
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@265
   927
              break;
moel@265
   928
          }
moel@245
   929
          break;
moel@130
   930
        default:
moel@130
   931
          for (int i = 0; i < superIO.Voltages.Length; i++)
moel@130
   932
            v.Add(new Voltage("Voltage #" + (i + 1), i, true));
moel@130
   933
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   934
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   935
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   936
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   937
          break;
moel@130
   938
      }
moel@130
   939
moel@195
   940
      const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
moel@130
   941
      foreach (Voltage voltage in v) 
moel@130
   942
        if (voltage.Index < superIO.Voltages.Length) {
moel@130
   943
          Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
moel@195
   944
            voltage.Hidden, SensorType.Voltage, this, new [] {
moel@130
   945
            new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
moel@130
   946
              formula, voltage.Ri),
moel@130
   947
            new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
moel@130
   948
              formula, voltage.Rf),
moel@130
   949
            new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
moel@130
   950
              formula, voltage.Vf)
moel@165
   951
            }, settings);
moel@130
   952
          voltages.Add(sensor);
moel@130
   953
      }
moel@130
   954
moel@130
   955
      foreach (Temperature temperature in t) 
moel@130
   956
        if (temperature.Index < superIO.Temperatures.Length) {
moel@134
   957
        Sensor sensor = new Sensor(temperature.Name, temperature.Index,
moel@195
   958
          SensorType.Temperature, this, new [] {
moel@130
   959
          new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
moel@165
   960
        }, settings);
moel@130
   961
        temperatures.Add(sensor);
moel@130
   962
      }
moel@130
   963
moel@130
   964
      foreach (Fan fan in f)
moel@130
   965
        if (fan.Index < superIO.Fans.Length) {
moel@134
   966
          Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
moel@165
   967
            this, settings);
moel@130
   968
          fans.Add(sensor);
moel@130
   969
        }
moel@130
   970
    }
moel@130
   971
moel@165
   972
    public override HardwareType HardwareType {
moel@165
   973
      get { return HardwareType.SuperIO; }
moel@130
   974
    }
moel@130
   975
moel@176
   976
    public override IHardware Parent {
moel@176
   977
      get { return mainboard; }
moel@176
   978
    }
moel@176
   979
moel@130
   980
moel@130
   981
    public override string GetReport() {
moel@130
   982
      return superIO.GetReport();
moel@130
   983
    }
moel@130
   984
moel@130
   985
    public override void Update() {
moel@130
   986
      superIO.Update();
moel@130
   987
moel@130
   988
      foreach (Sensor sensor in voltages) {
moel@228
   989
        float? value = readVoltage(sensor.Index);
moel@130
   990
        if (value.HasValue) {
moel@130
   991
          sensor.Value = value + (value - sensor.Parameters[2].Value) *
moel@130
   992
            sensor.Parameters[0].Value / sensor.Parameters[1].Value;
moel@130
   993
          ActivateSensor(sensor);
moel@130
   994
        }
moel@130
   995
      }
moel@130
   996
moel@130
   997
      foreach (Sensor sensor in temperatures) {
moel@228
   998
        float? value = readTemperature(sensor.Index);
moel@130
   999
        if (value.HasValue) {
moel@130
  1000
          sensor.Value = value + sensor.Parameters[0].Value;
moel@130
  1001
          ActivateSensor(sensor);
moel@130
  1002
        }
moel@130
  1003
      }
moel@130
  1004
moel@130
  1005
      foreach (Sensor sensor in fans) {
moel@228
  1006
        float? value = readFan(sensor.Index);
moel@130
  1007
        if (value.HasValue) {
moel@130
  1008
          sensor.Value = value;
moel@130
  1009
          if (value.Value > 0)
moel@130
  1010
            ActivateSensor(sensor);
moel@130
  1011
        }
moel@130
  1012
      }
moel@228
  1013
moel@228
  1014
      postUpdate();
moel@130
  1015
    }
moel@130
  1016
moel@130
  1017
    private class Voltage {
moel@130
  1018
      public readonly string Name;
moel@130
  1019
      public readonly int Index;
moel@130
  1020
      public readonly float Ri;
moel@130
  1021
      public readonly float Rf;
moel@130
  1022
      public readonly float Vf;
moel@130
  1023
      public readonly bool Hidden;
moel@130
  1024
moel@202
  1025
      public Voltage(string name, int index) :
moel@202
  1026
        this(name, index, false) { }
moel@202
  1027
      
moel@130
  1028
      public Voltage(string name, int index, bool hidden) :
moel@130
  1029
        this(name, index, 0, 1, 0, hidden) { }
moel@202
  1030
      
moel@202
  1031
      public Voltage(string name, int index, float ri, float rf) :
moel@202
  1032
        this(name, index, ri, rf, 0, false) { }
moel@202
  1033
      
moel@202
  1034
      // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) 
moel@202
  1035
      
moel@195
  1036
      public Voltage(string name, int index, 
moel@202
  1037
        float ri, float rf, float vf, bool hidden) 
moel@195
  1038
      {
moel@130
  1039
        this.Name = name;
moel@130
  1040
        this.Index = index;
moel@130
  1041
        this.Ri = ri;
moel@130
  1042
        this.Rf = rf;
moel@130
  1043
        this.Vf = vf;
moel@130
  1044
        this.Hidden = hidden;
moel@130
  1045
      }
moel@130
  1046
    }
moel@130
  1047
moel@130
  1048
    private class Temperature {
moel@130
  1049
      public readonly string Name;
moel@130
  1050
      public readonly int Index;
moel@130
  1051
moel@167
  1052
      public Temperature(string name, int index) {
moel@130
  1053
        this.Name = name;
moel@130
  1054
        this.Index = index;
moel@130
  1055
      }
moel@130
  1056
    }
moel@130
  1057
moel@130
  1058
    private class Fan {
moel@130
  1059
      public readonly string Name;
moel@130
  1060
      public readonly int Index;
moel@130
  1061
moel@130
  1062
      public Fan(string name, int index) {
moel@130
  1063
        this.Name = name;
moel@130
  1064
        this.Index = index;
moel@130
  1065
      }
moel@130
  1066
    }
moel@130
  1067
  }
moel@130
  1068
}