Gpio Sample Code - MSI MS-98I8 Manual

Industrial computer board
Table of Contents

Advertisement

GPIO Sample Code

GPI 0 ~ GPI 3
GPI 0
IO Address
SIO GPIO Register
8Ah
Bit
0
Sample code
#1
GPO 0 ~ GPO 3
GPO 0
IO Address
SIO GPIO Register
89h
Bit
4
Sample code
#2
SIO_INDEX_Port
SIO_DATA_Port
SIO_UnLock_Value
SIO_Lock_Value
SIO_LDN_GPIO
SIO_GPIO_Data
SIO_GPIO_Status
GPI_0
GPO_0
Sample Code:
#1 : Get GPI 0 status
; 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
mov
dx, SIO_INDEX_Port
mov
al, 07h
out
dx, al
mov
dx, SIO_DATA_Port
mov
al, SIO_LDN_GPIO
out
dx, al
; Get GPI 0 Pin Status Register
GPI 1
GPI 2
GPI 3
8Ah
8Ah
8Ah
1
2
3
GPO 1
GPO 2
GPO 3
89h
89h
89h
5
6
7
equ
04Eh
equ
04Fh
equ
087h
equ
0AAh
equ
06h
equ
089h
equ
08Ah
equ
00000001b
equ
00010000b
;Io_delay
;Io_delay
MS-98I8
A-3

Advertisement

Table of Contents
loading

Table of Contents