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