moel@135: /* moel@130: moel@344: This Source Code Form is subject to the terms of the Mozilla Public moel@344: License, v. 2.0. If a copy of the MPL was not distributed with this moel@344: file, You can obtain one at http://mozilla.org/MPL/2.0/. moel@130: moel@428: Copyright (C) 2009-2014 Michael Möller moel@344: moel@130: */ moel@130: moel@228: using System; moel@130: using System.Collections.Generic; moel@228: using System.Threading; moel@130: using OpenHardwareMonitor.Hardware.LPC; moel@130: moel@130: namespace OpenHardwareMonitor.Hardware.Mainboard { moel@416: internal sealed class SuperIOHardware : Hardware { moel@130: moel@195: private readonly Mainboard mainboard; moel@195: private readonly ISuperIO superIO; moel@130: moel@195: private readonly List voltages = new List(); moel@195: private readonly List temperatures = new List(); moel@195: private readonly List fans = new List(); moel@323: private readonly List controls = new List(); moel@167: moel@228: private delegate float? ReadValueDelegate(int index); moel@228: private delegate void UpdateDelegate(); moel@228: moel@228: // delegates for mainboard specific sensor reading code moel@228: private readonly ReadValueDelegate readVoltage; moel@228: private readonly ReadValueDelegate readTemperature; moel@228: private readonly ReadValueDelegate readFan; moel@323: private readonly ReadValueDelegate readControl; moel@228: moel@228: // delegate for post update mainboard specific code moel@228: private readonly UpdateDelegate postUpdate; moel@228: moel@228: // mainboard specific mutex moel@228: private readonly Mutex mutex; moel@228: moel@176: public SuperIOHardware(Mainboard mainboard, ISuperIO superIO, moel@176: Manufacturer manufacturer, Model model, ISettings settings) moel@275: : base(ChipName.GetName(superIO.Chip), new Identifier("lpc", moel@416: superIO.Chip.ToString().ToLowerInvariant()), settings) moel@130: { moel@176: this.mainboard = mainboard; moel@130: this.superIO = superIO; moel@130: moel@416: IList v; moel@416: IList t; moel@416: IList f; moel@416: IList c; moel@416: GetBoardSpecificConfiguration(superIO, manufacturer, model, moel@416: out v, out t, out f, out c, moel@416: out readVoltage, out readTemperature, out readFan, out readControl, moel@416: out postUpdate, out mutex); moel@228: moel@416: CreateVoltageSensors(superIO, settings, v); moel@416: CreateTemperatureSensors(superIO, settings, t); moel@416: CreateFanSensors(superIO, settings, f); moel@416: CreateControlSensors(superIO, settings, c); moel@416: } moel@228: moel@416: private void CreateControlSensors(ISuperIO superIO, ISettings settings, moel@416: IList c) moel@416: { moel@416: foreach (Ctrl ctrl in c) { moel@416: int index = ctrl.Index; moel@416: if (index < superIO.Controls.Length) { moel@416: Sensor sensor = new Sensor(ctrl.Name, index, SensorType.Control, moel@416: this, settings); moel@416: Control control = new Control(sensor, settings, 0, 100); moel@416: control.ControlModeChanged += (cc) => { moel@428: switch (cc.ControlMode) { moel@428: case ControlMode.Undefined: moel@428: return; moel@428: case ControlMode.Default: moel@428: superIO.SetControl(index, null); moel@428: break; moel@428: case ControlMode.Software: moel@428: superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55)); moel@428: break; moel@428: default: moel@428: return; moel@416: } moel@416: }; moel@416: control.SoftwareControlValueChanged += (cc) => { moel@416: if (cc.ControlMode == ControlMode.Software) moel@416: superIO.SetControl(index, (byte)(cc.SoftwareValue * 2.55)); moel@416: }; moel@428: moel@428: switch (control.ControlMode) { moel@428: case ControlMode.Undefined: moel@428: break; moel@428: case ControlMode.Default: moel@428: superIO.SetControl(index, null); moel@428: break; moel@428: case ControlMode.Software: moel@428: superIO.SetControl(index, (byte)(control.SoftwareValue * 2.55)); moel@428: break; moel@428: default: moel@428: break; moel@428: } moel@428: moel@416: sensor.Control = control; moel@416: controls.Add(sensor); moel@416: ActivateSensor(sensor); moel@416: } moel@416: } moel@416: } moel@416: moel@416: private void CreateFanSensors(ISuperIO superIO, ISettings settings, moel@416: IList f) moel@416: { moel@416: foreach (Fan fan in f) { moel@416: if (fan.Index < superIO.Fans.Length) { moel@416: Sensor sensor = new Sensor(fan.Name, fan.Index, SensorType.Fan, moel@416: this, settings); moel@416: fans.Add(sensor); moel@416: } moel@416: } moel@416: } moel@416: moel@416: private void CreateTemperatureSensors(ISuperIO superIO, ISettings settings, moel@416: IList t) moel@416: { moel@416: foreach (Temperature temperature in t) moel@416: if (temperature.Index < superIO.Temperatures.Length) { moel@416: Sensor sensor = new Sensor(temperature.Name, temperature.Index, moel@416: SensorType.Temperature, this, new[] { moel@416: new ParameterDescription("Offset [°C]", "Temperature offset.", 0) moel@416: }, settings); moel@416: temperatures.Add(sensor); moel@416: } moel@416: } moel@416: moel@416: private void CreateVoltageSensors(ISuperIO superIO, ISettings settings, moel@416: IList v) moel@416: { moel@416: const string formula = "Voltage = value + (value - Vf) * Ri / Rf."; moel@416: foreach (Voltage voltage in v) moel@416: if (voltage.Index < superIO.Voltages.Length) { moel@416: Sensor sensor = new Sensor(voltage.Name, voltage.Index, moel@416: voltage.Hidden, SensorType.Voltage, this, new[] { moel@416: new ParameterDescription("Ri [kΩ]", "Input resistance.\n" + moel@416: formula, voltage.Ri), moel@416: new ParameterDescription("Rf [kΩ]", "Reference resistance.\n" + moel@416: formula, voltage.Rf), moel@416: new ParameterDescription("Vf [V]", "Reference voltage.\n" + moel@416: formula, voltage.Vf) moel@416: }, settings); moel@416: voltages.Add(sensor); moel@416: } moel@416: } moel@416: moel@416: private static void GetBoardSpecificConfiguration(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, out IList v, moel@416: out IList t, out IList f, out IList c, moel@416: out ReadValueDelegate readVoltage, moel@416: out ReadValueDelegate readTemperature, moel@416: out ReadValueDelegate readFan, moel@416: out ReadValueDelegate readControl, moel@416: out UpdateDelegate postUpdate, out Mutex mutex) { moel@416: readVoltage = (index) => superIO.Voltages[index]; moel@416: readTemperature = (index) => superIO.Temperatures[index]; moel@416: readFan = (index) => superIO.Fans[index]; moel@416: readControl = (index) => superIO.Controls[index]; moel@416: moel@416: postUpdate = () => { }; moel@416: mutex = null; moel@416: moel@416: v = new List(); moel@416: t = new List(); moel@416: f = new List(); moel@416: c = new List(); moel@130: moel@130: switch (superIO.Chip) { moel@353: case Chip.IT8705F: moel@130: case Chip.IT8712F: moel@130: case Chip.IT8716F: moel@130: case Chip.IT8718F: moel@416: case Chip.IT8720F: moel@416: case Chip.IT8726F: moel@416: GetITEConfigurationsA(superIO, manufacturer, model, v, t, f, c, moel@416: ref readFan, ref postUpdate, ref mutex); moel@416: break; moel@416: moel@416: case Chip.IT8721F: moel@416: case Chip.IT8728F: moel@416: case Chip.IT8771E: moel@416: case Chip.IT8772E: moel@416: GetITEConfigurationsB(superIO, manufacturer, model, v, t, f, c); moel@416: break; moel@416: moel@416: case Chip.F71858: moel@416: v.Add(new Voltage("VCC3V", 0, 150, 150)); moel@416: v.Add(new Voltage("VSB3V", 1, 150, 150)); moel@416: v.Add(new Voltage("Battery", 2, 150, 150)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: break; moel@416: case Chip.F71862: moel@416: case Chip.F71869: moel@416: case Chip.F71869A: moel@416: case Chip.F71882: moel@416: case Chip.F71889AD: moel@416: case Chip.F71889ED: moel@416: case Chip.F71889F: moel@416: case Chip.F71808E: moel@416: GetFintekConfiguration(superIO, manufacturer, model, v, t, f); moel@416: break; moel@416: moel@416: case Chip.W83627EHF: moel@416: GetWinbondConfigurationEHF(manufacturer, model, v, t, f); moel@416: break; moel@416: case Chip.W83627DHG: moel@416: case Chip.W83627DHGP: moel@416: case Chip.W83667HG: moel@416: case Chip.W83667HGB: moel@416: GetWinbondConfigurationHG(manufacturer, model, v, t, f); moel@416: break; moel@416: case Chip.W83627HF: moel@416: case Chip.W83627THF: moel@416: case Chip.W83687THF: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("AVCC", 3, 34, 51)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("5VSB", 5, 34, 51)); moel@416: v.Add(new Voltage("VBAT", 6)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: break; moel@416: case Chip.NCT6771F: moel@416: case Chip.NCT6776F: moel@416: GetNuvotonConfigurationF(superIO, manufacturer, model, v, t, f, c); moel@416: break; moel@416: case Chip.NCT6779D: moel@416: case Chip.NCT6791D: moel@416: GetNuvotonConfigurationD(superIO, manufacturer, model, v, t, f, c); moel@416: break; moel@416: default: moel@416: GetDefaultConfiguration(superIO, v, t, f, c); moel@416: break; moel@416: } moel@416: } moel@416: moel@416: private static void GetDefaultConfiguration(ISuperIO superIO, moel@416: IList v, IList t, IList f, IList c) moel@416: { moel@416: for (int i = 0; i < superIO.Voltages.Length; i++) moel@416: v.Add(new Voltage("Voltage #" + (i + 1), i, true)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: } moel@416: moel@416: private static void GetITEConfigurationsA(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, moel@416: IList v, IList t, IList f, IList c, moel@416: ref ReadValueDelegate readFan, ref UpdateDelegate postUpdate, moel@416: ref Mutex mutex) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ASUS: moel@416: switch (model) { moel@416: case Model.Crosshair_III_Formula: // IT8720F moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@133: break; moel@416: case Model.M2N_SLI_DELUXE: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+3.3V", 1)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 30, 10)); moel@416: v.Add(new Voltage("+5VSB", 7, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Chassis Fan #1", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@221: break; moel@416: case Model.M4A79XTD_EVO: // IT8720F moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Chassis Fan #1", 1)); moel@416: f.Add(new Fan("Chassis Fan #2", 2)); moel@130: break; moel@130: default: moel@130: v.Add(new Voltage("CPU VCore", 0)); moel@130: v.Add(new Voltage("Voltage #2", 1, true)); moel@130: v.Add(new Voltage("Voltage #3", 2, true)); moel@130: v.Add(new Voltage("Voltage #4", 3, true)); moel@130: v.Add(new Voltage("Voltage #5", 4, true)); moel@130: v.Add(new Voltage("Voltage #6", 5, true)); moel@130: v.Add(new Voltage("Voltage #7", 6, true)); moel@130: v.Add(new Voltage("Voltage #8", 7, true)); moel@130: v.Add(new Voltage("VBat", 8)); moel@130: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@130: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@130: for (int i = 0; i < superIO.Fans.Length; i++) moel@130: f.Add(new Fan("Fan #" + (i + 1), i)); moel@383: for (int i = 0; i < superIO.Controls.Length; i++) moel@383: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@130: break; moel@130: } moel@130: break; moel@170: moel@416: case Manufacturer.ASRock: moel@416: switch (model) { moel@416: case Model.P55_Deluxe: // IT8720F moel@416: GetASRockConfiguration(superIO, v, t, f, moel@416: ref readFan, ref postUpdate, ref mutex); moel@177: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Voltage #4", 3, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Voltage #8", 7, true)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@278: break; moel@416: }; moel@416: break; moel@416: moel@416: case Manufacturer.DFI: moel@416: switch (model) { moel@416: case Model.LP_BI_P45_T2RS_Elite: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("FSB VTT", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 30, 10)); moel@416: v.Add(new Voltage("NB Core", 5)); moel@416: v.Add(new Voltage("VDIMM", 6)); moel@416: v.Add(new Voltage("+5VSB", 7, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("System", 1)); moel@416: t.Add(new Temperature("Chipset", 2)); moel@416: f.Add(new Fan("Fan #1", 0)); moel@416: f.Add(new Fan("Fan #2", 1)); moel@416: f.Add(new Fan("Fan #3", 2)); moel@416: break; moel@416: case Model.LP_DK_P55_T3eH9: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("VTT", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 30, 10)); moel@416: v.Add(new Voltage("CPU PLL", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("+5VSB", 7, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("Chipset", 0)); moel@416: t.Add(new Temperature("CPU PWM", 1)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("Fan #1", 0)); moel@416: f.Add(new Fan("Fan #2", 1)); moel@416: f.Add(new Fan("Fan #3", 2)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("VTT", 1, true)); moel@416: v.Add(new Voltage("+3.3V", 2, true)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true)); moel@416: v.Add(new Voltage("+12V", 4, 30, 10, 0, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("DRAM", 6, true)); moel@416: v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0, true)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: break; moel@416: moel@416: case Manufacturer.Gigabyte: moel@416: switch (model) { moel@416: case Model._965P_S3: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 7, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: break; moel@416: case Model.EP45_DS3R: // IT8718F moel@416: case Model.EP45_UD3R: moel@416: case Model.X38_DS5: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 7, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #2", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #1", 3)); moel@416: break; moel@416: case Model.EX58_EXTREME: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: t.Add(new Temperature("Northbridge", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #2", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #1", 3)); moel@416: break; moel@416: case Model.P35_DS3: // IT8718F moel@416: case Model.P35_DS3L: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 7, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("System Fan #2", 2)); moel@416: f.Add(new Fan("Power Fan", 3)); moel@416: break; moel@416: case Model.P55_UD4: // IT8720F moel@416: case Model.P55A_UD3: // IT8720F moel@416: case Model.P55M_UD4: // IT8720F moel@416: case Model.H55_USB3: // IT8720F moel@416: case Model.EX58_UD3R: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 5, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #2", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #1", 3)); moel@416: break; moel@416: case Model.H55N_USB3: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 5, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: break; moel@416: case Model.G41M_Combo: // IT8718F moel@416: case Model.G41MT_S2: // IT8718F moel@416: case Model.G41MT_S2P: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 7, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: break; moel@416: case Model.GA_970A_UD3: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("System Fan #2", 2)); moel@416: f.Add(new Fan("Power Fan", 4)); moel@416: c.Add(new Ctrl("PWM 1", 0)); moel@416: c.Add(new Ctrl("PWM 2", 1)); moel@416: c.Add(new Ctrl("PWM 3", 2)); moel@416: break; moel@416: case Model.GA_MA770T_UD3: // IT8720F moel@416: case Model.GA_MA770T_UD3P: // IT8720F moel@416: case Model.GA_MA790X_UD3P: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("System Fan #2", 2)); moel@416: f.Add(new Fan("Power Fan", 3)); moel@416: break; moel@416: case Model.GA_MA78LM_S2H: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: t.Add(new Temperature("VRM", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("System Fan #2", 2)); moel@416: f.Add(new Fan("Power Fan", 3)); moel@416: break; moel@416: case Model.GA_MA785GM_US2H: // IT8718F moel@416: case Model.GA_MA785GMT_UD2H: // IT8718F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 4, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: f.Add(new Fan("NB Fan", 2)); moel@416: break; moel@416: case Model.X58A_UD3R: // IT8720F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10)); moel@416: v.Add(new Voltage("+12V", 5, 24.3f, 8.2f)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: t.Add(new Temperature("Northbridge", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #2", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #1", 3)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1, true)); moel@416: v.Add(new Voltage("+3.3V", 2, true)); moel@416: v.Add(new Voltage("+5V", 3, 6.8f, 10, 0, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Voltage #8", 7, true)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: break; moel@416: moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Voltage #4", 3, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Voltage #8", 7, true)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: } moel@416: moel@416: private static void GetASRockConfiguration(ISuperIO superIO, moel@416: IList v, IList t, IList f, moel@416: ref ReadValueDelegate readFan, ref UpdateDelegate postUpdate, moel@416: ref Mutex mutex) moel@416: { moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+3.3V", 2)); moel@416: v.Add(new Voltage("+12V", 4, 30, 10)); moel@416: v.Add(new Voltage("+5V", 5, 6.8f, 10)); moel@416: v.Add(new Voltage("VBat", 8)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 1)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Chassis Fan #1", 1)); moel@416: moel@416: // this mutex is also used by the official ASRock tool moel@416: mutex = new Mutex(false, "ASRockOCMark"); moel@416: moel@416: bool exclusiveAccess = false; moel@416: try { moel@416: exclusiveAccess = mutex.WaitOne(10, false); moel@416: } catch (AbandonedMutexException) { } moel@416: catch (InvalidOperationException) { } moel@416: moel@416: // only read additional fans if we get exclusive access moel@416: if (exclusiveAccess) { moel@416: moel@416: f.Add(new Fan("Chassis Fan #2", 2)); moel@416: f.Add(new Fan("Chassis Fan #3", 3)); moel@416: f.Add(new Fan("Power Fan", 4)); moel@416: moel@416: readFan = (index) => { moel@416: if (index < 2) { moel@416: return superIO.Fans[index]; moel@416: } else { moel@416: // get GPIO 80-87 moel@416: byte? gpio = superIO.ReadGPIO(7); moel@416: if (!gpio.HasValue) moel@416: return null; moel@416: moel@416: // read the last 3 fans based on GPIO 83-85 moel@416: int[] masks = { 0x05, 0x03, 0x06 }; moel@416: return (((gpio.Value >> 3) & 0x07) == moel@416: masks[index - 2]) ? superIO.Fans[2] : null; moel@416: } moel@416: }; moel@416: moel@416: int fanIndex = 0; moel@416: postUpdate = () => { moel@416: // get GPIO 80-87 moel@416: byte? gpio = superIO.ReadGPIO(7); moel@416: if (!gpio.HasValue) moel@416: return; moel@416: moel@416: // prepare the GPIO 83-85 for the next update moel@416: int[] masks = { 0x05, 0x03, 0x06 }; moel@416: superIO.WriteGPIO(7, moel@416: (byte)((gpio.Value & 0xC7) | (masks[fanIndex] << 3))); moel@416: fanIndex = (fanIndex + 1) % 3; moel@416: }; moel@416: } moel@416: } moel@416: moel@416: private static void GetITEConfigurationsB(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, moel@416: IList v, IList t, IList f, IList c) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ECS: moel@416: switch (model) { moel@416: case Model.A890GXM_A: // IT8721F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("VDIMM", 1)); moel@416: v.Add(new Voltage("NB Voltage", 2)); moel@416: v.Add(new Voltage("Analog +3.3V", 3, 10, 10)); moel@416: // v.Add(new Voltage("VDIMM", 6, true)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("System", 1)); moel@416: t.Add(new Temperature("Northbridge", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("Voltage #1", 0, true)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Analog +3.3V", 3, 10, 10, 0, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: break; moel@416: case Manufacturer.Gigabyte: moel@416: switch (model) { moel@416: case Model.H61M_DS2_REV_1_2: // IT8728F moel@416: case Model.H61M_USB3_B3_REV_2_0: // IT8728F moel@416: v.Add(new Voltage("VTT", 0)); moel@416: v.Add(new Voltage("+12V", 2, 30.9f, 10)); moel@416: v.Add(new Voltage("CPU VCore", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan", 1)); moel@416: break; moel@416: case Model.H67A_UD3H_B3: // IT8728F moel@416: case Model.H67A_USB3_B3: // IT8728F moel@416: v.Add(new Voltage("VTT", 0)); moel@416: v.Add(new Voltage("+5V", 1, 15, 10)); moel@416: v.Add(new Voltage("+12V", 2, 30.9f, 10)); moel@416: v.Add(new Voltage("CPU VCore", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #2", 3)); moel@416: break; moel@416: case Model.Z68A_D3H_B3: // IT8728F moel@416: v.Add(new Voltage("VTT", 0)); moel@416: v.Add(new Voltage("+3.3V", 1, 6.49f, 10)); moel@416: v.Add(new Voltage("+12V", 2, 30.9f, 10)); moel@416: v.Add(new Voltage("+5V", 3, 7.15f, 10)); moel@416: v.Add(new Voltage("CPU VCore", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #1", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #2", 3)); moel@416: break; moel@416: case Model.P67A_UD3_B3: // IT8728F moel@416: case Model.P67A_UD3R_B3: // IT8728F moel@416: case Model.P67A_UD4_B3: // IT8728F moel@416: case Model.Z68AP_D3: // IT8728F moel@416: case Model.Z68X_UD3H_B3: // IT8728F moel@416: v.Add(new Voltage("VTT", 0)); moel@416: v.Add(new Voltage("+3.3V", 1, 6.49f, 10)); moel@416: v.Add(new Voltage("+12V", 2, 30.9f, 10)); moel@416: v.Add(new Voltage("+5V", 3, 7.15f, 10)); moel@416: v.Add(new Voltage("CPU VCore", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("System Fan #2", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("System Fan #1", 3)); moel@416: break; moel@416: case Model.Z68X_UD7_B3: // IT8728F moel@416: v.Add(new Voltage("VTT", 0)); moel@416: v.Add(new Voltage("+3.3V", 1, 6.49f, 10)); moel@416: v.Add(new Voltage("+12V", 2, 30.9f, 10)); moel@416: v.Add(new Voltage("+5V", 3, 7.15f, 10)); moel@416: v.Add(new Voltage("CPU VCore", 5)); moel@416: v.Add(new Voltage("DRAM", 6)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: t.Add(new Temperature("System 3", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Power Fan", 1)); moel@416: f.Add(new Fan("System Fan #1", 2)); moel@416: f.Add(new Fan("System Fan #2", 3)); moel@416: f.Add(new Fan("System Fan #3", 4)); moel@320: break; moel@177: default: moel@177: v.Add(new Voltage("Voltage #1", 0, true)); moel@177: v.Add(new Voltage("Voltage #2", 1, true)); moel@177: v.Add(new Voltage("Voltage #3", 2, true)); moel@277: v.Add(new Voltage("Voltage #4", 3, true)); moel@177: v.Add(new Voltage("Voltage #5", 4, true)); moel@177: v.Add(new Voltage("Voltage #6", 5, true)); moel@177: v.Add(new Voltage("Voltage #7", 6, true)); moel@177: v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true)); moel@195: v.Add(new Voltage("VBat", 8, 10, 10)); moel@177: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@177: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@177: for (int i = 0; i < superIO.Fans.Length; i++) moel@177: f.Add(new Fan("Fan #" + (i + 1), i)); moel@383: for (int i = 0; i < superIO.Controls.Length; i++) moel@383: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@177: break; moel@177: } moel@170: break; moel@416: case Manufacturer.Shuttle: moel@416: switch (model) { moel@416: case Model.FH67: // IT8772E moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("DRAM", 1)); moel@416: v.Add(new Voltage("PCH VCCIO", 2)); moel@416: v.Add(new Voltage("CPU VCCIO", 3)); moel@416: v.Add(new Voltage("Graphic Voltage", 4)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: t.Add(new Temperature("System", 0)); moel@416: t.Add(new Temperature("CPU", 1)); moel@416: f.Add(new Fan("Fan #1", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("Voltage #1", 0, true)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Voltage #4", 3, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("Voltage #1", 0, true)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Voltage #4", 3, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 10, 10, 0, true)); moel@416: v.Add(new Voltage("VBat", 8, 10, 10)); moel@130: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@130: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@130: for (int i = 0; i < superIO.Fans.Length; i++) moel@130: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@130: break; moel@416: } moel@416: } moel@416: moel@416: private static void GetFintekConfiguration(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, moel@416: IList v, IList t, IList f) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.EVGA: moel@416: switch (model) { moel@416: case Model.X58_SLI_Classified: // F71882 moel@416: v.Add(new Voltage("VCC3V", 0, 150, 150)); moel@416: v.Add(new Voltage("CPU VCore", 1, 47, 100)); moel@416: v.Add(new Voltage("DIMM", 2, 47, 100)); moel@416: v.Add(new Voltage("CPU VTT", 3, 24, 100)); moel@416: v.Add(new Voltage("IOH Vcore", 4, 24, 100)); moel@416: v.Add(new Voltage("+5V", 5, 51, 12)); moel@416: v.Add(new Voltage("+12V", 6, 56, 6.8f)); moel@416: v.Add(new Voltage("3VSB", 7, 150, 150)); moel@416: v.Add(new Voltage("VBat", 8, 150, 150)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("VREG", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Power Fan", 1)); moel@416: f.Add(new Fan("Chassis Fan", 2)); moel@132: break; moel@132: default: moel@195: v.Add(new Voltage("VCC3V", 0, 150, 150)); moel@132: v.Add(new Voltage("CPU VCore", 1)); moel@132: v.Add(new Voltage("Voltage #3", 2, true)); moel@132: v.Add(new Voltage("Voltage #4", 3, true)); moel@132: v.Add(new Voltage("Voltage #5", 4, true)); moel@132: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@195: v.Add(new Voltage("VSB3V", 7, 150, 150)); moel@195: v.Add(new Voltage("VBat", 8, 150, 150)); moel@132: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@132: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@132: for (int i = 0; i < superIO.Fans.Length; i++) moel@132: f.Add(new Fan("Fan #" + (i + 1), i)); moel@132: break; moel@132: } moel@130: break; moel@416: default: moel@416: v.Add(new Voltage("VCC3V", 0, 150, 150)); moel@416: v.Add(new Voltage("CPU VCore", 1)); moel@416: v.Add(new Voltage("Voltage #3", 2, true)); moel@416: v.Add(new Voltage("Voltage #4", 3, true)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: if (superIO.Chip != Chip.F71808E) moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("VSB3V", 7, 150, 150)); moel@416: v.Add(new Voltage("VBat", 8, 150, 150)); moel@416: for (int i = 0; i < superIO.Temperatures.Length; i++) moel@416: t.Add(new Temperature("Temperature #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: } moel@130: moel@416: private static void GetNuvotonConfigurationF(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, moel@416: IList v, IList t, IList f, IList c) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ASUS: moel@416: switch (model) { moel@416: case Model.P8P67: // NCT6776F moel@416: case Model.P8P67_EVO: // NCT6776F moel@416: case Model.P8P67_PRO: // NCT6776F moel@220: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 11, 1)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 12, 3)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 2)); moel@416: t.Add(new Temperature("Motherboard", 3)); moel@416: f.Add(new Fan("Chassis Fan #1", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("Chassis Fan #2", 3)); moel@416: c.Add(new Ctrl("Chassis Fan #2", 0)); moel@416: c.Add(new Ctrl("CPU Fan", 1)); moel@416: c.Add(new Ctrl("Chassis Fan #1", 2)); moel@416: break; moel@416: case Model.P8P67_M_PRO: // NCT6776F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 11, 1)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 12, 3)); moel@220: v.Add(new Voltage("Voltage #6", 5, true)); moel@220: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@195: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@152: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 3)); moel@416: f.Add(new Fan("Chassis Fan #1", 0)); moel@153: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Chassis Fan #2", 2)); moel@416: f.Add(new Fan("Power Fan", 3)); moel@416: f.Add(new Fan("Auxiliary Fan", 4)); moel@152: break; moel@416: case Model.P8Z68_V_PRO: // NCT6776F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 11, 1)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 12, 3)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 2)); moel@416: t.Add(new Temperature("Motherboard", 3)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan #" + (i + 1), i)); moel@416: break; moel@416: case Model.P9X79: // NCT6776F moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 11, 1)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 12, 3)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 3)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@265: break; moel@265: default: moel@265: v.Add(new Voltage("CPU VCore", 0)); moel@265: v.Add(new Voltage("Voltage #2", 1, true)); moel@265: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@265: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@265: v.Add(new Voltage("Voltage #5", 4, true)); moel@265: v.Add(new Voltage("Voltage #6", 5, true)); moel@265: v.Add(new Voltage("Voltage #7", 6, true)); moel@265: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@265: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@354: t.Add(new Temperature("CPU Core", 0)); moel@354: t.Add(new Temperature("Temperature #1", 1)); moel@354: t.Add(new Temperature("Temperature #2", 2)); moel@354: t.Add(new Temperature("Temperature #3", 3)); moel@265: for (int i = 0; i < superIO.Fans.Length; i++) moel@265: f.Add(new Fan("Fan #" + (i + 1), i)); moel@383: for (int i = 0; i < superIO.Controls.Length; i++) moel@383: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@265: break; moel@265: } moel@245: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU Core", 0)); moel@416: t.Add(new Temperature("Temperature #1", 1)); moel@416: t.Add(new Temperature("Temperature #2", 2)); moel@416: t.Add(new Temperature("Temperature #3", 3)); moel@416: for (int i = 0; i < superIO.Fans.Length; i++) moel@416: f.Add(new Fan("Fan #" + (i + 1), i)); moel@416: for (int i = 0; i < superIO.Controls.Length; i++) moel@416: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@416: break; moel@416: } moel@416: } moel@416: moel@416: private static void GetNuvotonConfigurationD(ISuperIO superIO, moel@416: Manufacturer manufacturer, Model model, moel@416: IList v, IList t, IList f, IList c) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ASUS: moel@416: switch (model) { moel@416: case Model.P8Z77_V: // NCT6779D moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: v.Add(new Voltage("VTT", 9)); moel@416: v.Add(new Voltage("Voltage #11", 10, true)); moel@416: v.Add(new Voltage("Voltage #12", 11, true)); moel@416: v.Add(new Voltage("Voltage #13", 12, true)); moel@416: v.Add(new Voltage("Voltage #14", 13, true)); moel@416: v.Add(new Voltage("Voltage #15", 14, true)); moel@416: t.Add(new Temperature("CPU Core", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("Motherboard", 2)); moel@416: f.Add(new Fan("Chassis Fan #1", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Chassis Fan #2", 2)); moel@416: f.Add(new Fan("Chassis Fan #3", 3)); moel@416: c.Add(new Ctrl("Chassis Fan #1", 0)); moel@416: c.Add(new Ctrl("CPU Fan", 1)); moel@416: c.Add(new Ctrl("Chassis Fan #2", 2)); moel@416: c.Add(new Ctrl("Chassis Fan #3", 3)); moel@359: break; moel@359: default: moel@359: v.Add(new Voltage("CPU VCore", 0)); moel@359: v.Add(new Voltage("Voltage #2", 1, true)); moel@359: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@359: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@359: v.Add(new Voltage("Voltage #5", 4, true)); moel@359: v.Add(new Voltage("Voltage #6", 5, true)); moel@359: v.Add(new Voltage("Voltage #7", 6, true)); moel@359: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@359: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@359: v.Add(new Voltage("VTT", 9)); moel@359: v.Add(new Voltage("Voltage #11", 10, true)); moel@359: v.Add(new Voltage("Voltage #12", 11, true)); moel@359: v.Add(new Voltage("Voltage #13", 12, true)); moel@359: v.Add(new Voltage("Voltage #14", 13, true)); moel@359: v.Add(new Voltage("Voltage #15", 14, true)); moel@359: t.Add(new Temperature("CPU Core", 0)); moel@359: t.Add(new Temperature("Temperature #1", 1)); moel@359: t.Add(new Temperature("Temperature #2", 2)); moel@359: t.Add(new Temperature("Temperature #3", 3)); moel@359: t.Add(new Temperature("Temperature #4", 4)); moel@359: t.Add(new Temperature("Temperature #5", 5)); moel@359: t.Add(new Temperature("Temperature #6", 6)); moel@359: for (int i = 0; i < superIO.Fans.Length; i++) moel@359: f.Add(new Fan("Fan #" + (i + 1), i)); moel@359: for (int i = 0; i < superIO.Controls.Length; i++) moel@359: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@359: break; moel@359: } moel@356: break; moel@130: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: v.Add(new Voltage("VTT", 9)); moel@416: v.Add(new Voltage("Voltage #11", 10, true)); moel@416: v.Add(new Voltage("Voltage #12", 11, true)); moel@416: v.Add(new Voltage("Voltage #13", 12, true)); moel@416: v.Add(new Voltage("Voltage #14", 13, true)); moel@416: v.Add(new Voltage("Voltage #15", 14, true)); moel@416: t.Add(new Temperature("CPU Core", 0)); moel@416: t.Add(new Temperature("Temperature #1", 1)); moel@416: t.Add(new Temperature("Temperature #2", 2)); moel@416: t.Add(new Temperature("Temperature #3", 3)); moel@416: t.Add(new Temperature("Temperature #4", 4)); moel@416: t.Add(new Temperature("Temperature #5", 5)); moel@416: t.Add(new Temperature("Temperature #6", 6)); moel@130: for (int i = 0; i < superIO.Fans.Length; i++) moel@130: f.Add(new Fan("Fan #" + (i + 1), i)); moel@323: for (int i = 0; i < superIO.Controls.Length; i++) moel@323: c.Add(new Ctrl("Fan Control #" + (i + 1), i)); moel@130: break; moel@130: } moel@416: } moel@130: moel@416: private static void GetWinbondConfigurationEHF(Manufacturer manufacturer, moel@416: Model model, IList v, IList t, IList f) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ASRock: moel@416: switch (model) { moel@416: case Model.AOD790GX_128M: // W83627EHF moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 4, 10, 10)); moel@416: v.Add(new Voltage("+5V", 5, 20, 10)); moel@416: v.Add(new Voltage("+12V", 6, 28, 5)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 2)); moel@416: f.Add(new Fan("CPU Fan", 0)); moel@416: f.Add(new Fan("Chassis Fan", 1)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: v.Add(new Voltage("Voltage #10", 9, true)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: f.Add(new Fan("CPU Fan #2", 3)); moel@416: f.Add(new Fan("Auxiliary Fan #2", 4)); moel@416: break; moel@416: } break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: v.Add(new Voltage("Voltage #10", 9, true)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: f.Add(new Fan("CPU Fan #2", 3)); moel@416: f.Add(new Fan("Auxiliary Fan #2", 4)); moel@416: break; moel@130: } moel@416: } moel@130: moel@416: private static void GetWinbondConfigurationHG(Manufacturer manufacturer, moel@416: Model model, IList v, IList t, IList f) moel@416: { moel@416: switch (manufacturer) { moel@416: case Manufacturer.ASRock: moel@416: switch (model) { moel@416: case Model._880GMH_USB3: // W83627DHG-P moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 5, 15, 7.5f)); moel@416: v.Add(new Voltage("+12V", 6, 56, 10)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 2)); moel@416: f.Add(new Fan("Chassis Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: f.Add(new Fan("CPU Fan #2", 3)); moel@416: f.Add(new Fan("Auxiliary Fan #2", 4)); moel@416: break; moel@416: } moel@416: break; moel@416: case Manufacturer.ASUS: moel@416: switch (model) { moel@416: case Model.P6T: // W83667HG moel@416: case Model.P6X58D_E: // W83667HG moel@416: case Model.Rampage_II_GENE: // W83667HG moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 11.5f, 1.91f)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 15, 7.5f)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 2)); moel@416: f.Add(new Fan("Chassis Fan #1", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("Chassis Fan #2", 3)); moel@416: f.Add(new Fan("Chassis Fan #3", 4)); moel@416: break; moel@416: case Model.Rampage_Extreme: // W83667HG moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("+12V", 1, 12, 2)); moel@416: v.Add(new Voltage("Analog +3.3V", 2, 34, 34)); moel@416: v.Add(new Voltage("+3.3V", 3, 34, 34)); moel@416: v.Add(new Voltage("+5V", 4, 15, 7.5f)); moel@416: v.Add(new Voltage("Standby +3.3V", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Motherboard", 2)); moel@416: f.Add(new Fan("Chassis Fan #1", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Power Fan", 2)); moel@416: f.Add(new Fan("Chassis Fan #2", 3)); moel@416: f.Add(new Fan("Chassis Fan #3", 4)); moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: f.Add(new Fan("CPU Fan #2", 3)); moel@416: f.Add(new Fan("Auxiliary Fan #2", 4)); moel@416: break; moel@416: } moel@416: break; moel@416: default: moel@416: v.Add(new Voltage("CPU VCore", 0)); moel@416: v.Add(new Voltage("Voltage #2", 1, true)); moel@416: v.Add(new Voltage("AVCC", 2, 34, 34)); moel@416: v.Add(new Voltage("3VCC", 3, 34, 34)); moel@416: v.Add(new Voltage("Voltage #5", 4, true)); moel@416: v.Add(new Voltage("Voltage #6", 5, true)); moel@416: v.Add(new Voltage("Voltage #7", 6, true)); moel@416: v.Add(new Voltage("3VSB", 7, 34, 34)); moel@416: v.Add(new Voltage("VBAT", 8, 34, 34)); moel@416: t.Add(new Temperature("CPU", 0)); moel@416: t.Add(new Temperature("Auxiliary", 1)); moel@416: t.Add(new Temperature("System", 2)); moel@416: f.Add(new Fan("System Fan", 0)); moel@416: f.Add(new Fan("CPU Fan", 1)); moel@416: f.Add(new Fan("Auxiliary Fan", 2)); moel@416: f.Add(new Fan("CPU Fan #2", 3)); moel@416: f.Add(new Fan("Auxiliary Fan #2", 4)); moel@416: break; moel@323: } moel@130: } moel@130: moel@165: public override HardwareType HardwareType { moel@165: get { return HardwareType.SuperIO; } moel@130: } moel@130: moel@176: public override IHardware Parent { moel@176: get { return mainboard; } moel@176: } moel@176: moel@130: moel@130: public override string GetReport() { moel@130: return superIO.GetReport(); moel@130: } moel@130: moel@130: public override void Update() { moel@130: superIO.Update(); moel@130: moel@130: foreach (Sensor sensor in voltages) { moel@228: float? value = readVoltage(sensor.Index); moel@130: if (value.HasValue) { moel@130: sensor.Value = value + (value - sensor.Parameters[2].Value) * moel@130: sensor.Parameters[0].Value / sensor.Parameters[1].Value; moel@130: ActivateSensor(sensor); moel@130: } moel@130: } moel@130: moel@130: foreach (Sensor sensor in temperatures) { moel@228: float? value = readTemperature(sensor.Index); moel@130: if (value.HasValue) { moel@130: sensor.Value = value + sensor.Parameters[0].Value; moel@130: ActivateSensor(sensor); moel@130: } moel@130: } moel@130: moel@130: foreach (Sensor sensor in fans) { moel@228: float? value = readFan(sensor.Index); moel@130: if (value.HasValue) { moel@130: sensor.Value = value; moel@130: if (value.Value > 0) moel@130: ActivateSensor(sensor); moel@130: } moel@130: } moel@228: moel@323: foreach (Sensor sensor in controls) { moel@323: float? value = readControl(sensor.Index); moel@389: sensor.Value = value; moel@323: } moel@323: moel@228: postUpdate(); moel@130: } moel@130: moel@323: public override void Close() { moel@323: foreach (Sensor sensor in controls) { moel@323: // restore all controls back to default moel@323: superIO.SetControl(sensor.Index, null); moel@323: } moel@323: base.Close(); moel@323: } moel@323: moel@130: private class Voltage { moel@130: public readonly string Name; moel@130: public readonly int Index; moel@130: public readonly float Ri; moel@130: public readonly float Rf; moel@130: public readonly float Vf; moel@130: public readonly bool Hidden; moel@130: moel@202: public Voltage(string name, int index) : moel@202: this(name, index, false) { } moel@202: moel@130: public Voltage(string name, int index, bool hidden) : moel@130: this(name, index, 0, 1, 0, hidden) { } moel@202: moel@202: public Voltage(string name, int index, float ri, float rf) : moel@202: this(name, index, ri, rf, 0, false) { } moel@202: moel@202: // float ri = 0, float rf = 1, float vf = 0, bool hidden = false) moel@202: moel@195: public Voltage(string name, int index, moel@202: float ri, float rf, float vf, bool hidden) moel@195: { moel@130: this.Name = name; moel@130: this.Index = index; moel@130: this.Ri = ri; moel@130: this.Rf = rf; moel@130: this.Vf = vf; moel@130: this.Hidden = hidden; moel@130: } moel@130: } moel@130: moel@130: private class Temperature { moel@130: public readonly string Name; moel@130: public readonly int Index; moel@130: moel@167: public Temperature(string name, int index) { moel@130: this.Name = name; moel@130: this.Index = index; moel@130: } moel@130: } moel@130: moel@130: private class Fan { moel@130: public readonly string Name; moel@130: public readonly int Index; moel@130: moel@130: public Fan(string name, int index) { moel@130: this.Name = name; moel@130: this.Index = index; moel@130: } moel@130: } moel@323: moel@323: private class Ctrl { moel@323: public readonly string Name; moel@323: public readonly int Index; moel@323: moel@323: public Ctrl(string name, int index) { moel@323: this.Name = name; moel@323: this.Index = index; moel@323: } moel@323: } moel@130: } moel@130: }