Gpio Sample Code - MSI MS-98D1 Manual

V1.x industrial computer board
Table of Contents

Advertisement

GPIO Sample Code

GPI 0 ~ GPI 3
GPI 0
IO Address
50Ch
SIO GPIO Register
Bit
2
Sample code
#1
GPO 0 ~ GPO 3
GPO 0
IO Address
SIO GPIO Register
F1h
Bit
4
Sample code
#2
SIO_INDEX_Port
SIO_DATA_Port
SIO_UnLock_Value
SIO_Lock_Value
SIO_LDN_GPIO
GPO_REG
GPO_0
Sample Code:
#1 : Get GPI 0 status
; Get GPI 0/1/2/3 Pin Status Register
mov
dx, 50Ch
in
eax, dx
;eax bit2 = GPI 0 status
;eax bit3 = GPI 1 status
;eax bit4 = GPI 2 status
;eax bit5 = GPI 3 status
#2 : Set GPO 0 to high
; Enable config mode
mov
dx, SIO_INDEX_Port
mov
al, SIO_UnLock_Value
out
dx, al
jmp
short $+2
jmp
short $+2
out
dx, al
; Switch GPIO Configuration for SIO LDN 0x06
GPI 1
GPI 2
GPI 3
50Ch
50Ch
50Ch
3
4
5
GPO 1
GPO 2
GPO 3
F1h
F1h
F1h
1
2
3
equ
04Eh
equ
04Fh
equ
087h
equ
0AAh
equ
06h
equ
0F1h
equ
00010000b
;Io_delay
;Io_delay
MS-98D1
MS-98D1
A-3

Advertisement

Table of Contents
loading

Table of Contents