Hardware/Mainboard/SuperIOHardware.cs
author sl
Sun, 03 Feb 2013 19:06:01 +0100
changeset 392 8af90fa0940f
parent 383 ace2c5fc4b7f
permissions -rw-r--r--
Now fetching some of our Sound Graph DLL function pointers.
moel@135
     1
/*
moel@130
     2
 
moel@344
     3
  This Source Code Form is subject to the terms of the Mozilla Public
moel@344
     4
  License, v. 2.0. If a copy of the MPL was not distributed with this
moel@344
     5
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
moel@130
     6
 
moel@344
     7
  Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
moel@344
     8
	
moel@130
     9
*/
moel@130
    10
moel@228
    11
using System;
moel@130
    12
using System.Collections.Generic;
moel@166
    13
using System.Globalization;
moel@228
    14
using System.Threading;
moel@130
    15
using OpenHardwareMonitor.Hardware.LPC;
moel@130
    16
moel@130
    17
namespace OpenHardwareMonitor.Hardware.Mainboard {
moel@165
    18
  internal class SuperIOHardware : Hardware {
moel@130
    19
moel@195
    20
    private readonly Mainboard mainboard;
moel@195
    21
    private readonly ISuperIO superIO;
moel@130
    22
moel@195
    23
    private readonly List<Sensor> voltages = new List<Sensor>();
moel@195
    24
    private readonly List<Sensor> temperatures = new List<Sensor>();
moel@195
    25
    private readonly List<Sensor> fans = new List<Sensor>();
moel@323
    26
    private readonly List<Sensor> controls = new List<Sensor>();
moel@167
    27
moel@228
    28
    private delegate float? ReadValueDelegate(int index);
moel@228
    29
    private delegate void UpdateDelegate();
moel@228
    30
moel@228
    31
    // delegates for mainboard specific sensor reading code
moel@228
    32
    private readonly ReadValueDelegate readVoltage;
moel@228
    33
    private readonly ReadValueDelegate readTemperature;
moel@228
    34
    private readonly ReadValueDelegate readFan;
moel@323
    35
    private readonly ReadValueDelegate readControl;
moel@228
    36
moel@228
    37
    // delegate for post update mainboard specific code
moel@228
    38
    private readonly UpdateDelegate postUpdate;
moel@228
    39
moel@228
    40
    // mainboard specific mutex
moel@228
    41
    private readonly Mutex mutex;
moel@228
    42
moel@176
    43
    public SuperIOHardware(Mainboard mainboard, ISuperIO superIO, 
moel@176
    44
      Manufacturer manufacturer, Model model, ISettings settings) 
moel@275
    45
      : base(ChipName.GetName(superIO.Chip), new Identifier("lpc", 
moel@275
    46
        superIO.Chip.ToString().ToLower(CultureInfo.InvariantCulture)), 
moel@275
    47
        settings)
moel@130
    48
    {
moel@176
    49
      this.mainboard = mainboard;
moel@130
    50
      this.superIO = superIO;
moel@130
    51
moel@228
    52
      this.readVoltage = (index) => superIO.Voltages[index];
moel@228
    53
      this.readTemperature = (index) => superIO.Temperatures[index];
moel@228
    54
      this.readFan = (index) => superIO.Fans[index];
moel@323
    55
      this.readControl = (index) => superIO.Controls[index];
moel@228
    56
moel@228
    57
      this.postUpdate = () => { };
moel@228
    58
moel@130
    59
      List<Voltage> v = new List<Voltage>();
moel@130
    60
      List<Temperature> t = new List<Temperature>();
moel@130
    61
      List<Fan> f = new List<Fan>();
moel@323
    62
      List<Ctrl> c = new List<Ctrl>();
moel@130
    63
moel@130
    64
      switch (superIO.Chip) {
moel@353
    65
        case Chip.IT8705F:
moel@130
    66
        case Chip.IT8712F:
moel@130
    67
        case Chip.IT8716F:
moel@130
    68
        case Chip.IT8718F:
moel@177
    69
        case Chip.IT8720F: 
moel@319
    70
        case Chip.IT8726F:        
moel@130
    71
          switch (manufacturer) {
moel@133
    72
            case Manufacturer.ASUS:
moel@133
    73
              switch (model) {
moel@168
    74
                case Model.Crosshair_III_Formula: // IT8720F
moel@133
    75
                  v.Add(new Voltage("VBat", 8));
moel@133
    76
                  t.Add(new Temperature("CPU", 0));
moel@133
    77
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
    78
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@133
    79
                  break;
moel@144
    80
                case Model.M2N_SLI_DELUXE:                
moel@133
    81
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
    82
                  v.Add(new Voltage("+3.3V", 1));
moel@195
    83
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
    84
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@195
    85
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@133
    86
                  v.Add(new Voltage("VBat", 8));
moel@133
    87
                  t.Add(new Temperature("CPU", 0));
moel@133
    88
                  t.Add(new Temperature("Motherboard", 1));
moel@133
    89
                  f.Add(new Fan("CPU Fan", 0));
moel@133
    90
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@133
    91
                  f.Add(new Fan("Power Fan", 2));
moel@133
    92
                  break;
moel@168
    93
                case Model.M4A79XTD_EVO: // IT8720F           
moel@195
    94
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@144
    95
                  v.Add(new Voltage("VBat", 8));
moel@144
    96
                  t.Add(new Temperature("CPU", 0));
moel@144
    97
                  t.Add(new Temperature("Motherboard", 1));
moel@144
    98
                  f.Add(new Fan("CPU Fan", 0));
moel@144
    99
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@144
   100
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@144
   101
                  break;
moel@133
   102
                default:
moel@133
   103
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   104
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@133
   105
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@133
   106
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@133
   107
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@133
   108
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@133
   109
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@133
   110
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@133
   111
                  v.Add(new Voltage("VBat", 8));
moel@133
   112
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@133
   113
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@133
   114
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@133
   115
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   116
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   117
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@133
   118
                  break;
moel@133
   119
              }
moel@133
   120
              break;
moel@221
   121
moel@221
   122
            case Manufacturer.ASRock:
moel@221
   123
              switch (model) {
moel@221
   124
                case Model.P55_Deluxe: // IT8720F
moel@228
   125
                  
moel@221
   126
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   127
                  v.Add(new Voltage("+3.3V", 2));
moel@221
   128
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@221
   129
                  v.Add(new Voltage("+5V", 5, 6.8f, 10));
moel@221
   130
                  v.Add(new Voltage("VBat", 8));                  
moel@221
   131
                  t.Add(new Temperature("CPU", 0));
moel@221
   132
                  t.Add(new Temperature("Motherboard", 1));
moel@221
   133
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   134
                  f.Add(new Fan("Chassis Fan #1", 1));
moel@228
   135
moel@228
   136
                  // this mutex is also used by the official ASRock tool
moel@228
   137
                  mutex = new Mutex(false, "ASRockOCMark");
moel@228
   138
                  
moel@228
   139
                  bool exclusiveAccess = false;
moel@228
   140
                  try {
moel@228
   141
                    exclusiveAccess = mutex.WaitOne(10, false);
moel@228
   142
                  } catch (AbandonedMutexException) { } 
moel@228
   143
                    catch (InvalidOperationException) { }  
moel@228
   144
moel@228
   145
                  // only read additional fans if we get exclusive access
moel@228
   146
                  if (exclusiveAccess) {
moel@228
   147
moel@228
   148
                    f.Add(new Fan("Chassis Fan #2", 2));
moel@228
   149
                    f.Add(new Fan("Chassis Fan #3", 3));
moel@228
   150
                    f.Add(new Fan("Power Fan", 4));
moel@228
   151
moel@228
   152
                    readFan = (index) => {
moel@228
   153
                      if (index < 2) {
moel@228
   154
                        return superIO.Fans[index];
moel@228
   155
                      } else {
moel@228
   156
                        // get GPIO 80-87
moel@228
   157
                        byte? gpio = superIO.ReadGPIO(7);
moel@228
   158
                        if (!gpio.HasValue)
moel@228
   159
                          return null;
moel@228
   160
moel@228
   161
                        // read the last 3 fans based on GPIO 83-85
moel@228
   162
                        int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   163
                        return (((gpio.Value >> 3) & 0x07) ==
moel@228
   164
                          masks[index - 2]) ? superIO.Fans[2] : null;
moel@228
   165
                      }
moel@228
   166
                    };
moel@228
   167
moel@228
   168
                    int fanIndex = 0;
moel@228
   169
                    postUpdate = () => {
moel@228
   170
                      // get GPIO 80-87
moel@228
   171
                      byte? gpio = superIO.ReadGPIO(7);
moel@228
   172
                      if (!gpio.HasValue)
moel@228
   173
                        return;
moel@228
   174
moel@228
   175
                      // prepare the GPIO 83-85 for the next update
moel@228
   176
                      int[] masks = { 0x05, 0x03, 0x06 };
moel@228
   177
                      superIO.WriteGPIO(7,
moel@228
   178
                        (byte)((gpio.Value & 0xC7) | (masks[fanIndex] << 3)));
moel@228
   179
                      fanIndex = (fanIndex + 1) % 3;
moel@228
   180
                    };
moel@228
   181
                  }
moel@228
   182
moel@221
   183
                  break;
moel@221
   184
                default:
moel@221
   185
                  v.Add(new Voltage("CPU VCore", 0));
moel@221
   186
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@221
   187
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@221
   188
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@221
   189
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@221
   190
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@221
   191
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@221
   192
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@221
   193
                  v.Add(new Voltage("VBat", 8));
moel@221
   194
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@221
   195
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@221
   196
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@221
   197
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@221
   198
                  break;
moel@221
   199
              };
moel@221
   200
              break;
moel@221
   201
moel@130
   202
            case Manufacturer.DFI:
moel@130
   203
              switch (model) {
moel@168
   204
                case Model.LP_BI_P45_T2RS_Elite: // IT8718F
moel@130
   205
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   206
                  v.Add(new Voltage("FSB VTT", 1));
moel@130
   207
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   208
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   209
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   210
                  v.Add(new Voltage("NB Core", 5));
moel@130
   211
                  v.Add(new Voltage("VDIMM", 6));
moel@195
   212
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   213
                  v.Add(new Voltage("VBat", 8));
moel@130
   214
                  t.Add(new Temperature("CPU", 0));
moel@130
   215
                  t.Add(new Temperature("System", 1));
moel@130
   216
                  t.Add(new Temperature("Chipset", 2));
moel@130
   217
                  f.Add(new Fan("Fan #1", 0));
moel@130
   218
                  f.Add(new Fan("Fan #2", 1));
moel@130
   219
                  f.Add(new Fan("Fan #3", 2));
moel@130
   220
                  break;
moel@168
   221
                case Model.LP_DK_P55_T3eH9: // IT8720F
moel@130
   222
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   223
                  v.Add(new Voltage("VTT", 1));
moel@130
   224
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   225
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@195
   226
                  v.Add(new Voltage("+12V", 4, 30, 10));
moel@130
   227
                  v.Add(new Voltage("CPU PLL", 5));
moel@130
   228
                  v.Add(new Voltage("DRAM", 6));
moel@195
   229
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10));
moel@130
   230
                  v.Add(new Voltage("VBat", 8));
moel@130
   231
                  t.Add(new Temperature("Chipset", 0));
moel@130
   232
                  t.Add(new Temperature("CPU PWM", 1));
moel@130
   233
                  t.Add(new Temperature("CPU", 2));
moel@130
   234
                  f.Add(new Fan("Fan #1", 0));
moel@130
   235
                  f.Add(new Fan("Fan #2", 1));
moel@130
   236
                  f.Add(new Fan("Fan #3", 2));
moel@130
   237
                  break;
moel@130
   238
                default:
moel@130
   239
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   240
                  v.Add(new Voltage("VTT", 1, true));
moel@130
   241
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   242
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   243
                  v.Add(new Voltage("+12V", 4, 30, 10, 0, true));
moel@130
   244
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   245
                  v.Add(new Voltage("DRAM", 6, true));
moel@130
   246
                  v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true));
moel@130
   247
                  v.Add(new Voltage("VBat", 8));
moel@130
   248
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   249
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   250
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   251
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   252
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   253
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@130
   254
                  break;
moel@130
   255
              }
moel@130
   256
              break;
moel@130
   257
moel@130
   258
            case Manufacturer.Gigabyte:
moel@130
   259
              switch (model) {
moel@168
   260
                case Model._965P_S3: // IT8718F
moel@130
   261
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   262
                  v.Add(new Voltage("DRAM", 1));
moel@130
   263
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   264
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   265
                  v.Add(new Voltage("+12V", 7, 24.3f, 8.2f));
moel@130
   266
                  v.Add(new Voltage("VBat", 8));
moel@130
   267
                  t.Add(new Temperature("System", 0));
moel@130
   268
                  t.Add(new Temperature("CPU", 1));
moel@130
   269
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   270
                  f.Add(new Fan("System Fan", 1));
moel@130
   271
                  break;
moel@168
   272
                case Model.EP45_DS3R: // IT8718F
moel@130
   273
                case Model.EP45_UD3R: 
moel@138
   274
                case Model.X38_DS5:    
moel@130
   275
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   276
                  v.Add(new Voltage("DRAM", 1));
moel@130
   277
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   278
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   279
                  v.Add(new Voltage("+12V", 7, 24.3f, 8.2f));
moel@130
   280
                  v.Add(new Voltage("VBat", 8));
moel@130
   281
                  t.Add(new Temperature("System", 0));
moel@130
   282
                  t.Add(new Temperature("CPU", 1));
moel@130
   283
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   284
                  f.Add(new Fan("System Fan #2", 1));
moel@130
   285
                  f.Add(new Fan("Power Fan", 2));
moel@130
   286
                  f.Add(new Fan("System Fan #1", 3));
moel@130
   287
                  break;
moel@357
   288
                case Model.EX58_EXTREME: // IT8720F                 
moel@133
   289
                  v.Add(new Voltage("CPU VCore", 0));
moel@133
   290
                  v.Add(new Voltage("DRAM", 1));
moel@195
   291
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@133
   292
                  v.Add(new Voltage("VBat", 8));
moel@133
   293
                  t.Add(new Temperature("System", 0));
moel@133
   294
                  t.Add(new Temperature("CPU", 1));
moel@138
   295
                  t.Add(new Temperature("Northbridge", 2));
moel@133
   296
                  f.Add(new Fan("CPU Fan", 0));
moel@133
   297
                  f.Add(new Fan("System Fan #2", 1));
moel@133
   298
                  f.Add(new Fan("Power Fan", 2));
moel@133
   299
                  f.Add(new Fan("System Fan #1", 3));
moel@133
   300
                  break;
moel@168
   301
                case Model.P35_DS3: // IT8718F 
moel@168
   302
                case Model.P35_DS3L: // IT8718F
moel@130
   303
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   304
                  v.Add(new Voltage("DRAM", 1));
moel@130
   305
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   306
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   307
                  v.Add(new Voltage("+12V", 7, 24.3f, 8.2f));
moel@130
   308
                  v.Add(new Voltage("VBat", 8));
moel@130
   309
                  t.Add(new Temperature("System", 0));
moel@130
   310
                  t.Add(new Temperature("CPU", 1));
moel@130
   311
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   312
                  f.Add(new Fan("System Fan #1", 1));
moel@130
   313
                  f.Add(new Fan("System Fan #2", 2));
moel@130
   314
                  f.Add(new Fan("Power Fan", 3));
moel@130
   315
                  break;
moel@168
   316
                case Model.P55_UD4: // IT8720F
moel@357
   317
                case Model.P55A_UD3: // IT8720F
moel@357
   318
                case Model.P55M_UD4: // IT8720F                
moel@357
   319
                case Model.H55_USB3: // IT8720F
moel@357
   320
                case Model.EX58_UD3R: // IT8720F 
moel@148
   321
                  v.Add(new Voltage("CPU VCore", 0));
moel@148
   322
                  v.Add(new Voltage("DRAM", 1));
moel@148
   323
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   324
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   325
                  v.Add(new Voltage("+12V", 5, 24.3f, 8.2f));
moel@148
   326
                  v.Add(new Voltage("VBat", 8));
moel@148
   327
                  t.Add(new Temperature("System", 0));
moel@148
   328
                  t.Add(new Temperature("CPU", 2));
moel@148
   329
                  f.Add(new Fan("CPU Fan", 0));
moel@148
   330
                  f.Add(new Fan("System Fan #2", 1));
moel@148
   331
                  f.Add(new Fan("Power Fan", 2));
moel@148
   332
                  f.Add(new Fan("System Fan #1", 3));
moel@148
   333
                  break;
moel@357
   334
                case Model.H55N_USB3: // IT8720F
moel@154
   335
                  v.Add(new Voltage("CPU VCore", 0));
moel@154
   336
                  v.Add(new Voltage("DRAM", 1));
moel@154
   337
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   338
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   339
                  v.Add(new Voltage("+12V", 5, 24.3f, 8.2f));
moel@357
   340
                  v.Add(new Voltage("VBat", 8));
moel@357
   341
                  t.Add(new Temperature("System", 0));
moel@357
   342
                  t.Add(new Temperature("CPU", 2));
moel@357
   343
                  f.Add(new Fan("CPU Fan", 0));
moel@357
   344
                  f.Add(new Fan("System Fan", 1));
moel@357
   345
                  break;
moel@357
   346
                case Model.G41M_Combo: // IT8718F
moel@357
   347
                case Model.G41MT_S2: // IT8718F
moel@357
   348
                case Model.G41MT_S2P: // IT8718F
moel@357
   349
                  v.Add(new Voltage("CPU VCore", 0));
moel@357
   350
                  v.Add(new Voltage("DRAM", 1));
moel@357
   351
                  v.Add(new Voltage("+3.3V", 2));
moel@357
   352
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   353
                  v.Add(new Voltage("+12V", 7, 24.3f, 8.2f));
moel@357
   354
                  v.Add(new Voltage("VBat", 8));
moel@357
   355
                  t.Add(new Temperature("CPU", 2));
moel@357
   356
                  f.Add(new Fan("CPU Fan", 0));
moel@357
   357
                  f.Add(new Fan("System Fan", 1));
moel@357
   358
                  break;
moel@382
   359
                case Model.GA_970A_UD3: // IT8720F
moel@382
   360
                  v.Add(new Voltage("CPU VCore", 0));
moel@382
   361
                  v.Add(new Voltage("DRAM", 1));
moel@382
   362
                  v.Add(new Voltage("+3.3V", 2));
moel@382
   363
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@382
   364
                  v.Add(new Voltage("+12V", 4, 24.3f, 8.2f));
moel@382
   365
                  v.Add(new Voltage("VBat", 8));
moel@382
   366
                  t.Add(new Temperature("System", 0));
moel@382
   367
                  t.Add(new Temperature("CPU", 1));
moel@382
   368
                  f.Add(new Fan("CPU Fan", 0));
moel@382
   369
                  f.Add(new Fan("System Fan #1", 1));
moel@382
   370
                  f.Add(new Fan("System Fan #2", 2));
moel@382
   371
                  f.Add(new Fan("Power Fan", 4));
moel@382
   372
                  c.Add(new Ctrl("PWM 1", 0));
moel@382
   373
                  c.Add(new Ctrl("PWM 2", 1));
moel@382
   374
                  c.Add(new Ctrl("PWM 3", 2));
moel@382
   375
                  break;
moel@357
   376
                case Model.GA_MA770T_UD3: // IT8720F
moel@359
   377
                case Model.GA_MA770T_UD3P: // IT8720F                
moel@357
   378
                case Model.GA_MA790X_UD3P: // IT8720F
moel@357
   379
                  v.Add(new Voltage("CPU VCore", 0));
moel@357
   380
                  v.Add(new Voltage("DRAM", 1));
moel@357
   381
                  v.Add(new Voltage("+3.3V", 2));
moel@357
   382
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   383
                  v.Add(new Voltage("+12V", 4, 24.3f, 8.2f));
moel@154
   384
                  v.Add(new Voltage("VBat", 8));
moel@154
   385
                  t.Add(new Temperature("System", 0));
moel@154
   386
                  t.Add(new Temperature("CPU", 1));
moel@154
   387
                  f.Add(new Fan("CPU Fan", 0));
moel@154
   388
                  f.Add(new Fan("System Fan #1", 1));
moel@154
   389
                  f.Add(new Fan("System Fan #2", 2));
moel@154
   390
                  f.Add(new Fan("Power Fan", 3));
moel@154
   391
                  break;
moel@359
   392
                case Model.GA_MA78LM_S2H: // IT8718F
moel@359
   393
                  v.Add(new Voltage("CPU VCore", 0));
moel@359
   394
                  v.Add(new Voltage("DRAM", 1));
moel@359
   395
                  v.Add(new Voltage("+3.3V", 2));
moel@359
   396
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@359
   397
                  v.Add(new Voltage("+12V", 4, 24.3f, 8.2f));
moel@359
   398
                  v.Add(new Voltage("VBat", 8));
moel@359
   399
                  t.Add(new Temperature("System", 0));
moel@359
   400
                  t.Add(new Temperature("CPU", 1));
moel@359
   401
                  t.Add(new Temperature("VRM", 2));
moel@359
   402
                  f.Add(new Fan("CPU Fan", 0));
moel@359
   403
                  f.Add(new Fan("System Fan #1", 1));
moel@359
   404
                  f.Add(new Fan("System Fan #2", 2));
moel@359
   405
                  f.Add(new Fan("Power Fan", 3));
moel@359
   406
                  break;
moel@357
   407
                case Model.GA_MA785GM_US2H: // IT8718F
moel@168
   408
                case Model.GA_MA785GMT_UD2H: // IT8718F
moel@130
   409
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   410
                  v.Add(new Voltage("DRAM", 1));
moel@130
   411
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   412
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   413
                  v.Add(new Voltage("+12V", 4, 24.3f, 8.2f));
moel@130
   414
                  v.Add(new Voltage("VBat", 8));
moel@130
   415
                  t.Add(new Temperature("System", 0));
moel@130
   416
                  t.Add(new Temperature("CPU", 1));
moel@130
   417
                  f.Add(new Fan("CPU Fan", 0));
moel@130
   418
                  f.Add(new Fan("System Fan", 1));
moel@130
   419
                  f.Add(new Fan("NB Fan", 2));
moel@130
   420
                  break;
moel@168
   421
                case Model.X58A_UD3R: // IT8720F 
moel@138
   422
                  v.Add(new Voltage("CPU VCore", 0));
moel@138
   423
                  v.Add(new Voltage("DRAM", 1));
moel@138
   424
                  v.Add(new Voltage("+3.3V", 2));
moel@195
   425
                  v.Add(new Voltage("+5V", 3, 6.8f, 10));
moel@357
   426
                  v.Add(new Voltage("+12V", 5, 24.3f, 8.2f));
moel@138
   427
                  v.Add(new Voltage("VBat", 8));
moel@138
   428
                  t.Add(new Temperature("System", 0));
moel@138
   429
                  t.Add(new Temperature("CPU", 1));
moel@138
   430
                  t.Add(new Temperature("Northbridge", 2));
moel@138
   431
                  f.Add(new Fan("CPU Fan", 0));
moel@138
   432
                  f.Add(new Fan("System Fan #2", 1));
moel@138
   433
                  f.Add(new Fan("Power Fan", 2));
moel@138
   434
                  f.Add(new Fan("System Fan #1", 3));
moel@138
   435
                  break;
moel@130
   436
                default:
moel@130
   437
                  v.Add(new Voltage("CPU VCore", 0));
moel@130
   438
                  v.Add(new Voltage("DRAM", 1, true));
moel@130
   439
                  v.Add(new Voltage("+3.3V", 2, true));
moel@130
   440
                  v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true));
moel@130
   441
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   442
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   443
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@257
   444
                  v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   445
                  v.Add(new Voltage("VBat", 8));
moel@130
   446
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   447
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   448
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   449
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   450
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   451
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@130
   452
                  break;
moel@130
   453
              }
moel@130
   454
              break;
moel@130
   455
moel@130
   456
            default:
moel@130
   457
              v.Add(new Voltage("CPU VCore", 0));
moel@130
   458
              v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   459
              v.Add(new Voltage("Voltage #3", 2, true));
moel@130
   460
              v.Add(new Voltage("Voltage #4", 3, true));
moel@130
   461
              v.Add(new Voltage("Voltage #5", 4, true));
moel@130
   462
              v.Add(new Voltage("Voltage #6", 5, true));
moel@130
   463
              v.Add(new Voltage("Voltage #7", 6, true));
moel@130
   464
              v.Add(new Voltage("Voltage #8", 7, true));
moel@130
   465
              v.Add(new Voltage("VBat", 8));
moel@130
   466
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   467
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   468
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   469
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   470
              for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   471
                c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@130
   472
              break;
moel@130
   473
          }
moel@130
   474
          break;
moel@170
   475
moel@170
   476
        case Chip.IT8721F:
moel@277
   477
        case Chip.IT8728F:
moel@341
   478
        case Chip.IT8771E:
moel@319
   479
        case Chip.IT8772E:
moel@177
   480
          switch (manufacturer) {
moel@177
   481
            case Manufacturer.ECS:
moel@177
   482
              switch (model) {
moel@177
   483
                case Model.A890GXM_A: // IT8721F
moel@177
   484
                  v.Add(new Voltage("CPU VCore", 0));
moel@177
   485
                  v.Add(new Voltage("VDIMM", 1));
moel@177
   486
                  v.Add(new Voltage("NB Voltage", 2));
moel@195
   487
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10));
moel@177
   488
                  // v.Add(new Voltage("VDIMM", 6, true));
moel@195
   489
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@195
   490
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   491
                  t.Add(new Temperature("CPU", 0));
moel@177
   492
                  t.Add(new Temperature("System", 1));
moel@177
   493
                  t.Add(new Temperature("Northbridge", 2));
moel@177
   494
                  f.Add(new Fan("CPU Fan", 0));
moel@177
   495
                  f.Add(new Fan("System Fan", 1));
moel@177
   496
                  f.Add(new Fan("Power Fan", 2));
moel@177
   497
                  break;
moel@177
   498
                default:
moel@177
   499
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   500
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   501
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@177
   502
                  v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true));
moel@177
   503
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   504
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   505
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   506
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   507
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   508
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   509
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   510
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   511
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   512
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   513
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@177
   514
                  break;
moel@177
   515
              }
moel@177
   516
              break;
moel@278
   517
            case Manufacturer.Gigabyte:
moel@278
   518
              switch (model) {
moel@357
   519
                case Model.H61M_DS2_REV_1_2: // IT8728F
moel@357
   520
                case Model.H61M_USB3_B3_REV_2_0: // IT8728F
moel@357
   521
                  v.Add(new Voltage("VTT", 0));
moel@357
   522
                  v.Add(new Voltage("+12V", 2, 30.9f, 10));
moel@278
   523
                  v.Add(new Voltage("CPU VCore", 5));
moel@278
   524
                  v.Add(new Voltage("DRAM", 6));
moel@278
   525
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@278
   526
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   527
                  t.Add(new Temperature("System", 0));
moel@278
   528
                  t.Add(new Temperature("CPU", 2));
moel@278
   529
                  f.Add(new Fan("CPU Fan", 0));
moel@357
   530
                  f.Add(new Fan("System Fan", 1));
moel@278
   531
                  break;
moel@290
   532
                case Model.H67A_UD3H_B3: // IT8728F
moel@357
   533
                case Model.H67A_USB3_B3: // IT8728F                
moel@290
   534
                  v.Add(new Voltage("VTT", 0));
moel@290
   535
                  v.Add(new Voltage("+5V", 1, 15, 10));
moel@357
   536
                  v.Add(new Voltage("+12V", 2, 30.9f, 10));
moel@290
   537
                  v.Add(new Voltage("CPU VCore", 5));
moel@290
   538
                  v.Add(new Voltage("DRAM", 6));
moel@290
   539
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@290
   540
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@290
   541
                  t.Add(new Temperature("System", 0));
moel@290
   542
                  t.Add(new Temperature("CPU", 2));
moel@290
   543
                  f.Add(new Fan("CPU Fan", 0));
moel@290
   544
                  f.Add(new Fan("System Fan #1", 1));
moel@290
   545
                  f.Add(new Fan("Power Fan", 2));
moel@290
   546
                  f.Add(new Fan("System Fan #2", 3));
moel@290
   547
                  break;
moel@357
   548
                case Model.Z68A_D3H_B3: // IT8728F
moel@357
   549
                  v.Add(new Voltage("VTT", 0));
moel@357
   550
                  v.Add(new Voltage("+3.3V", 1, 6.49f, 10));
moel@357
   551
                  v.Add(new Voltage("+12V", 2, 30.9f, 10));
moel@357
   552
                  v.Add(new Voltage("+5V", 3, 7.15f, 10));
moel@357
   553
                  v.Add(new Voltage("CPU VCore", 5));
moel@357
   554
                  v.Add(new Voltage("DRAM", 6));
moel@357
   555
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@357
   556
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@357
   557
                  t.Add(new Temperature("System", 0));
moel@357
   558
                  t.Add(new Temperature("CPU", 2));
moel@357
   559
                  f.Add(new Fan("CPU Fan", 0));
moel@357
   560
                  f.Add(new Fan("System Fan #1", 1));
moel@357
   561
                  f.Add(new Fan("Power Fan", 2));
moel@357
   562
                  f.Add(new Fan("System Fan #2", 3));
moel@357
   563
                  break;
moel@357
   564
                case Model.P67A_UD3_B3: // IT8728F
moel@357
   565
                case Model.P67A_UD3R_B3: // IT8728F
moel@357
   566
                case Model.P67A_UD4_B3: // IT8728F                
moel@357
   567
                case Model.Z68AP_D3: // IT8728F
moel@357
   568
                case Model.Z68X_UD3H_B3: // IT8728F               
moel@357
   569
                  v.Add(new Voltage("VTT", 0));
moel@357
   570
                  v.Add(new Voltage("+3.3V", 1, 6.49f, 10));
moel@357
   571
                  v.Add(new Voltage("+12V", 2, 30.9f, 10));
moel@357
   572
                  v.Add(new Voltage("+5V", 3, 7.15f, 10));
moel@357
   573
                  v.Add(new Voltage("CPU VCore", 5));
moel@357
   574
                  v.Add(new Voltage("DRAM", 6));
moel@357
   575
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@357
   576
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@357
   577
                  t.Add(new Temperature("System", 0));
moel@357
   578
                  t.Add(new Temperature("CPU", 2));
moel@357
   579
                  f.Add(new Fan("CPU Fan", 0));
moel@357
   580
                  f.Add(new Fan("System Fan #2", 1));
moel@357
   581
                  f.Add(new Fan("Power Fan", 2));
moel@357
   582
                  f.Add(new Fan("System Fan #1", 3));
moel@357
   583
                  break;                
moel@305
   584
                case Model.Z68X_UD7_B3: // IT8728F
moel@305
   585
                  v.Add(new Voltage("VTT", 0));
moel@357
   586
                  v.Add(new Voltage("+3.3V", 1, 6.49f, 10));
moel@357
   587
                  v.Add(new Voltage("+12V", 2, 30.9f, 10));
moel@357
   588
                  v.Add(new Voltage("+5V", 3, 7.15f, 10));
moel@305
   589
                  v.Add(new Voltage("CPU VCore", 5));
moel@305
   590
                  v.Add(new Voltage("DRAM", 6));
moel@305
   591
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@305
   592
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@305
   593
                  t.Add(new Temperature("System", 0));
moel@305
   594
                  t.Add(new Temperature("CPU", 1));
moel@305
   595
                  t.Add(new Temperature("System 3", 2));
moel@305
   596
                  f.Add(new Fan("CPU Fan", 0));
moel@305
   597
                  f.Add(new Fan("Power Fan", 1));
moel@305
   598
                  f.Add(new Fan("System Fan #1", 2));
moel@305
   599
                  f.Add(new Fan("System Fan #2", 3));
moel@305
   600
                  f.Add(new Fan("System Fan #3", 4));
moel@305
   601
                  break;
moel@278
   602
                default:
moel@278
   603
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@278
   604
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@278
   605
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@278
   606
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@278
   607
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@278
   608
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@278
   609
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@278
   610
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@278
   611
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@278
   612
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@278
   613
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@278
   614
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@278
   615
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   616
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   617
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@278
   618
                  break;
moel@278
   619
              }
moel@278
   620
              break;
moel@320
   621
            case Manufacturer.Shuttle:
moel@320
   622
              switch (model) {
moel@320
   623
                case Model.FH67: // IT8772E 
moel@320
   624
                  v.Add(new Voltage("CPU VCore", 0));
moel@320
   625
                  v.Add(new Voltage("DRAM", 1));
moel@320
   626
                  v.Add(new Voltage("PCH VCCIO", 2));
moel@320
   627
                  v.Add(new Voltage("CPU VCCIO", 3));
moel@320
   628
                  v.Add(new Voltage("Graphic Voltage", 4));
moel@320
   629
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10));
moel@320
   630
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   631
                  t.Add(new Temperature("System", 0));
moel@320
   632
                  t.Add(new Temperature("CPU", 1));                  
moel@320
   633
                  f.Add(new Fan("Fan #1", 0));
moel@320
   634
                  f.Add(new Fan("CPU Fan", 1));
moel@320
   635
                  break;
moel@320
   636
                default:
moel@320
   637
                  v.Add(new Voltage("Voltage #1", 0, true));
moel@320
   638
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@320
   639
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@320
   640
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@320
   641
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@320
   642
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@320
   643
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@320
   644
                  v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@320
   645
                  v.Add(new Voltage("VBat", 8, 10, 10));
moel@320
   646
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@320
   647
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@320
   648
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@320
   649
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   650
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   651
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@320
   652
                  break;
moel@320
   653
              }
moel@320
   654
              break;
moel@177
   655
            default:
moel@177
   656
              v.Add(new Voltage("Voltage #1", 0, true));
moel@177
   657
              v.Add(new Voltage("Voltage #2", 1, true));
moel@177
   658
              v.Add(new Voltage("Voltage #3", 2, true));
moel@277
   659
              v.Add(new Voltage("Voltage #4", 3, true));
moel@177
   660
              v.Add(new Voltage("Voltage #5", 4, true));
moel@177
   661
              v.Add(new Voltage("Voltage #6", 5, true));
moel@177
   662
              v.Add(new Voltage("Voltage #7", 6, true));
moel@177
   663
              v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true));
moel@195
   664
              v.Add(new Voltage("VBat", 8, 10, 10));
moel@177
   665
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@177
   666
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@177
   667
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@177
   668
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
   669
              for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
   670
                c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@177
   671
              break;
moel@177
   672
          }
moel@170
   673
          break;
moel@130
   674
          
moel@130
   675
        case Chip.F71858:
moel@195
   676
          v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   677
          v.Add(new Voltage("VSB3V", 1, 150, 150));
moel@195
   678
          v.Add(new Voltage("Battery", 2, 150, 150));
moel@130
   679
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
   680
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
   681
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
   682
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@130
   683
          break;
moel@130
   684
        case Chip.F71862: 
moel@130
   685
        case Chip.F71869: 
moel@130
   686
        case Chip.F71882:
moel@296
   687
        case Chip.F71889AD: 
moel@130
   688
        case Chip.F71889ED: 
moel@130
   689
        case Chip.F71889F:
moel@352
   690
        case Chip.F71808E:
moel@132
   691
          switch (manufacturer) {
moel@132
   692
            case Manufacturer.EVGA:
moel@132
   693
              switch (model) {
moel@168
   694
                case Model.X58_SLI_Classified: // F71882 
moel@195
   695
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@195
   696
                  v.Add(new Voltage("CPU VCore", 1, 47, 100));
moel@195
   697
                  v.Add(new Voltage("DIMM", 2, 47, 100));
moel@195
   698
                  v.Add(new Voltage("CPU VTT", 3, 24, 100));
moel@195
   699
                  v.Add(new Voltage("IOH Vcore", 4, 24, 100));
moel@195
   700
                  v.Add(new Voltage("+5V", 5, 51, 12));
moel@195
   701
                  v.Add(new Voltage("+12V", 6, 56, 6.8f));
moel@195
   702
                  v.Add(new Voltage("3VSB", 7, 150, 150));
moel@195
   703
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   704
                  t.Add(new Temperature("CPU", 0));
moel@132
   705
                  t.Add(new Temperature("VREG", 1));
moel@132
   706
                  t.Add(new Temperature("System", 2));
moel@132
   707
                  f.Add(new Fan("CPU Fan", 0));
moel@132
   708
                  f.Add(new Fan("Power Fan", 1));
moel@132
   709
                  f.Add(new Fan("Chassis Fan", 2));
moel@132
   710
                  break;
moel@132
   711
                default:
moel@195
   712
                  v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   713
                  v.Add(new Voltage("CPU VCore", 1));
moel@132
   714
                  v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   715
                  v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   716
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   717
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@132
   718
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   719
                  v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   720
                  v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   721
                  for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   722
                    t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   723
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   724
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   725
                  break;
moel@132
   726
              }
moel@132
   727
              break;
moel@132
   728
            default:
moel@195
   729
              v.Add(new Voltage("VCC3V", 0, 150, 150));
moel@132
   730
              v.Add(new Voltage("CPU VCore", 1));
moel@132
   731
              v.Add(new Voltage("Voltage #3", 2, true));
moel@132
   732
              v.Add(new Voltage("Voltage #4", 3, true));
moel@132
   733
              v.Add(new Voltage("Voltage #5", 4, true));
moel@132
   734
              v.Add(new Voltage("Voltage #6", 5, true));
moel@352
   735
              if (superIO.Chip != Chip.F71808E) 
moel@352
   736
                  v.Add(new Voltage("Voltage #7", 6, true)); 
moel@195
   737
              v.Add(new Voltage("VSB3V", 7, 150, 150));
moel@195
   738
              v.Add(new Voltage("VBat", 8, 150, 150));
moel@132
   739
              for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@132
   740
                t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@132
   741
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@132
   742
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@132
   743
              break;
moel@132
   744
          }
moel@130
   745
          break;
moel@130
   746
moel@220
   747
        case Chip.W83627EHF:
moel@220
   748
          switch (manufacturer) {
moel@220
   749
            case Manufacturer.ASRock:
moel@220
   750
              switch (model) {
moel@220
   751
                case Model.AOD790GX_128M: // W83627EHF
moel@220
   752
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   753
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@220
   754
                  v.Add(new Voltage("+3.3V", 4, 10, 10));
moel@220
   755
                  v.Add(new Voltage("+5V", 5, 20, 10));
moel@220
   756
                  v.Add(new Voltage("+12V", 6, 28, 5));
moel@220
   757
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@220
   758
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   759
                  t.Add(new Temperature("CPU", 0));
moel@220
   760
                  t.Add(new Temperature("Motherboard", 2));
moel@221
   761
                  f.Add(new Fan("CPU Fan", 0));
moel@221
   762
                  f.Add(new Fan("Chassis Fan", 1));                 
moel@220
   763
                  break;
moel@220
   764
                default:
moel@220
   765
                  v.Add(new Voltage("CPU VCore", 0));
moel@220
   766
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   767
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   768
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   769
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   770
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   771
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   772
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   773
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   774
                  v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   775
                  t.Add(new Temperature("CPU", 0));
moel@220
   776
                  t.Add(new Temperature("Auxiliary", 1));
moel@220
   777
                  t.Add(new Temperature("System", 2));
moel@220
   778
                  f.Add(new Fan("System Fan", 0));
moel@220
   779
                  f.Add(new Fan("CPU Fan", 1));
moel@220
   780
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   781
                  f.Add(new Fan("CPU Fan #2", 3));
moel@220
   782
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   783
                  break;
moel@220
   784
              } break;
moel@220
   785
            default:
moel@220
   786
              v.Add(new Voltage("CPU VCore", 0));
moel@220
   787
              v.Add(new Voltage("Voltage #2", 1, true));
moel@220
   788
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@220
   789
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@220
   790
              v.Add(new Voltage("Voltage #5", 4, true));
moel@220
   791
              v.Add(new Voltage("Voltage #6", 5, true));
moel@220
   792
              v.Add(new Voltage("Voltage #7", 6, true));
moel@220
   793
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@220
   794
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@220
   795
              v.Add(new Voltage("Voltage #10", 9, true));
moel@220
   796
              t.Add(new Temperature("CPU", 0));
moel@220
   797
              t.Add(new Temperature("Auxiliary", 1));
moel@220
   798
              t.Add(new Temperature("System", 2));
moel@220
   799
              f.Add(new Fan("System Fan", 0));
moel@220
   800
              f.Add(new Fan("CPU Fan", 1));
moel@220
   801
              f.Add(new Fan("Auxiliary Fan", 2));
moel@220
   802
              f.Add(new Fan("CPU Fan #2", 3));
moel@220
   803
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@220
   804
              break;
moel@220
   805
          }
moel@130
   806
          break;
moel@130
   807
        case Chip.W83627DHG: 
moel@130
   808
        case Chip.W83627DHGP:                      
moel@130
   809
        case Chip.W83667HG:
moel@130
   810
        case Chip.W83667HGB:
moel@152
   811
          switch (manufacturer) {
moel@153
   812
            case Manufacturer.ASRock:
moel@153
   813
              switch (model) {
moel@168
   814
                case Model._880GMH_USB3: // W83627DHG-P
moel@153
   815
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   816
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   817
                  v.Add(new Voltage("+5V", 5, 15, 7.5f));
moel@195
   818
                  v.Add(new Voltage("+12V", 6, 56, 10));
moel@195
   819
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   820
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   821
                  t.Add(new Temperature("CPU", 0));
moel@153
   822
                  t.Add(new Temperature("Motherboard", 2));
moel@153
   823
                  f.Add(new Fan("Chassis Fan", 0));
moel@153
   824
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   825
                  f.Add(new Fan("Power Fan", 2));
moel@153
   826
                  break;
moel@153
   827
                default:
moel@153
   828
                  v.Add(new Voltage("CPU VCore", 0));
moel@153
   829
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   830
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   831
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@153
   832
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@153
   833
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@153
   834
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   835
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   836
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@153
   837
                  t.Add(new Temperature("CPU", 0));
moel@153
   838
                  t.Add(new Temperature("Auxiliary", 1));
moel@153
   839
                  t.Add(new Temperature("System", 2));
moel@153
   840
                  f.Add(new Fan("System Fan", 0));
moel@153
   841
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   842
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   843
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   844
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@153
   845
                  break;
moel@153
   846
              }
moel@153
   847
              break;
moel@152
   848
            case Manufacturer.ASUS:
moel@152
   849
              switch (model) {
moel@336
   850
                case Model.P6T: // W83667HG
moel@174
   851
                case Model.P6X58D_E: // W83667HG                 
moel@174
   852
                case Model.Rampage_II_GENE: // W83667HG 
moel@152
   853
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   854
                  v.Add(new Voltage("+12V", 1, 11.5f, 1.91f));
moel@195
   855
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   856
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   857
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   858
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   859
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@174
   860
                  t.Add(new Temperature("CPU", 0));
moel@174
   861
                  t.Add(new Temperature("Motherboard", 2));
moel@174
   862
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@174
   863
                  f.Add(new Fan("CPU Fan", 1));
moel@174
   864
                  f.Add(new Fan("Power Fan", 2));
moel@174
   865
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@174
   866
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@174
   867
                  break;
moel@174
   868
                case Model.Rampage_Extreme: // W83667HG 
moel@174
   869
                  v.Add(new Voltage("CPU VCore", 0));
moel@195
   870
                  v.Add(new Voltage("+12V", 1, 12, 2));
moel@195
   871
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@195
   872
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@195
   873
                  v.Add(new Voltage("+5V", 4, 15, 7.5f));
moel@195
   874
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@195
   875
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   876
                  t.Add(new Temperature("CPU", 0));
moel@152
   877
                  t.Add(new Temperature("Motherboard", 2));
moel@152
   878
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@153
   879
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   880
                  f.Add(new Fan("Power Fan", 2));
moel@152
   881
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@152
   882
                  f.Add(new Fan("Chassis Fan #3", 4));
moel@152
   883
                  break;
moel@152
   884
                default:
moel@152
   885
                  v.Add(new Voltage("CPU VCore", 0));
moel@152
   886
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   887
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   888
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   889
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   890
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   891
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   892
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   893
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   894
                  t.Add(new Temperature("CPU", 0));
moel@152
   895
                  t.Add(new Temperature("Auxiliary", 1));
moel@152
   896
                  t.Add(new Temperature("System", 2));
moel@153
   897
                  f.Add(new Fan("System Fan", 0));
moel@153
   898
                  f.Add(new Fan("CPU Fan", 1));
moel@153
   899
                  f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   900
                  f.Add(new Fan("CPU Fan #2", 3));
moel@153
   901
                  f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   902
                  break;
moel@152
   903
              }
moel@152
   904
              break;
moel@152
   905
            default:
moel@152
   906
              v.Add(new Voltage("CPU VCore", 0));
moel@152
   907
              v.Add(new Voltage("Voltage #2", 1, true));
moel@195
   908
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@195
   909
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@152
   910
              v.Add(new Voltage("Voltage #5", 4, true));
moel@152
   911
              v.Add(new Voltage("Voltage #6", 5, true));
moel@152
   912
              v.Add(new Voltage("Voltage #7", 6, true));
moel@195
   913
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@195
   914
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@152
   915
              t.Add(new Temperature("CPU", 0));
moel@152
   916
              t.Add(new Temperature("Auxiliary", 1));
moel@152
   917
              t.Add(new Temperature("System", 2));
moel@153
   918
              f.Add(new Fan("System Fan", 0));
moel@153
   919
              f.Add(new Fan("CPU Fan", 1));
moel@153
   920
              f.Add(new Fan("Auxiliary Fan", 2));
moel@153
   921
              f.Add(new Fan("CPU Fan #2", 3));
moel@153
   922
              f.Add(new Fan("Auxiliary Fan #2", 4));
moel@152
   923
              break;
moel@152
   924
          } 
moel@130
   925
          break;
moel@130
   926
        case Chip.W83627HF: 
moel@130
   927
        case Chip.W83627THF: 
moel@130
   928
        case Chip.W83687THF:
moel@130
   929
          v.Add(new Voltage("CPU VCore", 0));
moel@130
   930
          v.Add(new Voltage("Voltage #2", 1, true));
moel@130
   931
          v.Add(new Voltage("Voltage #3", 2, true));
moel@195
   932
          v.Add(new Voltage("AVCC", 3, 34, 51));
moel@130
   933
          v.Add(new Voltage("Voltage #5", 4, true));
moel@195
   934
          v.Add(new Voltage("5VSB", 5, 34, 51));
moel@130
   935
          v.Add(new Voltage("VBAT", 6));
moel@130
   936
          t.Add(new Temperature("CPU", 0));
moel@130
   937
          t.Add(new Temperature("Auxiliary", 1));
moel@130
   938
          t.Add(new Temperature("System", 2));
moel@153
   939
          f.Add(new Fan("System Fan", 0));
moel@153
   940
          f.Add(new Fan("CPU Fan", 1));
moel@153
   941
          f.Add(new Fan("Auxiliary Fan", 2));
moel@130
   942
          break;
moel@245
   943
        case Chip.NCT6771F:
moel@265
   944
        case Chip.NCT6776F:
moel@265
   945
          switch (manufacturer) {
moel@265
   946
            case Manufacturer.ASUS:
moel@265
   947
              switch (model) {
moel@312
   948
                case Model.P8P67: // NCT6776F
moel@311
   949
                case Model.P8P67_EVO: // NCT6776F
moel@265
   950
                case Model.P8P67_PRO: // NCT6776F
moel@265
   951
                  v.Add(new Voltage("CPU VCore", 0));
moel@310
   952
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@310
   953
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   954
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@310
   955
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@310
   956
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@265
   957
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@310
   958
                  t.Add(new Temperature("CPU", 0));
moel@276
   959
                  t.Add(new Temperature("Auxiliary", 2));
moel@310
   960
                  t.Add(new Temperature("Motherboard", 3));
moel@310
   961
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@265
   962
                  f.Add(new Fan("CPU Fan", 1));
moel@310
   963
                  f.Add(new Fan("Power Fan", 2));
moel@310
   964
                  f.Add(new Fan("Chassis Fan #2", 3));
moel@323
   965
                  c.Add(new Ctrl("Chassis Fan #2", 0));
moel@323
   966
                  c.Add(new Ctrl("CPU Fan", 1));
moel@323
   967
                  c.Add(new Ctrl("Chassis Fan #1", 2));
moel@265
   968
                  break;
moel@276
   969
                case Model.P8P67_M_PRO: // NCT6776F
moel@276
   970
                  v.Add(new Voltage("CPU VCore", 0));
moel@276
   971
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@276
   972
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@310
   973
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@276
   974
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@276
   975
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@276
   976
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@276
   977
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@276
   978
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@276
   979
                  t.Add(new Temperature("CPU", 0));
moel@276
   980
                  t.Add(new Temperature("Motherboard", 3));
moel@276
   981
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@276
   982
                  f.Add(new Fan("CPU Fan", 1));
moel@276
   983
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@276
   984
                  f.Add(new Fan("Power Fan", 3));
moel@276
   985
                  f.Add(new Fan("Auxiliary Fan", 4));
moel@276
   986
                  break;
moel@337
   987
                case Model.P8Z68_V_PRO: // NCT6776F
moel@337
   988
                  v.Add(new Voltage("CPU VCore", 0));
moel@337
   989
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@337
   990
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@337
   991
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@337
   992
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@337
   993
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@337
   994
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@337
   995
                  t.Add(new Temperature("CPU", 0));
moel@337
   996
                  t.Add(new Temperature("Auxiliary", 2));
moel@337
   997
                  t.Add(new Temperature("Motherboard", 3));
moel@337
   998
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@337
   999
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@337
  1000
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@337
  1001
                    c.Add(new Ctrl("Fan #" + (i + 1), i));
moel@337
  1002
                  break;
moel@332
  1003
                case Model.P9X79: // NCT6776F
moel@332
  1004
                  v.Add(new Voltage("CPU VCore", 0));
moel@332
  1005
                  v.Add(new Voltage("+12V", 1, 11, 1));
moel@332
  1006
                  v.Add(new Voltage("Analog +3.3V", 2, 34, 34));
moel@332
  1007
                  v.Add(new Voltage("+3.3V", 3, 34, 34));
moel@332
  1008
                  v.Add(new Voltage("+5V", 4, 12, 3));
moel@332
  1009
                  v.Add(new Voltage("Standby +3.3V", 7, 34, 34));
moel@332
  1010
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@332
  1011
                  t.Add(new Temperature("CPU", 0));
moel@332
  1012
                  t.Add(new Temperature("Motherboard", 3));
moel@332
  1013
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@332
  1014
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
  1015
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
  1016
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@332
  1017
                  break;
moel@265
  1018
                default:
moel@265
  1019
                  v.Add(new Voltage("CPU VCore", 0));
moel@265
  1020
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@265
  1021
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
  1022
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
  1023
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@265
  1024
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@265
  1025
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@265
  1026
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
  1027
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@354
  1028
                  t.Add(new Temperature("CPU Core", 0));                  
moel@354
  1029
                  t.Add(new Temperature("Temperature #1", 1));
moel@354
  1030
                  t.Add(new Temperature("Temperature #2", 2));
moel@354
  1031
                  t.Add(new Temperature("Temperature #3", 3));
moel@265
  1032
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
  1033
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
  1034
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
  1035
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@265
  1036
                  break;
moel@265
  1037
              }
moel@265
  1038
              break;
moel@265
  1039
            default:
moel@265
  1040
              v.Add(new Voltage("CPU VCore", 0));
moel@265
  1041
              v.Add(new Voltage("Voltage #2", 1, true));
moel@265
  1042
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@265
  1043
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@265
  1044
              v.Add(new Voltage("Voltage #5", 4, true));
moel@265
  1045
              v.Add(new Voltage("Voltage #6", 5, true));
moel@265
  1046
              v.Add(new Voltage("Voltage #7", 6, true));
moel@265
  1047
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@265
  1048
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@354
  1049
              t.Add(new Temperature("CPU Core", 0));
moel@354
  1050
              t.Add(new Temperature("Temperature #1", 1));
moel@354
  1051
              t.Add(new Temperature("Temperature #2", 2));
moel@354
  1052
              t.Add(new Temperature("Temperature #3", 3));
moel@265
  1053
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@265
  1054
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@383
  1055
              for (int i = 0; i < superIO.Controls.Length; i++)
moel@383
  1056
                c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@265
  1057
              break;
moel@265
  1058
          }
moel@245
  1059
          break;
moel@356
  1060
        case Chip.NCT6779D:
moel@359
  1061
          switch (manufacturer) {
moel@359
  1062
            case Manufacturer.ASUS:
moel@359
  1063
              switch (model) {
moel@359
  1064
                case Model.P8Z77_V:
moel@359
  1065
                  v.Add(new Voltage("CPU VCore", 0));
moel@359
  1066
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@359
  1067
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@359
  1068
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@359
  1069
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@359
  1070
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@359
  1071
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@359
  1072
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@359
  1073
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@359
  1074
                  v.Add(new Voltage("VTT", 9));
moel@359
  1075
                  v.Add(new Voltage("Voltage #11", 10, true));
moel@359
  1076
                  v.Add(new Voltage("Voltage #12", 11, true));
moel@359
  1077
                  v.Add(new Voltage("Voltage #13", 12, true));
moel@359
  1078
                  v.Add(new Voltage("Voltage #14", 13, true));
moel@359
  1079
                  v.Add(new Voltage("Voltage #15", 14, true));
moel@359
  1080
                  t.Add(new Temperature("CPU Core", 0));
moel@359
  1081
                  t.Add(new Temperature("Auxiliary", 1));
moel@359
  1082
                  t.Add(new Temperature("Motherboard", 2));
moel@359
  1083
                  f.Add(new Fan("Chassis Fan #1", 0));
moel@359
  1084
                  f.Add(new Fan("CPU Fan", 1));
moel@359
  1085
                  f.Add(new Fan("Chassis Fan #2", 2));
moel@359
  1086
                  f.Add(new Fan("Chassis Fan #3", 3));
moel@359
  1087
                  c.Add(new Ctrl("Chassis Fan #1", 0));
moel@359
  1088
                  c.Add(new Ctrl("CPU  Fan", 1));
moel@359
  1089
                  c.Add(new Ctrl("Chassis Fan #2", 2));
moel@359
  1090
                  c.Add(new Ctrl("Chassis Fan #3", 3));
moel@359
  1091
                  break;
moel@368
  1092
                default:
moel@368
  1093
                  v.Add(new Voltage("CPU VCore", 0));
moel@368
  1094
                  v.Add(new Voltage("Voltage #2", 1, true));
moel@368
  1095
                  v.Add(new Voltage("AVCC", 2, 34, 34));
moel@368
  1096
                  v.Add(new Voltage("3VCC", 3, 34, 34));
moel@368
  1097
                  v.Add(new Voltage("Voltage #5", 4, true));
moel@368
  1098
                  v.Add(new Voltage("Voltage #6", 5, true));
moel@368
  1099
                  v.Add(new Voltage("Voltage #7", 6, true));
moel@368
  1100
                  v.Add(new Voltage("3VSB", 7, 34, 34));
moel@368
  1101
                  v.Add(new Voltage("VBAT", 8, 34, 34));
moel@368
  1102
                  v.Add(new Voltage("VTT", 9));
moel@368
  1103
                  v.Add(new Voltage("Voltage #11", 10, true));
moel@368
  1104
                  v.Add(new Voltage("Voltage #12", 11, true));
moel@368
  1105
                  v.Add(new Voltage("Voltage #13", 12, true));
moel@368
  1106
                  v.Add(new Voltage("Voltage #14", 13, true));
moel@368
  1107
                  v.Add(new Voltage("Voltage #15", 14, true));
moel@368
  1108
                  t.Add(new Temperature("CPU Core", 0));
moel@368
  1109
                  t.Add(new Temperature("Temperature #1", 1));
moel@368
  1110
                  t.Add(new Temperature("Temperature #2", 2));
moel@368
  1111
                  t.Add(new Temperature("Temperature #3", 3));
moel@368
  1112
                  t.Add(new Temperature("Temperature #4", 4));
moel@368
  1113
                  t.Add(new Temperature("Temperature #5", 5));
moel@368
  1114
                  t.Add(new Temperature("Temperature #6", 6));
moel@368
  1115
                  for (int i = 0; i < superIO.Fans.Length; i++)
moel@368
  1116
                    f.Add(new Fan("Fan #" + (i + 1), i));
moel@368
  1117
                  for (int i = 0; i < superIO.Controls.Length; i++)
moel@368
  1118
                    c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@368
  1119
                  break;
moel@359
  1120
              }
moel@359
  1121
              break;
moel@359
  1122
            default:
moel@359
  1123
              v.Add(new Voltage("CPU VCore", 0));
moel@359
  1124
              v.Add(new Voltage("Voltage #2", 1, true));
moel@359
  1125
              v.Add(new Voltage("AVCC", 2, 34, 34));
moel@359
  1126
              v.Add(new Voltage("3VCC", 3, 34, 34));
moel@359
  1127
              v.Add(new Voltage("Voltage #5", 4, true));
moel@359
  1128
              v.Add(new Voltage("Voltage #6", 5, true));
moel@359
  1129
              v.Add(new Voltage("Voltage #7", 6, true));
moel@359
  1130
              v.Add(new Voltage("3VSB", 7, 34, 34));
moel@359
  1131
              v.Add(new Voltage("VBAT", 8, 34, 34));
moel@359
  1132
              v.Add(new Voltage("VTT", 9));
moel@359
  1133
              v.Add(new Voltage("Voltage #11", 10, true));
moel@359
  1134
              v.Add(new Voltage("Voltage #12", 11, true));
moel@359
  1135
              v.Add(new Voltage("Voltage #13", 12, true));
moel@359
  1136
              v.Add(new Voltage("Voltage #14", 13, true));
moel@359
  1137
              v.Add(new Voltage("Voltage #15", 14, true));
moel@359
  1138
              t.Add(new Temperature("CPU Core", 0));
moel@359
  1139
              t.Add(new Temperature("Temperature #1", 1));
moel@359
  1140
              t.Add(new Temperature("Temperature #2", 2));
moel@359
  1141
              t.Add(new Temperature("Temperature #3", 3));
moel@359
  1142
              t.Add(new Temperature("Temperature #4", 4));
moel@359
  1143
              t.Add(new Temperature("Temperature #5", 5));
moel@359
  1144
              t.Add(new Temperature("Temperature #6", 6));
moel@359
  1145
              for (int i = 0; i < superIO.Fans.Length; i++)
moel@359
  1146
                f.Add(new Fan("Fan #" + (i + 1), i));
moel@359
  1147
              for (int i = 0; i < superIO.Controls.Length; i++)
moel@359
  1148
                c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@359
  1149
              break;
moel@359
  1150
          }
moel@356
  1151
          break;
moel@130
  1152
        default:
moel@130
  1153
          for (int i = 0; i < superIO.Voltages.Length; i++)
moel@130
  1154
            v.Add(new Voltage("Voltage #" + (i + 1), i, true));
moel@130
  1155
          for (int i = 0; i < superIO.Temperatures.Length; i++)
moel@130
  1156
            t.Add(new Temperature("Temperature #" + (i + 1), i));
moel@130
  1157
          for (int i = 0; i < superIO.Fans.Length; i++)
moel@130
  1158
            f.Add(new Fan("Fan #" + (i + 1), i));
moel@323
  1159
          for (int i = 0; i < superIO.Controls.Length; i++)
moel@323
  1160
            c.Add(new Ctrl("Fan Control #" + (i + 1), i));
moel@130
  1161
          break;
moel@130
  1162
      }
moel@130
  1163
moel@195
  1164
      const string formula = "Voltage = value + (value - Vf) * Ri / Rf.";
moel@130
  1165
      foreach (Voltage voltage in v) 
moel@130
  1166
        if (voltage.Index < superIO.Voltages.Length) {
moel@130
  1167
          Sensor sensor = new Sensor(voltage.Name, voltage.Index, 
moel@195
  1168
            voltage.Hidden, SensorType.Voltage, this, new [] {
moel@130
  1169
            new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + 
moel@130
  1170
              formula, voltage.Ri),
moel@130
  1171
            new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + 
moel@130
  1172
              formula, voltage.Rf),
moel@130
  1173
            new ParameterDescription("Vf [V]", "Reference voltage.\n" + 
moel@130
  1174
              formula, voltage.Vf)
moel@165
  1175
            }, settings);
moel@130
  1176
          voltages.Add(sensor);
moel@130
  1177
      }
moel@130
  1178
moel@130
  1179
      foreach (Temperature temperature in t) 
moel@130
  1180
        if (temperature.Index < superIO.Temperatures.Length) {
moel@134
  1181
        Sensor sensor = new Sensor(temperature.Name, temperature.Index,
moel@195
  1182
          SensorType.Temperature, this, new [] {
moel@130
  1183
          new ParameterDescription("Offset [°C]", "Temperature offset.", 0)
moel@165
  1184
        }, settings);
moel@130
  1185
        temperatures.Add(sensor);
moel@130
  1186
      }
moel@130
  1187
moel@130
  1188
      foreach (Fan fan in f)
moel@130
  1189
        if (fan.Index < superIO.Fans.Length) {
moel@134
  1190
          Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan,
moel@165
  1191
            this, settings);
moel@130
  1192
          fans.Add(sensor);
moel@130
  1193
        }
moel@323
  1194
moel@323
  1195
      foreach (Ctrl ctrl in c) {
moel@323
  1196
        int index = ctrl.Index;
moel@323
  1197
        if (index < superIO.Controls.Length) {
moel@323
  1198
          Sensor sensor = new Sensor(ctrl.Name, index, SensorType.Control,
moel@323
  1199
            this, settings);
moel@323
  1200
          Control control = new Control(sensor, settings, 0, 100);
moel@323
  1201
          control.ControlModeChanged += (cc) => {
moel@323
  1202
            if (cc.ControlMode == ControlMode.Default) {
moel@323
  1203
              superIO.SetControl(index, null);
moel@323
  1204
            } else {
moel@323
  1205
              superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55));
moel@323
  1206
            }
moel@323
  1207
          };
moel@323
  1208
          control.SoftwareControlValueChanged += (cc) => {
moel@323
  1209
            if (cc.ControlMode == ControlMode.Software) 
moel@323
  1210
              superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55));
moel@323
  1211
          };
moel@323
  1212
          if (control.ControlMode == ControlMode.Software) 
moel@323
  1213
            superIO.SetControl(index, (byte)(control.SoftwareValue * 2.55));
moel@323
  1214
          sensor.Control = control;
moel@323
  1215
          controls.Add(sensor);
moel@389
  1216
          ActivateSensor(sensor);
moel@323
  1217
        }
moel@323
  1218
      }
moel@130
  1219
    }
moel@130
  1220
moel@165
  1221
    public override HardwareType HardwareType {
moel@165
  1222
      get { return HardwareType.SuperIO; }
moel@130
  1223
    }
moel@130
  1224
moel@176
  1225
    public override IHardware Parent {
moel@176
  1226
      get { return mainboard; }
moel@176
  1227
    }
moel@176
  1228
moel@130
  1229
moel@130
  1230
    public override string GetReport() {
moel@130
  1231
      return superIO.GetReport();
moel@130
  1232
    }
moel@130
  1233
moel@130
  1234
    public override void Update() {
moel@130
  1235
      superIO.Update();
moel@130
  1236
moel@130
  1237
      foreach (Sensor sensor in voltages) {
moel@228
  1238
        float? value = readVoltage(sensor.Index);
moel@130
  1239
        if (value.HasValue) {
moel@130
  1240
          sensor.Value = value + (value - sensor.Parameters[2].Value) *
moel@130
  1241
            sensor.Parameters[0].Value / sensor.Parameters[1].Value;
moel@130
  1242
          ActivateSensor(sensor);
moel@130
  1243
        }
moel@130
  1244
      }
moel@130
  1245
moel@130
  1246
      foreach (Sensor sensor in temperatures) {
moel@228
  1247
        float? value = readTemperature(sensor.Index);
moel@130
  1248
        if (value.HasValue) {
moel@130
  1249
          sensor.Value = value + sensor.Parameters[0].Value;
moel@130
  1250
          ActivateSensor(sensor);
moel@130
  1251
        }
moel@130
  1252
      }
moel@130
  1253
moel@130
  1254
      foreach (Sensor sensor in fans) {
moel@228
  1255
        float? value = readFan(sensor.Index);
moel@130
  1256
        if (value.HasValue) {
moel@130
  1257
          sensor.Value = value;
moel@130
  1258
          if (value.Value > 0)
moel@130
  1259
            ActivateSensor(sensor);
moel@130
  1260
        }
moel@130
  1261
      }
moel@228
  1262
moel@323
  1263
      foreach (Sensor sensor in controls) {
moel@323
  1264
        float? value = readControl(sensor.Index);
moel@389
  1265
        sensor.Value = value;                
moel@323
  1266
      }
moel@323
  1267
moel@228
  1268
      postUpdate();
moel@130
  1269
    }
moel@130
  1270
moel@323
  1271
    public override void Close() {
moel@323
  1272
      foreach (Sensor sensor in controls) {
moel@323
  1273
        // restore all controls back to default
moel@323
  1274
        superIO.SetControl(sensor.Index, null);
moel@323
  1275
      }
moel@323
  1276
      base.Close();
moel@323
  1277
    }
moel@323
  1278
moel@130
  1279
    private class Voltage {
moel@130
  1280
      public readonly string Name;
moel@130
  1281
      public readonly int Index;
moel@130
  1282
      public readonly float Ri;
moel@130
  1283
      public readonly float Rf;
moel@130
  1284
      public readonly float Vf;
moel@130
  1285
      public readonly bool Hidden;
moel@130
  1286
moel@202
  1287
      public Voltage(string name, int index) :
moel@202
  1288
        this(name, index, false) { }
moel@202
  1289
      
moel@130
  1290
      public Voltage(string name, int index, bool hidden) :
moel@130
  1291
        this(name, index, 0, 1, 0, hidden) { }
moel@202
  1292
      
moel@202
  1293
      public Voltage(string name, int index, float ri, float rf) :
moel@202
  1294
        this(name, index, ri, rf, 0, false) { }
moel@202
  1295
      
moel@202
  1296
      // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) 
moel@202
  1297
      
moel@195
  1298
      public Voltage(string name, int index, 
moel@202
  1299
        float ri, float rf, float vf, bool hidden) 
moel@195
  1300
      {
moel@130
  1301
        this.Name = name;
moel@130
  1302
        this.Index = index;
moel@130
  1303
        this.Ri = ri;
moel@130
  1304
        this.Rf = rf;
moel@130
  1305
        this.Vf = vf;
moel@130
  1306
        this.Hidden = hidden;
moel@130
  1307
      }
moel@130
  1308
    }
moel@130
  1309
moel@130
  1310
    private class Temperature {
moel@130
  1311
      public readonly string Name;
moel@130
  1312
      public readonly int Index;
moel@130
  1313
moel@167
  1314
      public Temperature(string name, int index) {
moel@130
  1315
        this.Name = name;
moel@130
  1316
        this.Index = index;
moel@130
  1317
      }
moel@130
  1318
    }
moel@130
  1319
moel@130
  1320
    private class Fan {
moel@130
  1321
      public readonly string Name;
moel@130
  1322
      public readonly int Index;
moel@130
  1323
moel@130
  1324
      public Fan(string name, int index) {
moel@130
  1325
        this.Name = name;
moel@130
  1326
        this.Index = index;
moel@130
  1327
      }
moel@130
  1328
    }
moel@323
  1329
moel@323
  1330
    private class Ctrl {
moel@323
  1331
      public readonly string Name;
moel@323
  1332
      public readonly int Index;
moel@323
  1333
moel@323
  1334
      public Ctrl(string name, int index) {
moel@323
  1335
        this.Name = name;
moel@323
  1336
        this.Index = index;
moel@323
  1337
      }
moel@323
  1338
    }
moel@130
  1339
  }
moel@130
  1340
}