3GPIO Management
10
Copyright © 2018, www.
bluetrum.com. All Rights Reserved
10
3
GPIO Management
3.1
Features
1.
Control GPIO input/output direction by using direction register;
2.
Internal pull-up/pull-down resistor by using pull-up/pull-down resistor control register;
3.
Select suitable output driving current capability;
3.2
GPIO general control register
Register 3-1GPIOA: Port A data Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOA
WR
0x00
PAx data. Valid when PAx is used as GPIO
0: PAx is input low state when read and output low at PAx when write;
1:PAx is input high state when read and output high at PAx when write
Register 3-2GPIOASET: Port A Set output data Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOASET
WO
X
Set Pax output data. Write 1 set output data. Write 0 affect nothing.
Register 3-3GPIOACLR: Port A clear output data Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOACLR
WO
X
Clear Pax output data. Write 1 clear output data. Write 0 affect nothing.
Register 3-4GPIOADIR: Port A direction Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOADIR
WR
0xFF
PAx direction control
0: Output
1: Input
Register 3-5GPIOAPU: Port A pull-up Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOAPU
WR
0x0
PAx 10K
Ω pull-up resister control. Valid when PAx is used as input
0: disable
1: enable
Register 3-6GPIOAPD: Port A pull-down resister Register
Bit
Name
Mode
Default
Description
31:8
-
-
-
Unused
7:0
GPIOAPD
WR
0x0
PAx 10K
Ω pull-down resister control. Valid when PAx is used as input
0: disable
1: enable
Register 3-7GPIOAPU200K: Port A pull-up resister Register