1.1 --- a/Hardware/LPC/LPCIO.cs Fri Jun 22 10:05:23 2012 +0000
1.2 +++ b/Hardware/LPC/LPCIO.cs Sat Jun 23 22:14:28 2012 +0000
1.3 @@ -309,7 +309,8 @@
1.4 #region ITE
1.5
1.6 private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;
1.7 - private const byte IT87_GPIO_LDN = 0x07;
1.8 + private const byte IT8705_GPIO_LDN = 0x05;
1.9 + private const byte IT87XX_GPIO_LDN = 0x07;
1.10 private const byte IT87_CHIP_VERSION_REGISTER = 0x22;
1.11
1.12 private void IT87Enter() {
1.13 @@ -335,6 +336,7 @@
1.14 ushort chipID = ReadWord(CHIP_ID_REGISTER);
1.15 Chip chip;
1.16 switch (chipID) {
1.17 + case 0x8705: chip = Chip.IT8705F; break;
1.18 case 0x8712: chip = Chip.IT8712F; break;
1.19 case 0x8716: chip = Chip.IT8716F; break;
1.20 case 0x8718: chip = Chip.IT8718F; break;
1.21 @@ -360,11 +362,20 @@
1.22
1.23 byte version = (byte)(ReadByte(IT87_CHIP_VERSION_REGISTER) & 0x0F);
1.24
1.25 - Select(IT87_GPIO_LDN);
1.26 - ushort gpioAddress = ReadWord(BASE_ADDRESS_REGISTER + 2);
1.27 - Thread.Sleep(1);
1.28 - ushort gpioVerify = ReadWord(BASE_ADDRESS_REGISTER + 2);
1.29 -
1.30 + ushort gpioAddress;
1.31 + ushort gpioVerify;
1.32 + if (chip == Chip.IT8705F) {
1.33 + Select(IT8705_GPIO_LDN);
1.34 + gpioAddress = ReadWord(BASE_ADDRESS_REGISTER);
1.35 + Thread.Sleep(1);
1.36 + gpioVerify = ReadWord(BASE_ADDRESS_REGISTER);
1.37 + } else {
1.38 + Select(IT87XX_GPIO_LDN);
1.39 + gpioAddress = ReadWord(BASE_ADDRESS_REGISTER + 2);
1.40 + Thread.Sleep(1);
1.41 + gpioVerify = ReadWord(BASE_ADDRESS_REGISTER + 2);
1.42 + }
1.43 +
1.44 IT87Exit();
1.45
1.46 if (address != verify || address < 0x100 || (address & 0xF007) != 0) {