Advantech PCM-9588 Computer Hardware User Manual


 
PCM-9588 User Manual 86
;Output : AL - Value read
;==============================================================
Ct_I2CReadByteProcNear
push cx
mov dx,SMBus_Port +04h
inc ch
mov al,ch ;ID cmd(read)
out dx,al
NEWIODELAY
NEWIODELAY
call CT_Chk_SMBus_Ready
pop ax
mov dl,03h
out dx,al ;Index
NEWIODELAY
NEWIODELAY
mov dl,02h
mov al,48h
out dx,al ;Read data
NEWIODELAY
NEWIODELAY
mov cx, 100h
@@:
newiodelay
loop short @B
call CT_Chk_SMBus_Ready
mov dl,05
in al,dx ;Data0
NEWIODELAY
NEWIODELAY
ret
Ct_I2CReadByteEndp
;==============================================================
;Input : CL - register index
; CH - device ID