2007-02-02 11:23:31 +01:00
|
|
|
|
;
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; Ghost Monitor - <EFBFBD>⨫<EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ਭ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⥬<EFBFBD>
|
2007-02-02 11:23:31 +01:00
|
|
|
|
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
|
|
|
|
; All Right Reserved
|
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> 稯<EFBFBD><EFBFBD> WinBond
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;
|
|
|
|
|
;
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>㣨<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>稪<EFBFBD><EFBFBD>
|
|
|
|
|
; W83627DHG <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ਭ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭 W83627EHF, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> DIV_B2
|
|
|
|
|
; + 16.03.06 <EFBFBD><EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>訡<EFBFBD><EFBFBD> <EFBFBD> wb_get_cpu_temper <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ࠤ<EFBFBD><EFBFBD><EFBFBD> (<EFBFBD>뫮 30.5 30.0 31.5 ...)
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;
|
|
|
|
|
;
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD>ન<EFBFBD><EFBFBD> (?) : H - H/W Monitor, G - Pb-free package, T - ACPI, S - Smart Card Reader Interface
|
2006-12-19 22:45:25 +01:00
|
|
|
|
; D - SuperIO supporting Intel* PECI* & SST* interfaces, U - UART
|
|
|
|
|
;
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; | Chip name | ID Vin Fanin PWM Temp ISA SMBus
|
|
|
|
|
msg_wb27HF: db 'W83627HF', 0 ; 0x20|0x21 9 3 2 3 + +
|
|
|
|
|
msg_wb27THF: db 'W83627THF', 0 ; 0x90|0x91 7 3 3 3 + +
|
|
|
|
|
msg_wb37THF: db 'W83637THF', 0 ; 0x80 7 3 3 3 + +
|
|
|
|
|
msg_wb97HF: db 'W83697HF', 0 ; 0x60|0x61 8 2 2 2 + -
|
2007-05-16 17:17:00 +02:00
|
|
|
|
msg_wb27THFA: db 'W83627THF-A', 0 ; 0x1A
|
2006-12-19 22:45:25 +01:00
|
|
|
|
|
2012-03-06 23:26:17 +01:00
|
|
|
|
msg_w83627DHG: db 'W83627DHG', 0 ; 0xC1 ? 5 ? 3 + +
|
|
|
|
|
msg_w83627EHF: db 'W83627EHF', 0 ; 0x88 10 5 3 3 + +
|
|
|
|
|
msg_w83627EHG: db 'W83627EHG', 0 ; 0xA1 10 5 3 3 + +
|
2006-12-19 22:45:25 +01:00
|
|
|
|
|
|
|
|
|
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; db 'W83781D', 0 ; 0x10|0x11 7 3 3 + +
|
|
|
|
|
; db 'W83782D', 0 ; 0x30 9 3 3 + +
|
|
|
|
|
; db 'AS99127F', 0 ; 0x31 7 3 3 - +
|
|
|
|
|
; db 'W83783S', 0 ; 0x40|0x41 5-6 3 1-2 - +
|
|
|
|
|
; db 'W83791D', 0 ; 0x70|0x71 10 5 3 - +
|
|
|
|
|
msg_wbunk: db 'Unknown Winbond', 0 ; other, non zero ;-)
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2006-12-19 22:45:25 +01:00
|
|
|
|
uglobal
|
|
|
|
|
wb_fans_num db 0
|
|
|
|
|
endg
|
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;-----------------------------------
|
|
|
|
|
wb_init:
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; <EFBFBD><EFBFBD>ઠ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2006-11-02 15:18:23 +01:00
|
|
|
|
; OUT - CF = 1 - error
|
2006-11-28 16:54:36 +01:00
|
|
|
|
cmp byte[acc_type], 2 ; Only ISA and SMBus
|
|
|
|
|
jae wb_no
|
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov al, 0x4e
|
2006-11-28 16:54:36 +01:00
|
|
|
|
xor bl, bl
|
|
|
|
|
call [IO_Write]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov al, 0x4f
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov ah, al ;!
|
|
|
|
|
mov al, 0x4e
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov bl, 0x80
|
2012-03-06 23:26:17 +01:00
|
|
|
|
call [IO_Write]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov al, 0x4f
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
cmp ax, 0xa35c
|
2012-03-06 23:26:17 +01:00
|
|
|
|
jne wb_no ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> Winbond !!!
|
2006-12-19 22:45:25 +01:00
|
|
|
|
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; --- 㧭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 稯<EFBFBD> --
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov al, 0x58
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
and al, 0xFE ; 0x20 = 0x21, 0x60 = 0x61, etc
|
2006-12-19 22:45:25 +01:00
|
|
|
|
mov byte[wb_fans_num], 3
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov edx, msg_wb27HF
|
|
|
|
|
cmp al, 0x20
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_wb27THF
|
|
|
|
|
cmp al, 0x90
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_wb37THF
|
|
|
|
|
cmp al, 0x80
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_wb97HF
|
|
|
|
|
cmp al, 0x60
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_wb27THFA
|
|
|
|
|
cmp al, 0x1A
|
|
|
|
|
je @f
|
2006-12-19 22:45:25 +01:00
|
|
|
|
mov byte[wb_fans_num], 5
|
|
|
|
|
mov edx, msg_w83627EHF
|
|
|
|
|
cmp al, 0x88
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_w83627EHG
|
|
|
|
|
cmp al, 0xA0
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, msg_w83627DHG
|
|
|
|
|
cmp al, 0xC0
|
|
|
|
|
je @f
|
|
|
|
|
mov byte[wb_fans_num], 3
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov edx, msg_wbunk
|
|
|
|
|
@@: mov [hwm_chip_name], edx
|
2006-11-02 15:18:23 +01:00
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
wb_no: stc
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;-----------------------------------
|
2006-11-28 16:54:36 +01:00
|
|
|
|
wb_getparam:
|
|
|
|
|
call wb_get_temp
|
|
|
|
|
call wb_get_fan_speed
|
|
|
|
|
mov edi, wb_coeff
|
|
|
|
|
call wb_get_volt
|
|
|
|
|
fld dword[V12]
|
|
|
|
|
fld dword[wb_n12v_const]
|
|
|
|
|
faddp st1, st0
|
|
|
|
|
fstp dword[V12]
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------
|
2006-11-02 15:18:23 +01:00
|
|
|
|
wb_get_temp:
|
|
|
|
|
; temp 1
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x4e ; <EFBFBD>롨ࠥ<EFBFBD> bank 1
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov bl, 1
|
|
|
|
|
call [IO_Write]
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x50 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD>ࠤ<EFBFBD><EFBFBD><EFBFBD>)
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
mov [hwm_temps], al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x51 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (x.5`C)
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
cmp al, 0 ; if al == 0 then x.0, else x.5
|
2006-11-02 15:18:23 +01:00
|
|
|
|
je @f
|
|
|
|
|
mov al, 5
|
2006-11-28 16:54:36 +01:00
|
|
|
|
@@: mov [hwm_temps + 1], al
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2006-11-28 16:54:36 +01:00
|
|
|
|
; temp 2 (3 SYSTIN)
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x4e ; <EFBFBD>롨ࠥ<EFBFBD> bank 0
|
2006-11-28 16:54:36 +01:00
|
|
|
|
xor bl, bl
|
|
|
|
|
call [IO_Write]
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x27 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD>ࠤ<EFBFBD><EFBFBD><EFBFBD>)
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
mov [hwm_temps + 2], al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
; temp 3 (VTIN)
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x4e ; <EFBFBD>롨ࠥ<EFBFBD> bank 2
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov bl, 2
|
|
|
|
|
call [IO_Write]
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x50 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD>ࠤ<EFBFBD><EFBFBD><EFBFBD>)
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
mov [hwm_temps + 4], al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x51 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>訩 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (x.5`C)
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
cmp al, 0 ; if al == 0 then x.0, else x.5
|
2006-11-02 15:18:23 +01:00
|
|
|
|
je @f
|
|
|
|
|
mov al, 5
|
2006-11-28 16:54:36 +01:00
|
|
|
|
@@: mov [hwm_temps + 5], al
|
|
|
|
|
|
2012-03-06 23:26:17 +01:00
|
|
|
|
; <EFBFBD><EFBFBD>ઠ ⥬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>稪<EFBFBD> <EFBFBD> 127.5`C <EFBFBD><EFBFBD> <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov ecx, 3
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov esi, hwm_temps
|
2006-11-02 15:18:23 +01:00
|
|
|
|
wb_check_temp:
|
|
|
|
|
cmp word[esi + ecx * 2 - 2], 0x057F
|
|
|
|
|
jne wb_temp_ok
|
|
|
|
|
mov word[esi + ecx * 2 - 2], 0
|
|
|
|
|
wb_temp_ok:
|
|
|
|
|
loop wb_check_temp
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------
|
|
|
|
|
wb_get_fan_speed:
|
|
|
|
|
; fan1
|
|
|
|
|
mov al, 0x47
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
and al, 0x30
|
|
|
|
|
shr al, 4
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov cl, al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
shl ebx, cl ; <- div1
|
2006-11-02 15:18:23 +01:00
|
|
|
|
xor eax, eax
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov al, 0x28
|
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
cmp al, 255
|
|
|
|
|
jne @f
|
2006-11-28 16:54:36 +01:00
|
|
|
|
xor eax, eax ; ???
|
|
|
|
|
ret ; ???
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@: mul ebx
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
2012-03-06 23:26:17 +01:00
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .div0
|
2006-11-02 15:18:23 +01:00
|
|
|
|
div ebx
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov [hwm_rpms], eax
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov al, 0x47
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
shr al, 6
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov cl, al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
shl ebx, cl ; <- div2
|
2006-11-02 15:18:23 +01:00
|
|
|
|
xor eax, eax
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov al, 0x29
|
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
cmp al, 255
|
|
|
|
|
jne @f
|
|
|
|
|
xor eax, eax
|
2012-03-06 23:26:17 +01:00
|
|
|
|
.div0:
|
2006-11-02 15:18:23 +01:00
|
|
|
|
ret
|
|
|
|
|
@@: mul ebx
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
2012-03-06 23:26:17 +01:00
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .div0
|
2006-11-02 15:18:23 +01:00
|
|
|
|
div ebx
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov [hwm_rpms + 4], eax
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-12-19 22:45:25 +01:00
|
|
|
|
mov al, 0x4B
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
shr al, 6
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov cl, al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
shl ebx, cl ; <- div3
|
2006-12-19 22:45:25 +01:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov al, 0x2A
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
cmp al, 255
|
|
|
|
|
jne @f
|
|
|
|
|
xor eax, eax
|
|
|
|
|
ret
|
|
|
|
|
@@: mul ebx
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
2012-03-06 23:26:17 +01:00
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .div0
|
2006-12-19 22:45:25 +01:00
|
|
|
|
div ebx
|
|
|
|
|
mov [hwm_rpms + 8], eax
|
|
|
|
|
|
|
|
|
|
cmp byte[wb_fans_num], 3
|
|
|
|
|
jna .wb_f_e
|
|
|
|
|
|
|
|
|
|
mov al, 0x59
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
and al, 3
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov cl, al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
shl ebx, cl ; <- div4, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> DIV_B2
|
2006-12-19 22:45:25 +01:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov al, 0x3F
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
cmp al, 255
|
|
|
|
|
jne @f
|
|
|
|
|
xor eax, eax
|
|
|
|
|
ret
|
|
|
|
|
@@: mul ebx
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
2012-03-06 23:26:17 +01:00
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .div0
|
2006-12-19 22:45:25 +01:00
|
|
|
|
div ebx
|
|
|
|
|
mov [hwm_rpms + 12], eax
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-12-19 22:45:25 +01:00
|
|
|
|
mov al, 0x59
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
shr al, 2
|
|
|
|
|
and al, 3
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
mov cl, al
|
2012-03-06 23:26:17 +01:00
|
|
|
|
shl ebx, cl ; <- div5, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> DIV_B2
|
2006-12-19 22:45:25 +01:00
|
|
|
|
xor eax, eax
|
2012-03-06 23:26:17 +01:00
|
|
|
|
mov al, 0x4e ; <EFBFBD>롨ࠥ<EFBFBD> bank 5
|
2006-12-19 22:45:25 +01:00
|
|
|
|
mov bl, 5
|
|
|
|
|
call [IO_Write]
|
|
|
|
|
mov al, 0x53
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
cmp al, 255
|
|
|
|
|
jne @f
|
|
|
|
|
xor eax, eax
|
|
|
|
|
ret
|
|
|
|
|
@@: mul ebx
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
2012-03-06 23:26:17 +01:00
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .wb_f_e
|
2006-12-19 22:45:25 +01:00
|
|
|
|
div ebx
|
|
|
|
|
mov [hwm_rpms + 16], eax
|
|
|
|
|
|
|
|
|
|
.wb_f_e:
|
2006-11-02 15:18:23 +01:00
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------
|
|
|
|
|
wb_get_volt:
|
2012-03-06 23:26:17 +01:00
|
|
|
|
;mov edi, wb_coeff ; <-- possible differences for miscellaneous chip
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov esi, hwm_voltages
|
|
|
|
|
xor ecx, ecx
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@: mov eax, ecx
|
|
|
|
|
add al, 0x20
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
fld dword [edi + ecx * 4]
|
|
|
|
|
push eax
|
|
|
|
|
fild dword [esp]
|
|
|
|
|
fmulp st1, st0
|
|
|
|
|
fstp dword [esi + ecx * 4]
|
|
|
|
|
pop eax
|
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx, 7
|
|
|
|
|
jb @b
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
wb_coeff: dd 0.016 ; Vcore
|
|
|
|
|
dd 0.016 ; Vin0
|
|
|
|
|
dd 0.016 ; Vin1 (+3.3V)
|
|
|
|
|
dd 0.02688 ; AVcc (+5V)
|
|
|
|
|
dd 0.0608 ; Vin2 (+12V)
|
|
|
|
|
dd 0.0822857142857145 ; -12V
|
|
|
|
|
dd -0.02408 ; -5V ; false
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
wb_n12v_const dd -14.9142857142857
|
2006-11-28 16:54:36 +01:00
|
|
|
|
|
2012-03-06 23:26:17 +01:00
|
|
|
|
|
|
|
|
|
|