CoX Peripheral Interface V2.1
API Reference
GPIO

General-Purpose Input/Outputs (GPIO) Peripheral Driver. More...

Collaboration diagram for GPIO:

Modules

 xGPIO
 

CoX GPIO Peripheral Interface.



Detailed Description

General-Purpose Input/Outputs (GPIO) Peripheral Driver.

General Purpose Input/Output (a.k.a. GPIO) is a generic pin on a mcu whose behavior (including whether it is an input or output pin) can be controlled (programmed) through software.

Always an I/O line may be dedicated as a general-purpose I/O or be assigned to a function of an embedded peripheral.

An I/O line Can also pend an interrupt when detect rising edge, falling edge, low level or high level.


Contents


1. GPIO Physical Block

gpio_block.png


2. GPIO Functional Description


2.1 GPIO Data Control

2.1.1 GPIO Data Direction

The GPIO Control can configure each individual pin as :

2.1.2 GPIO Data Input/Output

Software Can drive the I/O line to High Level(digital 0) or Low Level(digital 0) when config as Output, or
sample the pin value when config as output.


2.2 GPIO Input Edge/Level Interrupt

The PIO Controller can be programmed to generate an interrupt when it detects an edge or a level on an I/O line.

The Interrupt mode can be:


2.3 GPIO AFIO Control

There is always an Alternate function I/O configuration (AFIO) to optimize the number of peripherals available for the various kinds of package. Highly flexible pin muxing allows use as GPIO or one of several peripheral functions.


2.4 GPIO Pad Control

The pad control registers allow software to configure the GPIO pads based on the application requirements. It contains:


3. GPIO Applications

The PIO can be used to read button state, drive LED, etc.

pio_button.png
pio_led.png


Note:
Here describes the common function of the GPIO Peripheral. The CoX Peripheral Interface is base on the functions above.