
A-3
GPIO WDT BKL Programming
MS-9A79
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
0xA05
Bit
3
N_GPO0
0xA10
Bit
0
N_GPI1
0xA05
Bit
4
N_GPO1
0xA10
Bit
1
N_GPI2
0xA05
Bit 5
N_GPO2
0xA10
Bit
2
N_GPI3
0xA05
Bit 6
N_GPO3
0xA10
Bit
3
N_GPI4
0xA05
Bit
0
N_GPO4
0xA10
Bit
4
N_GPI5
0xA05
Bit
7
N_GPO5
0xA10
Bit
5
N_GPI6
0xA05
Bit
2
N_GPO6
0xA10
Bit
6
N_GPI7
0xA05
Bit
1
N_GPO7
0xA10
Bit
7
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
=
Inportb
(
0xA10
);
//
Read
value
from
N_GPO0
port.
val
=
val
|
(1<<
0
);
//
Set
N_GPO0
address
(bit
0)
to
1
(output
“high”).
Outportb
(
0xA10
,
val);
//
Write
back
to
N_GPO0
port.
Example:
Set
N_GPO1
output
“low”
val
=
Inportb
(
0xA10
);
//
Read
value
from
N_GPO1
port.
val
=
val
&
(~(1<<
1
));
//
Set
N_GPO1
address
(bit
1)
to
0
(output
“low”).
Outportb
(
0xA10
,
val);
//
Write
back
to
N_GPO1
port.
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
=
Inportb
(
0xA05
);
//
Read
value
from
N_GPI2
port.
val
=
val
&
(1<<
5
);
//
Read
N_GPI2
address
(bit
5).
if
(val)
printf
(“Input
of
N_GPI2
is
High”);
else
printf
(“Input
of
N_GPI2
is
Low”);
Содержание 939-9A79-002
Страница 1: ...i MS 9A79 Industrial Data Machine...
Страница 8: ......
Страница 11: ...1 3 MS 9A79 System Overview h h System I O Controls 1 7 8 1 2 3 4 5 14 9 10 11 12 13 16 6 1 1 15...
Страница 22: ...1 14 Overview System Dimensions...
Страница 23: ...1 15 MS 9A79 Mounting Brackets...
Страница 24: ...1 16 Overview...
Страница 31: ...2 7 MS 9A79 6 Connect the antenna cables...
Страница 37: ...2 13 MS 9A79 8 Fasten the screws to secure the system cover...
Страница 46: ......
Страница 66: ......