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