GPIO
Introduction
A GR5526 SoC 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 are supplied by VDDIO_1. GPIO_16–GPIO_33 are supplied by VDDIO_0.
- All I/Os except GPIO_10–GPIO_25, GPIO_32, and GPIO_33 can retain their output levels when the system enters sleep mode.
- 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 GR5526 SoC.
A functional drawing of the GPIO pads is provided in 图 22. 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. However, if disabling the output causes a high impedance state, enable the pull-up or pull-down resistor during this period.
- 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). However, if the external device driving the input ever goes to a high impedance state, a pull-up or pull-down resistor must be enabled during this period.
GPIO_10–GPIO_25 become high impedance in sleep and cannot retain their output levels. During sleep, the signal level of these IOs is determined by the pull-up/pull-down resistors.
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: 0x00000000
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: 0xA000E000
- Offset: 0x008
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:0 |
DPAD_IN_EN |
RW |
0x0 |
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: 0x000
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:2 |
RSVD |
R |
Reserved bits |
|
1:0 |
DPAD_R_EN |
RW |
0x0 |
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: 0x004
- 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: 0x008
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:2 |
RSVD |
R |
Reserved bits |
|
1:0 |
DPAD_IN_EN |
RW |
0x0 |
Active l/O inputs to the GPIO_33 – GPIO_32 Value:
|
DPAD_R_EN_MISC
- Name: OSPI and XQSPI I/O Pull-Up/Down Resistor Enable Register
- Description: This register decides whether to use pull-up/down resistors.
- Base Address: 0x4000EE00
- Offset: 0x000
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
xqspi_io |
RW |
0x0 |
Value:
|
17 |
xqspi_cs |
RW |
0x0 |
Value:
|
16 |
xqspi_clk |
RW |
0x0 |
Value:
|
15:11 |
RSVD |
R |
Reserved bits |
|
10:3 |
ospi_io |
RW |
0x0 |
Value:
|
2 |
ospi_cs |
RW |
0x0 |
Value:
|
1 |
ospi_dqs |
RW |
0x0 |
Value:
|
0 |
ospi_clk |
RW |
0x0 |
Value:
|
DPAD_RTYP_MISC
- Name: OSPI and 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: 0x004
- Reset Value: 0x003F0000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
xqspi_io |
RW |
0x0 |
Value:
|
17 |
xqspi_cs |
RW |
0x0 |
Value:
|
16 |
xqspi_clk |
RW |
0x0 |
Value:
|
15:11 |
RSVD |
R |
Reserved bits |
|
10:3 |
ospi_io |
RW |
0x0 |
Value:
|
2 |
Ospi_cs |
RW |
0x0 |
Value:
|
1 |
ospi_dqs |
RW |
0x0 |
Value:
|
0 |
ospi_clk |
RW |
0x0 |
Value:
|
DPAD_IN_EN_MISC
- Name: OSPI and XQSPI Pin Input Enable Register
- Description: This register enables the input.
- Base Address: 0x4000E000
- Offset: 0x008
- Reset Value: 0x00000000
Bits | Field Name | RW | Reset | Description |
---|---|---|---|---|
31:22 |
RSVD |
R |
Reserved bits |
|
21:18 |
xqspi_io |
RW |
0x0 |
Value:
|
17 |
xqspi_cs |
RW |
0x0 |
Value:
|
16 |
xqspi_clk |
RW |
0x0 |
Value:
|
15:11 |
RSVD |
R |
Reserved bits |
|
10:3 |
ospi_io |
RW |
0x0 |
Value:
|
2 |
ospi_cs |
RW |
0x0 |
Value:
|
1 |
ospi_dqs |
RW |
0x0 |
Value:
|
0 |
ospi_clk |
RW |
0x0 |
Value:
|
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, VDDIO ≥ 1.7 V |
VDDIO – 0.4 |
VDDIO |
V |
|
VOH,M |
Output high voltage, 4 mA, VDDIO ≥ 2.5 V |
VDDIO – 0.4 |
VDDIO |
V |
|
VOH,H |
Output high voltage, 4 mA, VDDIO ≥ 3 V |
VDDIO – 0.4 |
VDDIO |
V |
|
VOL,L |
Output low voltage, 4 mA, VDDIO ≥1.7 V |
VSS |
VSS + 0.4 |
V |
|
VOL,M |
Output low voltage, 4 mA, VDDIO ≥ 2.5 V |
VSS |
VSS + 0.4 |
V |
|
VOL,H |
Output low voltage, 4 mA, VDDIO ≥ 3 V |
VSS |
VSS + 0.4 |
V |
|
IOL,L |
Current at VSS+0.4 V, output set low, VDDIO ≥1.7 V |
4 |
mA |
||
IOL,M |
Current at VSS+0.4 V, output set low, VDDIO ≥ 2.5 V |
5 |
mA |
||
IOH,L |
Current at VDD-0.4 V, output set high, VDDIO ≥ 1.7 V |
4 |
mA |
||
IOH,M |
Current at VDD-0.4 V, output set high, VDDIO ≥ 2.5 V |
5 |
mA |
||
tRF,15pF |
Rise/Fall time, 10% – 90%, 15 pF load |
5 |
8 |
ns |
|
tRF,25pF |
Rise/Fall time, 10% – 90%, 25 pF load |
6 |
13 |
ns |
|
RPU |
Pull-up resistance |
70 |
120 |
150 |
kΩ |
RPD |
Pull-down resistance |
70 |
120 |
150 |
kΩ |
CPAD |
Pad capacitance |
5 |
pF |