A-2
A-3
GPIO WDT BKL Programming
MS-98L1
General Purposed IO
1. General
Purposed
IO
–
GPIO/DIO
The
GPIO
port
configuration
addresses
are
listed
in
the
following
table:
Name
IO
Port
IO
address
Name
IO
Port
IO
address
N_GPI0
0x42
Bit
0
N_GPO0
0x11
Bit
0
N_GPI1
0x42
Bit
1
N_GPO1
0x11
Bit
1
N_GPI2
0x42
Bit
2
N_GPO2
0x11
Bit
2
N_GPI3
0x42
Bit
3
N_GPO3
0x11
Bit
3
N_GPI4
0x42
Bit
4
N_GPO4
0x11
Bit
7
N_GPI5
0x42
Bit
5
N_GPO5
0x11
Bit
6
N_GPI6
0x42
Bit
6
N_GPO6
0x11
Bit
5
N_GPI7
0x42
Bit
7
N_GPO7
0x11
Bit
4
Note:
GPIO
should
be
accessed
through
controller
device
0x6E
on
SMBus.
The
associated
access
method
in
examples
(
SMBus_ReadByte
,
SMBus_WriteByte
)
are
provided
in
part
4.
1.1
Set
output
value
of
GPO
1. Read
the
value
from
GPO
port.
2. Set
the
value
of
GPO
address.
3. Write
the
value
back
to
GPO
port.
Example:
Set
N_GPO0
output
“high”
val
=SMBus_ReadByte
(0x6E,
0x11
);
//
Read
value
from
N_GPO0
port
through
SMBus.
val
=
val
|
(1<<
0
);
//
Set
N_GPO0
address
(bit
0)
to
1
(output
“high”).
SMBus_WriteByte
(0x6E,
0x11
,
val);
//
Write
back
to
N_GPO0
port
through
SMBus.
Example:
Set
N_GPO1
output
“low”
val
=
SMBus_ReadByte
(0x6E,
0x11
);
//
Read
value
from
N_GPO1
port
through
SMBus..
val
=
val
&
(~(1<<
1
));
//
Set
N_GPO1
address
(bit
1)
to
0
(output
“low”).
SMBus_WriteByte
(0x6E,
0x11
,
val);
//
Write
back
to
N_GPO1
port
through
SMBus.
1.2
Read
input
value
from
GPI:
1. Read
the
value
from
GPI
port.
2. Get
the
value
of
GPI
address.
Example:
Get
N_GPI2
input
value.
val
=
SMBus_ReadByte
(0x6E,
0x42
);
//
Read
value
from
N_GPI2
port
through
SMBus.
val
=
val
&
(1<<
2
);
//
Read
N_GPI2
address
(bit
2).
if
(val)
printf
(“Input
of
N_GPI2
is
High”);
else
printf
(“Input
of
N_GPI2
is
Low”);
Example:
Get
N_GPI6
input
value.
val
=
SMBus_ReadByte
(0x6E,
0x42
);
//
Read
value
from
N_GPI6
port
through
SMBus.
val
=
val
&
(1<<
6
);
//
Read
N_GPI6
address
(bit
6).
if
(val)
printf
(“Input
of
N_GPI6
is
High”);
else
printf
(“Input
of
N_GPI6
is
Low”);
Summary of Contents for MS-98L1
Page 1: ...i MS 98L1 v1 x Industrial Computer Board ...
Page 8: ......
Page 16: ......
Page 64: ......