Gpio Sample Code - MSI MS-98H9 Manual

Industrial computer board
Table of Contents

Advertisement

GPIO Sample Code

GPI 0 ~ GPI 3
GPI 0
IO Address
F040h
Slave Address
9Ch
SIO GPIO Register
42h
Bit
1
Sample code
#1
GPO 0 ~ GPO 3
GPO 0
IO Address
F040h
Slave Address
9Ch
SIO GPIO Register
22h
Bit
4
Sample code
#2
SMBUS_BASE_ADDRESS
SLAVEADDRESS
GPI0_REG
GPO0_REG
GPO0_Value
Sample Code:
#1 : Get GPI 0 status
mov
dx, GPI0_REG
in
al, dx
#2 : Set GPO 0 status to high
mov
dx, GPO0_REG
in
al, dx
and
al, not GPO0_Value
or
al, GPO0_Value
out
dx, al
GPI 1
GPI 2
GPI 3
F040h
F040h
F040h
9Ch
9Ch
9Ch
42h
42h
22h
2
3
3
#1
#1
#1
GPO 1
GPO 2
GPO 3
F040h
F040h
F040h
9Ch
9Ch
9Ch
22h
22h
22h
5
6
7
#2
#2
#2
equ
F040h
;IO Address
equ
9Ch
;Slave Address
equ
42h
equ
22h
equ
00010000b
;al bit0 = GPI 0 status
;al bit4 = GPO 0 status
MS-98H9
A-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents