Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
89
/
631
Figure 5-1 Basic structure of I/O port
I/O function description
I/O mode configuration
The IO port mode can be configured through the registers GPIOx_PMODE, GPIOx_POTYPE and GPIOx_PUPD
(x=A,B,C,D). The I/O configurations in different operation modes are shown in the following table:
Table 5-1 I/O port configuration table
PMODE[1:0]
POTYPE
PUPD[1:0]
I/O configuration
01
0
0
0
General-purpose
output
push-pull
0
0
1
General-purpose
output
push-pull
+
pull-up
0
1
0
General-purpose
output
push-pull
+
pull-down
0
1
1
Reserved
1
0
0
General-purpose
output
open-drain
1
0
1
General-purpose
output
open-drain
+
pull-up
1
1
0
General-purpose
output
open-drain
+
pull-down
1
1
1
Reserved
10
0
0
0
Alternate function
push-pull
0
0
1
Alternate function
push-pull
+
pull-up
0
1
0
Alternate function
push-pull
+
pull-down
0
1
1
Reserved
1
0
0
Alternate function
open-drain
Output
control
Write
Bit set/clear
register
Output data
register
Read /
Write
From on-chip peripheral
Alternate function output
V
DD
V
SS
P-MOS
N-MOS
To on-chip peripheral
I/O Pin
V
DD
V
SS
V
SS
Pull
up
Pull
down
diode
On
Off
Push-pull, open-drain or disabled
Input data
register
Alternate function input
Read
TTL Schmitt
trigger
On / Off
On
Off
Analog Input