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