NAR-5050/5070 Series User
’
s Manual
23
GPCFG1
db F1h
; Index F1h
GPDI4
db 0Bh
; Offset 0Bh
push dx
push bx
push ax
;
RD_R2D Step 1: Select multiplex pin,pin51,as GPIO45 Definition
( Clear Index-23h_Bit1 )
mov dx,Index_IO_Port
; Read SIOCFG3 First
mov al,SIOCFG3
out dx,al
mov dx,Data_IO_Port
in al,dx
and al,0fdh
; Clear Bit1 to 0
mov ah,al
; keep in AH
mov dx,Index_IO_Port
mov al,SIOCFG3
out dx,al
mov dx,Data_IO_Port
mov al,ah
out dx,al
; SIOCFG3_Bit1P0
;
RD_R2D Step 2 : Enable GPIO function ( Set GPIO_Index-30h_Bit0 )
mov dx,Index_IO_Port
; Point to GPIO_LDN ( LDN = 7 )
mov al,07
out dx,al
mov dx,Data_IO_Port
mov al,GPIO_LDN
out dx,al
mov dx,Index_IO_Port
; Read Index 30h First
mov al,30h
out dx,al
mov dx,Data_IO_Port
in al,dx
or al,01h
; Set Bit0 to 1
mov ah,al
; keep in AH
mov dx,Index_IO_Port
mov al,30h
out dx,al
mov dx,Data_IO_Port
mov al,ah
out dx,al
; Index30h_bit0P1
;
RD_R2D Step 3 : Select GPIO Port number and Pin Number ( GPSEL_P45h )
;GPSEL_bit[6..4]=Port number , GPSEL_bit[2..0]= Pin Number
;GPIO45 : Port number = 4 , Pin number = 5
mov dx,Index_IO_Port
mov al,GPSEL
out dx,al
mov dx,Data_IO_Port