NXP Semiconductors
QN902x
User Manual of QN902x
UM10996
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2018. All rights reserved.
User Manual
Rev 1.3
— 05 November 2018
108 of 128
14.
GPIO
The QN9020/1 processor provides 31/15 highly-multiplexed general-purpose I/O (GPIO)
pins for generating and capturing application-specific input and output signals.
14.1
Instruction
Each pin can be programmed as an output, an input, or as bidirectional pin for certain
alternate functions overriding the value programmed in the GPIO direction registers.
When programmed as an input, the GPIO can also serve as an interrupt source. All GPIO
pins are configured as inputs with pull-ups during the assertion of all resets, and they
remain inputs until configured otherwise. In addition, select special-function GPIO pins
serve as bidirectional pins where the I/O direction is driven from the respective unit
overriding the GPIO direction register.
14.2
Features
Programmable interrupt generation capability
Registers for alternate function switching with pin multiplexing support
Inputs are sampled using a double flip-flop to avoid meta-stability issues
All ports have programmable internal pull-up/pull-down/high-z
As output, the GPIOs can be individually cleared or set
14.3
Functional Description
The GPIO signals operate as either general-purpose I/O (GPIO) or as alternate function
outputs.
Most GPIO pins are multiplexed with the alternate functions of the QN902x processor.
Certain modes within the serial controllers require extra pins. These functions are
externally available through specific GPIO pins and their use is described in the
following paragraphs.
14.3.1
General purpose I/O
During and just after reset, the alternate functions are not active and the I/O ports are
configured in the GPIO digital input mode.
All GPIOs can be configured as inputs or outputs by setting Pin Output Configuration
registers OUTENABLESET and OUTENABLECLR. If the pin is configured as an output, its
values can be set by writing to the Data Output Register DATAOUT. If the pin is
configured as an input, the programmed output state re-occurs when the pin is
reconfigured as an output.
The state of a GPIO pin can be validated by reading the GPIO Pin Output Enable register
OUTENABLESET. To get the value of a GPIO pin, one can read the Data Value register
DATA. The software can read these two registers at any time, even if the pin is
configured as an output.
The figure following shows a block diagram of a single GPIO pin.