# HG changeset patch # User moel.mich # Date 1265660305 0 # Node ID dc276daadb2c265627eaf1c9f2098a6f9b2d6d68 # Parent 800a36a1ca8e65d8078e0a4bbaf785ad77983b9f Added support for Winbond W83627EHF, W83667HG, W83667HG-B mainboard chips. diff -r 800a36a1ca8e -r dc276daadb2c GUI/MainForm.cs --- a/GUI/MainForm.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/GUI/MainForm.cs Mon Feb 08 20:18:25 2010 +0000 @@ -319,7 +319,7 @@ } else { Visible = true; notifyIcon.Visible = false; - BringToFront(); + Activate(); } } diff -r 800a36a1ca8e -r dc276daadb2c Hardware/Computer.cs --- a/Hardware/Computer.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/Computer.cs Mon Feb 08 20:18:25 2010 +0000 @@ -38,6 +38,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Globalization; using System.Text; namespace OpenHardwareMonitor.Hardware { @@ -133,7 +134,7 @@ public void SaveReport(Version version) { using (TextWriter w = - new StreamWriter("OpenHardwareMonitor.Report.txt")) { + new StreamWriter("OpenHardwareMonitor.Report.txt")) { w.WriteLine(); w.WriteLine("Open Hardware Monitor Report"); @@ -152,7 +153,8 @@ foreach (ISensor sensor in hardware.Sensors) { w.WriteLine("| +- {0} : {1} : {2} : {3}", new object[] { sensor.SensorType, sensor.Index, sensor.Name, - sensor.Value }); + string.Format(CultureInfo.InvariantCulture, "{0}", + sensor.Value) }); } } } diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/Chip.cs --- a/Hardware/LPC/Chip.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/LPC/Chip.cs Mon Feb 08 20:18:25 2010 +0000 @@ -13,7 +13,10 @@ IT8726F = 0x8726, W83627DHG = 0xA020, W83627DHGP = 0xB070, + W83627EHF = 0x8860, W83627HF = 0x5200, + W83667HG = 0xA510, + W83667HGB = 0xB350, F71862 = 0x0601, F71869 = 0x0814, F71882 = 0x0541, diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/F718XX.cs --- a/Hardware/LPC/F718XX.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/LPC/F718XX.cs Mon Feb 08 20:18:25 2010 +0000 @@ -136,7 +136,8 @@ if (value > 0) { sensor.Value = (value < 0x0fff) ? 1.5e6f / value : 0; - ActivateSensor(sensor); + if (sensor.Value > 0) + ActivateSensor(sensor); } else { DeactivateSensor(sensor); } diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/IT87XX.cs --- a/Hardware/LPC/IT87XX.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/LPC/IT87XX.cs Mon Feb 08 20:18:25 2010 +0000 @@ -164,7 +164,8 @@ if (value > 0) { sensor.Value = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0; - ActivateSensor(sensor); + if (sensor.Value > 0) + ActivateSensor(sensor); } else { DeactivateSensor(sensor); } diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/LPCGroup.cs --- a/Hardware/LPC/LPCGroup.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/LPC/LPCGroup.cs Mon Feb 08 20:18:25 2010 +0000 @@ -75,6 +75,7 @@ WinRing0.WriteIoPortByte(valuePort, logicalDeviceNumber); } + // ITE private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04; private void IT87Enter() { @@ -93,7 +94,7 @@ private const byte FINTEK_VENDOR_ID_REGISTER = 0x23; private const ushort FINTEK_VENDOR_ID = 0x1934; - private const byte W83627_HARDWARE_MONITOR_LDN = 0x0B; + private const byte WINBOND_HARDWARE_MONITOR_LDN = 0x0B; private const byte F71858_HARDWARE_MONITOR_LDN = 0x02; private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04; @@ -120,89 +121,80 @@ byte logicalDeviceNumber; byte id = ReadByte(CHIP_ID_REGISTER); byte revision = ReadByte(CHIP_REVISION_REGISTER); + chip = Chip.Unknown; + logicalDeviceNumber = 0; switch (id) { case 0x05: switch (revision) { case 0x41: chip = Chip.F71882; logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; + break; } break; case 0x06: switch (revision) { case 0x01: chip = Chip.F71862; logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; + break; } break; case 0x07: switch (revision) { case 0x23: chip = Chip.F71889; logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; + break; } break; case 0x08: switch (revision) { case 0x14: chip = Chip.F71869; logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; + break; } break; case 0x52: switch (revision) { case 0x17: case 0x3A: chip = Chip.W83627HF; - logicalDeviceNumber = W83627_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; + break; + } break; + case 0x88: + switch (revision & 0xF0) { + case 0x60: + chip = Chip.W83627EHF; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; break; } break; case 0xA0: switch (revision & 0xF0) { case 0x20: chip = Chip.W83627DHG; - logicalDeviceNumber = W83627_HARDWARE_MONITOR_LDN; - break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; + break; + } break; + case 0xA5: + switch (revision & 0xF0) { + case 0x10: + chip = Chip.W83667HG; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; break; } break; case 0xB0: switch (revision & 0xF0) { case 0x70: chip = Chip.W83627DHGP; - logicalDeviceNumber = W83627_HARDWARE_MONITOR_LDN; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; + break; + } break; + case 0xB3: + switch (revision & 0xF0) { + case 0x50: + chip = Chip.W83667HGB; + logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; - } break; - default: - chip = Chip.Unknown; - logicalDeviceNumber = 0; - break; + } break; } if (chip != Chip.Unknown) { @@ -217,16 +209,19 @@ WinbondFintekExit(); - if (address != verify || address == 0 || (address & 0xF007) != 0) + if (address != verify || address < 0x100 || (address & 0xF007) != 0) return; switch (chip) { case Chip.W83627DHG: case Chip.W83627DHGP: + case Chip.W83627EHF: case Chip.W83627HF: - W83627 w83627 = new W83627(chip, revision, address); - if (w83627.IsAvailable) - hardware.Add(w83627); + case Chip.W83667HG: + case Chip.W83667HGB: + W836XX w836XX = new W836XX(chip, revision, address); + if (w836XX.IsAvailable) + hardware.Add(w836XX); break; case Chip.F71862: case Chip.F71882: @@ -261,7 +256,7 @@ IT87Exit(); - if (address != verify || address == 0 || (address & 0xF007) != 0) + if (address != verify || address < 0x100 || (address & 0xF007) != 0) return; IT87XX it87 = new IT87XX(chip, address); diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/LPCHardware.cs --- a/Hardware/LPC/LPCHardware.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/LPC/LPCHardware.cs Mon Feb 08 20:18:25 2010 +0000 @@ -61,7 +61,10 @@ case Chip.IT8726F: this.name = "ITE IT8726F"; break; case Chip.W83627DHG: this.name = "Winbond W83627DHG"; break; case Chip.W83627DHGP: this.name = "Winbond W83627DHG-P"; break; + case Chip.W83627EHF: this.name = "Winbond W83627EHF"; break; case Chip.W83627HF: this.name = "Winbond W83627HF"; break; + case Chip.W83667HG: this.name = "Winbond W83667HG"; break; + case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break; } } diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/W83627.cs --- a/Hardware/LPC/W83627.cs Sun Feb 07 20:59:13 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* - - Version: MPL 1.1/GPL 2.0/LGPL 2.1 - - The contents of this file are subject to the Mozilla Public License Version - 1.1 (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" basis, - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - for the specific language governing rights and limitations under the License. - - The Original Code is the Open Hardware Monitor code. - - The Initial Developer of the Original Code is - Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 - the Initial Developer. All Rights Reserved. - - Contributor(s): - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - in which case the provisions of the GPL or the LGPL are applicable instead - of those above. If you wish to allow use of your version of this file only - under the terms of either the GPL or the LGPL, and not to allow others to - use your version of this file under the terms of the MPL, indicate your - decision by deleting the provisions above and replace them with the notice - and other provisions required by the GPL or the LGPL. If you do not delete - the provisions above, a recipient may use your version of this file under - the terms of any one of the MPL, the GPL or the LGPL. - -*/ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; - -namespace OpenHardwareMonitor.Hardware.LPC { - public class W83627 : Winbond, IHardware { - - private Sensor[] temperatures; - private Sensor[] fans; - private Sensor[] voltages; - - private float[] voltageGains; - private string[] fanNames; - - // Hardware Monitor Registers - private const byte VOLTAGE_BASE_REG = 0x20; - private const byte TEMPERATURE_BASE_REG = 0x50; - private const byte TEMPERATURE_SYS_REG = 0x27; - - private byte[] FAN_TACHO_REG = new byte[] { 0x28, 0x29, 0x2A, 0x3F, 0x53 }; - private byte[] FAN_TACHO_BANK = new byte[] { 0, 0, 0, 0, 5 }; - private byte[] FAN_BIT_REG = new byte[] { 0x47, 0x4B, 0x4C, 0x59, 0x5D }; - private byte[] FAN_DIV_BIT0 = new byte[] { 36, 38, 30, 8, 10 }; - private byte[] FAN_DIV_BIT1 = new byte[] { 37, 39, 31, 9, 11 }; - private byte[] FAN_DIV_BIT2 = new byte[] { 5, 6, 7, 23, 15 }; - - public W83627(Chip chip, byte revision, ushort address) - : base(chip, revision, address) - { - - temperatures = new Sensor[3]; - temperatures[0] = new Sensor("CPU", 0, SensorType.Temperature, this); - temperatures[1] = new Sensor("Auxiliary", 1, SensorType.Temperature, this); - temperatures[2] = new Sensor("System", 2, SensorType.Temperature, this); - - switch (chip) { - case Chip.W83627DHG: - case Chip.W83627DHGP: - fanNames = new string[] { "System", "CPU #1", "Auxiliary #1", - "CPU #2", "Auxiliary #2" }; - voltageGains = new float[] { 0.008f, 1, 1, 0.016f, 1, 1, 1, 0.016f }; - voltages = new Sensor[3]; - voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this); - voltages[1] = new Sensor("+3.3V", 3, SensorType.Voltage, this); - voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this); - break; - case Chip.W83627HF: - fanNames = new string[] { "Fan #1", "Fan #2", "Fan #3" }; - voltageGains = new float[] { 0.016f, 1, 0.016f, 1, 1, 1, 1, 0.016f }; - voltages = new Sensor[3]; - voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this); - voltages[1] = new Sensor("+3.3V", 2, SensorType.Voltage, this); - voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this); - break; - default: fanNames = new string[0]; - break; - } - - fans = new Sensor[fanNames.Length]; - for (int i = 0; i < fanNames.Length; i++) - fans[i] = new Sensor(fanNames[i], i, SensorType.Fan, this); - } - - public void Update() { - foreach (Sensor sensor in voltages) { - if (sensor.Index < 7) { - int value = ReadByte(0, (byte)(VOLTAGE_BASE_REG + sensor.Index)); - sensor.Value = voltageGains[sensor.Index] * value; - if (sensor.Value > 0) - ActivateSensor(sensor); - else - DeactivateSensor(sensor); - } else { - // Battery voltage - bool valid = (ReadByte(0, 0x5D) & 0x01) > 0; - if (valid) { - sensor.Value = voltageGains[sensor.Index] * - ReadByte(5, 0x51); - ActivateSensor(sensor); - } else - DeactivateSensor(sensor); - } - } - - foreach (Sensor sensor in temperatures) { - int value; - if (sensor.Index < 2) { - value = (sbyte)ReadByte((byte)(sensor.Index + 1), TEMPERATURE_BASE_REG); - value = (value << 1) | ReadByte((byte)(sensor.Index + 1), - (byte)(TEMPERATURE_BASE_REG + 1)) >> 7; - } else { - value = (sbyte)ReadByte(0, TEMPERATURE_SYS_REG) << 1; - } - sensor.Value = value / 2.0f; - if (value < 0xFE) - ActivateSensor(sensor); - else - DeactivateSensor(sensor); - } - - long bits = 0; - for (int i = 0; i < FAN_BIT_REG.Length; i++) - bits = (bits << 8) | ReadByte(0, FAN_BIT_REG[i]); - foreach (Sensor sensor in fans) { - int count = ReadByte(FAN_TACHO_BANK[sensor.Index], - FAN_TACHO_REG[sensor.Index]); - int divisorBits = (int)( - (((bits >> FAN_DIV_BIT2[sensor.Index]) & 1) << 2) | - (((bits >> FAN_DIV_BIT1[sensor.Index]) & 1) << 1) | - ((bits >> FAN_DIV_BIT0[sensor.Index]) & 1)); - int divisor = 1 << divisorBits; - sensor.Value = (count < 0xff) ? 1.35e6f / (count * divisor) : 0; - ActivateSensor(sensor); - } - } - } -} diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/W836XX.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hardware/LPC/W836XX.cs Mon Feb 08 20:18:25 2010 +0000 @@ -0,0 +1,239 @@ +/* + + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + + The contents of this file are subject to the Mozilla Public License Version + 1.1 (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + The Original Code is the Open Hardware Monitor code. + + The Initial Developer of the Original Code is + Michael Möller . + Portions created by the Initial Developer are Copyright (C) 2009-2010 + the Initial Developer. All Rights Reserved. + + Contributor(s): + + Alternatively, the contents of this file may be used under the terms of + either the GNU General Public License Version 2 or later (the "GPL"), or + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + in which case the provisions of the GPL or the LGPL are applicable instead + of those above. If you wish to allow use of your version of this file only + under the terms of either the GPL or the LGPL, and not to allow others to + use your version of this file under the terms of the MPL, indicate your + decision by deleting the provisions above and replace them with the notice + and other provisions required by the GPL or the LGPL. If you do not delete + the provisions above, a recipient may use your version of this file under + the terms of any one of the MPL, the GPL or the LGPL. + +*/ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; + +namespace OpenHardwareMonitor.Hardware.LPC { + public class W836XX : LPCHardware, IHardware { + + private ushort address; + private byte revision; + + private bool available; + + private Sensor[] temperatures; + private Sensor[] fans; + private Sensor[] voltages; + + private float[] voltageGains; + private string[] fanNames; + + // Consts + private const ushort WINBOND_VENDOR_ID = 0x5CA3; + private const byte HIGH_BYTE = 0x80; + + // Hardware Monitor + private const byte ADDRESS_REGISTER_OFFSET = 0x05; + private const byte DATA_REGISTER_OFFSET = 0x06; + + // Hardware Monitor Registers + private const byte VOLTAGE_BASE_REG = 0x20; + private const byte BANK_SELECT_REGISTER = 0x04E; + private const byte VENDOR_ID_REGISTER = 0x4F; + private const byte TEMPERATURE_BASE_REG = 0x50; + private const byte TEMPERATURE_SYS_REG = 0x27; + + private byte[] FAN_TACHO_REG = new byte[] { 0x28, 0x29, 0x2A, 0x3F, 0x53 }; + private byte[] FAN_TACHO_BANK = new byte[] { 0, 0, 0, 0, 5 }; + private byte[] FAN_BIT_REG = new byte[] { 0x47, 0x4B, 0x4C, 0x59, 0x5D }; + private byte[] FAN_DIV_BIT0 = new byte[] { 36, 38, 30, 8, 10 }; + private byte[] FAN_DIV_BIT1 = new byte[] { 37, 39, 31, 9, 11 }; + private byte[] FAN_DIV_BIT2 = new byte[] { 5, 6, 7, 23, 15 }; + + private byte ReadByte(byte bank, byte register) { + WinRing0.WriteIoPortByte( + (ushort)(address + ADDRESS_REGISTER_OFFSET), BANK_SELECT_REGISTER); + WinRing0.WriteIoPortByte( + (ushort)(address + DATA_REGISTER_OFFSET), bank); + WinRing0.WriteIoPortByte( + (ushort)(address + ADDRESS_REGISTER_OFFSET), register); + return WinRing0.ReadIoPortByte( + (ushort)(address + DATA_REGISTER_OFFSET)); + } + + public W836XX(Chip chip, byte revision, ushort address) + : base(chip) + { + this.address = address; + this.revision = revision; + + available = IsWinbondVendor(); + + temperatures = new Sensor[3]; + temperatures[0] = new Sensor("CPU", 0, SensorType.Temperature, this); + temperatures[1] = new Sensor("Auxiliary", 1, SensorType.Temperature, this); + temperatures[2] = new Sensor("System", 2, SensorType.Temperature, this); + + switch (chip) { + case Chip.W83627DHG: + case Chip.W83627DHGP: + case Chip.W83627EHF: + case Chip.W83667HG: + case Chip.W83667HGB: + fanNames = new string[] { "System", "CPU", "Auxiliary", + "CPU #2", "Auxiliary #2" }; + voltageGains = new float[] { 1, 1, 1, 2, 1, 1, 1, 2 }; + voltages = new Sensor[3]; + voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this); + voltages[1] = new Sensor("+3.3V", 3, SensorType.Voltage, this); + voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this); + break; + case Chip.W83627HF: + fanNames = new string[] { "Fan #1", "Fan #2", "Fan #3" }; + voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 }; + voltages = new Sensor[3]; + voltages[0] = new Sensor("CPU VCore", 0, SensorType.Voltage, this); + voltages[1] = new Sensor("+3.3V", 2, SensorType.Voltage, this); + voltages[2] = new Sensor("Battery", 7, SensorType.Voltage, this); + break; + default: fanNames = new string[0]; + break; + } + + fans = new Sensor[fanNames.Length]; + for (int i = 0; i < fanNames.Length; i++) + fans[i] = new Sensor(fanNames[i], i, SensorType.Fan, this); + } + + public bool IsAvailable { + get { return available; } + } + + private bool IsWinbondVendor() { + ushort vendorId = + (ushort)((ReadByte(HIGH_BYTE, VENDOR_ID_REGISTER) << 8) | + ReadByte(0, VENDOR_ID_REGISTER)); + return vendorId == WINBOND_VENDOR_ID; + } + + public void Update() { + foreach (Sensor sensor in voltages) { + if (sensor.Index < 7) { + int value = ReadByte(0, (byte)(VOLTAGE_BASE_REG + sensor.Index)); + sensor.Value = 0.008f * voltageGains[sensor.Index] * value; + if (sensor.Value > 0) + ActivateSensor(sensor); + else + DeactivateSensor(sensor); + } else { + // Battery voltage + bool valid = (ReadByte(0, 0x5D) & 0x01) > 0; + if (valid) { + sensor.Value = + 0.008f * voltageGains[sensor.Index] * ReadByte(5, 0x51); + ActivateSensor(sensor); + } else + DeactivateSensor(sensor); + } + } + + foreach (Sensor sensor in temperatures) { + int value; + if (sensor.Index < 2) { + value = (sbyte)ReadByte((byte)(sensor.Index + 1), TEMPERATURE_BASE_REG); + value = (value << 1) | ReadByte((byte)(sensor.Index + 1), + (byte)(TEMPERATURE_BASE_REG + 1)) >> 7; + } else { + value = (sbyte)ReadByte(0, TEMPERATURE_SYS_REG) << 1; + } + sensor.Value = value / 2.0f; + if (value < 0xFE) + ActivateSensor(sensor); + else + DeactivateSensor(sensor); + } + + long bits = 0; + for (int i = 0; i < FAN_BIT_REG.Length; i++) + bits = (bits << 8) | ReadByte(0, FAN_BIT_REG[i]); + foreach (Sensor sensor in fans) { + int count = ReadByte(FAN_TACHO_BANK[sensor.Index], + FAN_TACHO_REG[sensor.Index]); + int divisorBits = (int)( + (((bits >> FAN_DIV_BIT2[sensor.Index]) & 1) << 2) | + (((bits >> FAN_DIV_BIT1[sensor.Index]) & 1) << 1) | + ((bits >> FAN_DIV_BIT0[sensor.Index]) & 1)); + int divisor = 1 << divisorBits; + float value = (count < 0xff) ? 1.35e6f / (count * divisor) : 0; + sensor.Value = value; + if (value > 0) + ActivateSensor(sensor); + } + } + + public string GetReport() { + StringBuilder r = new StringBuilder(); + + r.AppendLine("LPC " + this.GetType().Name); + r.AppendLine(); + r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X")); + r.Append("Chip revision: 0x"); r.AppendLine(revision.ToString("X")); + r.Append("Base Adress: 0x"); r.AppendLine(address.ToString("X4")); + r.AppendLine(); + r.AppendLine("Hardware Monitor Registers"); + r.AppendLine(); + r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); + r.AppendLine(); + for (int i = 0; i < 0x7; i++) { + r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" "); + for (int j = 0; j <= 0xF; j++) { + r.Append(" "); + r.Append(ReadByte(0, (byte)((i << 4) | j)).ToString("X2")); + } + r.AppendLine(); + } + for (int k = 1; k <= 5; k++) { + r.AppendLine("Bank " + k); + for (int i = 0x5; i < 0x6; i++) { + r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" "); + for (int j = 0; j <= 0xF; j++) { + r.Append(" "); + r.Append(ReadByte((byte)(k), + (byte)((i << 4) | j)).ToString("X2")); + } + r.AppendLine(); + } + } + r.AppendLine(); + + return r.ToString(); + } + } +} diff -r 800a36a1ca8e -r dc276daadb2c Hardware/LPC/Winbond.cs --- a/Hardware/LPC/Winbond.cs Sun Feb 07 20:59:13 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* - - Version: MPL 1.1/GPL 2.0/LGPL 2.1 - - The contents of this file are subject to the Mozilla Public License Version - 1.1 (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" basis, - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - for the specific language governing rights and limitations under the License. - - The Original Code is the Open Hardware Monitor code. - - The Initial Developer of the Original Code is - Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 - the Initial Developer. All Rights Reserved. - - Contributor(s): - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - in which case the provisions of the GPL or the LGPL are applicable instead - of those above. If you wish to allow use of your version of this file only - under the terms of either the GPL or the LGPL, and not to allow others to - use your version of this file under the terms of the MPL, indicate your - decision by deleting the provisions above and replace them with the notice - and other provisions required by the GPL or the LGPL. If you do not delete - the provisions above, a recipient may use your version of this file under - the terms of any one of the MPL, the GPL or the LGPL. - -*/ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; - -namespace OpenHardwareMonitor.Hardware.LPC { - public abstract class Winbond : LPCHardware { - - private ushort address; - private byte revision; - - private bool available; - - // Consts - private const ushort WINBOND_VENDOR_ID = 0x5CA3; - private const byte HIGH_BYTE = 0x80; - - // Hardware Monitor - private const byte ADDRESS_REGISTER_OFFSET = 0x05; - private const byte DATA_REGISTER_OFFSET = 0x06; - - // Hardware Monitor Registers - private const byte BANK_SELECT_REGISTER = 0x04E; - private const byte VENDOR_ID_REGISTER = 0x4F; - - protected byte ReadByte(byte bank, byte register) { - WinRing0.WriteIoPortByte( - (ushort)(address + ADDRESS_REGISTER_OFFSET), BANK_SELECT_REGISTER); - WinRing0.WriteIoPortByte( - (ushort)(address + DATA_REGISTER_OFFSET), bank); - WinRing0.WriteIoPortByte( - (ushort)(address + ADDRESS_REGISTER_OFFSET), register); - return WinRing0.ReadIoPortByte( - (ushort)(address + DATA_REGISTER_OFFSET)); - } - - private bool IsWinbondVendor() { - ushort vendorId = - (ushort)((ReadByte(HIGH_BYTE, VENDOR_ID_REGISTER) << 8) | - ReadByte(0, VENDOR_ID_REGISTER)); - return vendorId == WINBOND_VENDOR_ID; - } - - public Winbond(Chip chip, byte revision, ushort address) - : base(chip) - { - this.address = address; - this.revision = revision; - - available = IsWinbondVendor(); - } - - public bool IsAvailable { - get { return available; } - } - - public string GetReport() { - StringBuilder r = new StringBuilder(); - - r.AppendLine("LPC " + this.GetType().Name); - r.AppendLine(); - r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X")); - r.Append("Chip revision: 0x"); r.AppendLine(revision.ToString("X")); - r.Append("Base Adress: 0x"); r.AppendLine(address.ToString("X4")); - r.AppendLine(); - r.AppendLine("Hardware Monitor Registers"); - r.AppendLine(); - r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"); - r.AppendLine(); - for (int i = 0; i < 0x7; i++) { - r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" "); - for (int j = 0; j <= 0xF; j++) { - r.Append(" "); - r.Append(ReadByte(0, (byte)((i << 4) | j)).ToString("X2")); - } - r.AppendLine(); - } - for (int k = 1; k <= 5; k++) { - r.AppendLine("Bank " + k); - for (int i = 0x5; i < 0x6; i++) { - r.Append(" "); r.Append((i << 4).ToString("X2")); r.Append(" "); - for (int j = 0; j <= 0xF; j++) { - r.Append(" "); - r.Append(ReadByte((byte)(k), - (byte)((i << 4) | j)).ToString("X2")); - } - r.AppendLine(); - } - } - r.AppendLine(); - - return r.ToString(); - } - } -} diff -r 800a36a1ca8e -r dc276daadb2c Hardware/TBalancer/TBalancerGroup.cs --- a/Hardware/TBalancer/TBalancerGroup.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Hardware/TBalancer/TBalancerGroup.cs Mon Feb 08 20:18:25 2010 +0000 @@ -62,7 +62,7 @@ if (serialPort.IsOpen && serialPort.CDHolding && serialPort.CtsHolding) { - report.Append("Port name: "); report.AppendLine(portNames[i]); + report.Append("Port Name: "); report.AppendLine(portNames[i]); serialPort.DiscardInBuffer(); serialPort.DiscardOutBuffer(); diff -r 800a36a1ca8e -r dc276daadb2c OpenHardwareMonitor.csproj --- a/OpenHardwareMonitor.csproj Sun Feb 07 20:59:13 2010 +0000 +++ b/OpenHardwareMonitor.csproj Mon Feb 08 20:18:25 2010 +0000 @@ -69,9 +69,8 @@ - - + diff -r 800a36a1ca8e -r dc276daadb2c Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Sun Feb 07 20:59:13 2010 +0000 +++ b/Properties/AssemblyInfo.cs Mon Feb 08 20:18:25 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.15.0")] -[assembly: AssemblyFileVersion("0.1.15.0")] +[assembly: AssemblyVersion("0.1.16.0")] +[assembly: AssemblyFileVersion("0.1.16.0")]