GPIO
Introduction
The device has up to 34 individually configurable GPIOs that can serve as peripherals or digital input/output.
Main Features
- Up to 34 digital GPIOs: GPIO_0–GPIO_15, GPIO_16–GPIO_23 and GPIO_32–GPIO_33 are supplied by VDDIO_1. GPIO_24–GPIO_31 are supplied by VDDIO_0.
- GPIO default state is input mode with pull-down.
- All GPIOs can be configured as being triggered by high level, low level, rising edge, falling edge, or both edges.
Functional Description
The 34 digital GPIOs can be used:
- For general-purpose input/output.
- To multiplex different peripherals on different output pins of the package.
- To multiplex debug signals from different blocks of the SoC.
A functional drawing of the GPIO pads is provided in Figure 35. The digital GPIO pads can be configured to set direction, enable pull-up/pull-down resistors, and enable output retention. GPIOs can also be read or written by firmware for applications that need direct access through the GPIOx registers.
The general rule for enabling the on-chip pull-up/pull-down resistors is as follows:
- If a GPIO is unused, enable a pull-down resistor.
- If a GPIO is configured as an output, disable the pull-up/pull-down resistor.
- If a GPIO is used as an input and is being actively driven high or low by an external device, disable the pull-up/pull-down resistor (the same thing goes when there is an external pull-up/pull-down resistor on the board. In this case, the on-chip resistor should always be disabled).
Registers
DPAD_R_EN_BUS_0
- Name: GPIO Pull-Up/Down Resistor Enable Register
- Description: This register decides whether to use pull-up/down resistors.
- Base Address: 0x4000EE00
- Offset: 0x000
- Reset Value: 0xFFFFFFFF
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:0 |
DPAD_R_EN |
RW |
0x0 |
Resistor enable control of GPIO_31–GPIO_0 Value:
|
DPAD_RTYP_BUS_0
- Name: GPIO Resistor Type Control Register
- Description: This register sets the resistor type to either pull-up or pull-down.
- Base Address: 0x4000EE00
- Offset: 0x004
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:0 |
DPAD_RTYP |
RW |
0x0 |
Resistor type of GPIO_31–GPIO_0 Value:
|
DPAD_IN_EN_BUS_0
- Name: GPIO Input Enable Register
- Description: This register enables a GPIO as input.
- Base Address: 0x4000EE00
- Offset: 0x008
- Reset Value: 0xFFFFFFFF
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:0 |
DPAD_IN_EN |
RW |
0xFFFFFFFF |
Active l/O inputs to GPIO_31–GPIO_0 Value:
|
DPAD_R_EN_BUS_1
- Name: GPIO Pull-Up/Down Resistor Enable Register
- Description: This register decides whether to use pull-up/down resistors.
- Base Address: 0x4000EE00
- Offset: 0x020
- Reset Value: 0x00000003
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:2 |
RSVD |
R |
Reserved bits |
|
1:0 |
DPAD_R_EN |
RW |
0x3 |
Resistor enable control of GPIO_33–GPIO_32. Value:
|
DPAD_RTYP_BUS_1
- Name: GPIO Pull-Up/Down Resistor Type Control Register
- Description: This register sets the resistor type to either pull-up or pull-down.
- Base Address: 0x4000EE00
- Offset: 0x024
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:2 |
RSVD |
R |
Reserved bits |
|
1:0 |
DPAD_RTYP |
RW |
0x0 |
Resistor type of GPIO_33–GPIO_32 Value:
|
DPAD_IN_EN_BUS_1
- Name: GPIO Input Enable Register
- Description: This register enables a GPIO as input.
- Base Address: 0x4000E000
- Offset: 0x028
- Reset Value: 0x00000003
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:2 |
RSVD |
R |
Reserved bits |
|
1:0 |
DPAD_IN_EN |
RW |
0x3 |
Active l/O inputs to the GPIO_33 – GPIO_32 Value:
|
DPAD_R_EN_MISC
- Name: XQSPI I/O Pull-Up/Down Resistor Enable Register
- Description: This register decides whether to use pull-up/down resistors.
- Base Address: 0x4000EE00
- Offset: 0x040
- Reset Value: 0x003F0000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
XQSPI _IO |
RW |
0xF |
Value:
|
17 |
XQSPI_CS |
RW |
0x1 |
Value:
|
16 |
XQSPI_CLK |
RW |
0x0 |
Value:
|
15:0 |
RSVD |
R |
Reserved bits |
DPAD_RTYP_MISC
- Name: XQSPI Pull-Up/Down Resistor Type Control Register
- Description: This register sets the resistor type to either pull-up or pull-down.
- Base Address: 0x4000EE00
- Offset: 0x044
- Reset Value: 0x003F0000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
XQSPI_IO |
RW |
0xF |
Value:
|
17 |
XQSPI_IO |
RW |
0x1 |
Value:
|
16 |
XQSPI_CLK |
RW |
0x1 |
Value:
|
15:0 |
RSVD |
R |
Reserved bits |
DPAD_IN_EN_MISC
- Name: XQSPI Pin Input Enable Register
- Description: This register enables the input.
- Base Address: 0x4000E000
- Offset: 0x048
- Reset Value: 0x003F0000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
XQSPI_IO |
RW |
0xF |
Value:
|
17 |
XQSPI_CS |
RW |
0x1 |
Value:
|
16 |
XQSPI_CLK |
RW |
0x1 |
Value:
|
15:0 |
RSVD |
R |
Reserved bits |
GPIOx_DATA
- Name: GPIO Data Value Register
- Description: This register contains the input data and can write it to data output register.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0000
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
DATA |
RW |
0x0 |
Data value [15:0]:
|
GPIOx includes GPIOA (GPIO_0–GPIO_15), GPIOB (GPIO_16–GPIO_31), and GPIOC (GPIO_32–GPIO_33).
GPIOx_DATA_OUT
- Name: GPIO Data Output Register
- Description: This register contains the output data.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0004
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
DATA_OUT |
RW |
0x0 |
Data output register value [15:0]:
|
GPIOx_OUT_EN
- Name: GPIO Output Enable Register
- Description: This register is used to enable the GPIO as output.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0010
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
EN |
RW |
0x0 |
Output enable set [15:0]: Read:
Write:
|
GPIOx_OUT_CLR
- Name: GPIO Output Enable Clear Register
- Description: This register is used to disable output bit.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0014
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
CLR |
RW |
0x0 |
Output enable clear [15:0]: Read:
Write:
|
GPIOx_INT_EN
- Name: GPIO Interrupt Enable Register
- Description: This register is used to enable GPIO interrupt.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0020
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
EN |
RW |
0x0 |
Interrupt enable set [15:0]: Read:
Write:
|
GPIOx_INT_CLR
- Name: GPIO Interrupt Enable Clear Register
- Description: This register is used to disable GPIO interrupt.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0024
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
CLR |
RW |
0x0 |
Interrupt enable clear [15:0]: Read:
Write:
|
GPIOx_INT_TYPE_EN
- Name: GPIO Interrupt Type Enable Register
- Description: This register is used to set GPIO interrupt type.
- Interrupt type is 0 and interrupt polarity is 0: low-level trigger interrupt
- Interrupt type is 0 and interrupt polarity is 1: high-level trigger interrupt
- Interrupt type is 1 and interrupt polarity is 0: falling edge trigger interrupt
- Interrupt type is 1 and interrupt polarity is 1: rising edge trigger interrupt
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0028
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
EN |
RW |
0x0 |
Interrupt type set [15:0]: Read:
Write:
|
GPIOx_INT_TYPE_CLR
- Name: GPIO Interrupt Type Clear Register
- Description: This register is used to disable GPIO interrupt type.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x002C
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
CLR |
RW |
0h 0 |
Interrupt type clear [15:0]: Read:
Write:
|
GPIOx_INT_POL_EN
- Name: GPIO Interrupt Polarity Enable Register
- Description: This register is used to enable GPIO interrupt polarity.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0030
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
EN |
RW |
0h 0 |
Polarity configuration [15:0]: Read:
Write:
|
GPIOx_INT_POL_CLR
- Name: GPIO Interrupt Polarity Disable Register
- Description: This register is used to disable GPIO interrupt polarity.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0034
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
CLR |
RW |
0x0 |
Polarity configuration [15:0]: Read:
Write:
|
GPIOx_INT_STAT
- Name: GPIO IRQ Status Register
- Description: This register contains GPIO interrupt status and is used to clear the interrupt request.
- Base Address: 0x40010000 + x*0x1000
- Offset: 0x0038
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:16 |
RSVD |
R |
Reserved bits |
|
15:0 |
STAT_CLR |
RW |
0x0 |
Write one to clear interrupt request: Read:
Write:
|
Electrical Specifications
The electrical parameters for the GPIO_0–GPIO_33 are as follows:
Parameter | Description | Min. | Typ. | Max. | Unit |
---|---|---|---|---|---|
VIH |
Input high voltage |
VDDIO x 0.7 |
VDDIO |
V |
|
VIL |
Input low voltage |
VSSIO |
VDDIO x 0.3 |
V |
|
VOH,L |
Output high voltage, 4 mA, VDD ≥ 1.7 V |
VDD – 0.4 |
VDD |
V |
|
VOH,M |
Output high voltage, 4 mA, VDD ≥ 2.5 V |
VDD – 0.4 |
VDD |
V |
|
VOH,H |
Output high voltage, 4 mA, VDD ≥ 3 V |
VDD – 0.4 |
VDD |
V |
|
VOL,L |
Output low voltage, 4 mA, VDD ≥1.7 V |
VSS |
VSS + 0.4 |
V |
|
VOL,M |
Output low voltage, 4 mA, VDD ≥ 2.5 V |
VSS |
VSS + 0.4 |
V |
|
VOL,H |
Output low voltage, 4 mA, VDD ≥ 3 V |
VSS |
VSS + 0.4 |
V |
|
IOL |
Current at VSS+0.4 V, output set low, VDD ≥1.7 V |
4 |
mA |
||
IOH |
Current at VDD-0.4 V, output set high, VDD ≥ 1.7 V |
4 |
mA |
||
RPU |
Pull-up resistance |
18 |
kΩ |
||
RPD |
Pull-down resistance |
20 |
kΩ |
||
CPAD |
Pad capacitance |
5 |
pF |