CN / EN
文档反馈
感谢关注汇顶文档,期待您的宝贵建议!
感谢您的反馈,祝您愉快!
无匹配项 共计114个匹配页面

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.

Figure 35 GPIO pad diagram

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
Table 273 DPAD_R_EN_BUS_0 Register
Bits Field Name RW Reset Description

31:0

DPAD_R_EN

RW

0x0

Resistor enable control of GPIO_31–GPIO_0

Value:

  • 0x0: Disable pull-up/down resistor.
  • 0x1: Enable pull-up/down resistor.

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
Table 274 DPAD_RTYP_BUS_0 Register
Bits Field Name RW Reset Description

31:0

DPAD_RTYP

RW

0x0

Resistor type of GPIO_31–GPIO_0

Value:

  • 0x0: Pull down.
  • 0x1: Pull up.

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
Table 275 DPAD_IN_EN_BUS_0 Register
Bits Field Name RW Reset Description

31:0

DPAD_IN_EN

RW

0xFFFFFFFF

Active l/O inputs to GPIO_31–GPIO_0

Value:

  • 0x0: Disable inputs to pad.
  • 0x1: Enable inputs to pad.

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
Table 276 DPAD_R_EN_BUS_1 Register
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:

  • 0x0: Disable pull-up/down resistor.

  • 0x1: Enable pull-up/down resistor.

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
Table 277 DPAD_RTYP_BUS_1 Register
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:

  • 0x0: Pull down.

  • 0x1: Pull up.

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
Table 278 DPAD_IN_EN_BUS_1 Register
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:

  • 0x0: Disable inputs to pad.
  • 0x1: Enable inputs to pad.

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
Table 279 DPAD_R_EN_MISC Register
Bits Field Name RW Reset Description

31:22

RSVD

R

Reserved bits

21:18

XQSPI _IO

RW

0xF

Value:

  • 0x0: Disable pull-up/down resistor for XQSPI I/O.
  • 0x1: Enable pull-up/down resistor for XQSPI I/O.

17

XQSPI_CS

RW

0x1

Value:

  • 0x0: Disable pull-up/down resistor for XQSPI CS.
  • 0x1: Enable pull-up/down resistor for XQSPI CS.

16

XQSPI_CLK

RW

0x0

Value:

  • 0x0: Disable pull-up/down resistor for XQSPI clk.
  • 0x1: Enable pull-up/down resistor for XQSPI clk.

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
Table 280 DPAD_RTYP_MISC Register
Bits Field Name RW Reset Description

31:22

RSVD

R

Reserved bits

21:18

XQSPI_IO

RW

0xF

Value:

  • 0x0: Pull down.
  • 0x1: Pull up.

17

XQSPI_IO

RW

0x1

Value:

  • 0x0: Pull down.
  • 0x1: Pull up.

16

XQSPI_CLK

RW

0x1

Value:

  • 0x0: Pull down.
  • 0x1: Pull up.

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
Table 281 DPAD_IN_EN_MISC Register
Bits Field Name RW Reset Description

31:22

RSVD

R

Reserved bits

21:18

XQSPI_IO

RW

0xF

Value:

  • 0x0: Disable inputs to pad for XQSPI I/O.
  • 0x1: Enable inputs to pad for XQSPI I/O.

17

XQSPI_CS

RW

0x1

Value:

  • 0x0: Disable inputs to pad for XQSPI CS.
  • 0x1: Enable inputs to pad for XQSPI CS.

16

XQSPI_CLK

RW

0x1

Value:

  • 0x0: Disable inputs to pad for XQSPI clk.
  • 0x1: Enable inputs to pad for XQSPI clk.

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
Table 282 GPIOx_DATA Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

DATA

RW

0x0

Data value [15:0]:

  • Read: Read the value that is sampled at pin
  • Write: Write the field to the GPIOx_DATA_OUT register.
Note:

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
Table 283 GPIOx_DATA_OUT Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

DATA_OUT

RW

0x0

Data output register value [15:0]:

  • Read: current value of data output register
  • Write: to data output register

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
Table 284 GPIOx_OUT_EN Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

EN

RW

0x0

Output enable set [15:0]:

Read:

  • 0x0: As input
  • 0x1: As output

Write:

  • 0x0: No effect
  • 0x1: Set the output enable bit.

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
Table 285 GPIOx_OUT_CLR Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

CLR

RW

0x0

Output enable clear [15:0]:

Read:

  • 0x0: as input
  • 0x1: as output

Write:

  • 0x0: No effect
  • 0x1: Clear the output enable bit.

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
Table 286 GPIOx_INT_EN Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

EN

RW

0x0

Interrupt enable set [15:0]:

Read:

  • 0x0: Interrupt disabled
  • 0x1: Interrupt enabled

Write:

  • 0x0: No effect
  • 0x1: Set the interrupt enable bit.

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
Table 287 GPIOx_INT_CLR Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

CLR

RW

0x0

Interrupt enable clear [15:0]:

Read:

  • 0x0: Interrupt disabled
  • 0x1: Interrupt enabled

Write:

  • 0x0: No effect
  • 0x1: Clear the interrupt enable bit.

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
Table 288 GPIOx_INT_TYPE_EN Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

EN

RW

0x0

Interrupt type set [15:0]:

Read:

  • 0x0: Low or high level
  • 0x1: Falling edge or rising edge

Write:

  • 0x0: No effect
  • 0x1: Set the interrupt type bit.

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
Table 289 GPIOx_INT_TYPE_CLR Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

CLR

RW

0h 0

Interrupt type clear [15:0]:

Read:

  • 0x0: Low or high level
  • 0x1: Falling edge or rising edge

Write:

  • 0x0: No effect
  • 0x1: Clear the interrupt type bit.

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
Table 290 GPIOx_INT_POL_EN Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

EN

RW

0h 0

Polarity configuration [15:0]:

Read:

  • 0x0: Low level or falling edge
  • 0x1: High level or rising edge

Write:

  • 0x0: No effect
  • 0x1: Set the interrupt polarity bit.

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
Table 291 GPIOx_INT_POL_CLR Register
Bits Field Name RW Reset Description

31:16

RSVD

R

Reserved bits

15:0

CLR

RW

0x0

Polarity configuration [15:0]:

Read:

  • 0x0: Low level or falling edge
  • 0x1: High level or rising edge

Write:

  • 0x0: No effect
  • 0x1: Clear the interrupt polarity bit.

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
Table 292 GPIOx_INT_STAT Register
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:

  • [15:0] IRQ status register

Write:

  • 0x0: No effect
  • 0x1: To clear the interrupt request

Electrical Specifications

The electrical parameters for the GPIO_0–GPIO_33 are as follows:

Table 293 GPIO electrical specifications
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

RPD

Pull-down resistance

20

CPAD

Pad capacitance

5

pF

扫描关注

打开微信,使用“扫一扫”即可关注。