PWM fan port connector
ASUS KGPE-D16, W83667HGB. Взят код из open-hardware-monitor. Типа такого:
static byte address = 0x09;
private const byte ADDRESS_REGISTER_OFFSET = 0x05;
private const byte DATA_REGISTER_OFFSET = 0x06;
private const byte BANK_SELECT_REGISTER = 0x4E;
static private readonly byte[] FAN_TACHO_REG =
new byte[] { 0x28, 0x29, 0x2A, 0x3F, 0x53 };
static private readonly byte[] FAN_TACHO_BANK =
new byte[] { 0, 0, 0, 0, 5 };
static private readonly byte[] FAN_BIT_REG =
new byte[] { 0x47, 0x4B, 0x4C, 0x59, 0x5D };
private readonly byte[] FAN_DIV_BIT0 = new byte[] { 36, 38, 30, 8, 10 };
private readonly byte[] FAN_DIV_BIT1 = new byte[] { 37, 39, 31, 9, 11 };
private readonly byte[] FAN_DIV_BIT2 = new byte[] { 5, 6, 7, 23, 15 };
static private byte ReadByte(byte bank, byte register)
{
Ring0.WriteIoPort(
(ushort)(address + ADDRESS_REGISTER_OFFSET), BANK_SELECT_REGISTER);
Ring0.WriteIoPort(
(ushort)(address + DATA_REGISTER_OFFSET), bank);
Ring0.WriteIoPort(
(ushort)(address + ADDRESS_REGISTER_OFFSET), register);
return Ring0.ReadIoPort(
(ushort)(address + DATA_REGISTER_OFFSET));
}
static private void WriteByte(byte bank, byte register, byte value)
{
Ring0.WriteIoPort(
(ushort)(address + ADDRESS_REGISTER_OFFSET), BANK_SELECT_REGISTER);
Ring0.WriteIoPort(
(ushort)(address + DATA_REGISTER_OFFSET), bank);
Ring0.WriteIoPort(
(ushort)(address + ADDRESS_REGISTER_OFFSET), register);
Ring0.WriteIoPort(
(ushort)(address + DATA_REGISTER_OFFSET), value);
}
static void Main(string[] args)
{
int i;
Ring0.Open();
if (!Ring0.WaitIsaBusMutex(10))
return;
i = 0;
byte fan;
fan = ReadByte(0, FAN_BIT_REG[i]);
int count = ReadByte(FAN_TACHO_BANK[i], FAN_TACHO_REG[i]);
Ring0.ReleaseIsaBusMutex();
Ring0.Close();
Console.WriteLine(fan);
Console.WriteLine(count);
}
Который естественно, не работает.
А вот сам порт
[Port Connector Information] (Type 8)
08 09 17 00 01 FF 00 00 FF 46 52 4E 54 5F 46 41 .........FRNT_FA
4E 31 00 00 N1..
Type 0x08 (8)
Length 0x09 (9)
Handle 0x0017 (23)
Internal Reference Designator String1 - "FRNT_FAN1"
Internal Connector Type 0xFF - Other
External Reference Designator NULL
External Connector Type 0x00 - None
Port Type 0xFF - Other
И что куда нужно записывать?
ЗЫ. Интерфейс, который хочется использовать - LPC. http://en.wikipedia.org/wiki/Low_Pin_Count Раньше я с железом особо не возился.