Gpio Sample Code - MSI MS-98F6 Owner's Manual

Industrial computer board
Table of Contents

Advertisement

GPIO Sample Code

GPI 0 ~ GPI 3
IO Address
SIO GPIO Register
Bit
Sample code
GPO 0 ~ GPO 3
IO Address
SIO GPIO Register
Bit
Sample code
SIO_INDEX_Port
SIO_DATA_Port
SIO_UnLock_Value
SIO_Lock_Value
SIO_LDN_GPIO
GPI_REG
GPO_REG
GPI_ADD
GPO_ADD
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
mov
dx, SIO_INDEX_Port
mov
al, GPI_REG
out
dx, al
mov
dx, SIO_DATA_Port
in
al, dx
;al bit0 = GPI 0 status
Exit SIO
;
GPI 0
GPI 1
GPI 2
82h
82h
82h
0
1
2
#1
GPO 0
GPO 1
GPO 2
81h
81h
81h
4
5
6
#2
equ
04Eh
equ
04Fh
equ
087h
equ
0AAh
equ
06h
equ
082h
equ
081h
equ
000h
equ
000h
equ
00010000b
;Io_delay
;Io_delay
GPI 3
82h
3
GPO 3
81h
7
MS-98F6
A-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents