![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Files | |
file | fsl_gpio.h |
Data Structures | |
struct | gpio_pin_config_t |
The GPIO pin configuration structure. More... | |
Enumerations | |
enum | gpio_pin_direction_t { kGPIO_DigitalInput = 0U, kGPIO_DigitalOutput = 1U } |
LPC GPIO direction definition. More... | |
enum | gpio_interrupt_mode_t { kGPIO_IntDisabled = 0U, kGPIO_IntLowLevel = 1U, kGPIO_IntHighLevel = 2U, kGPIO_IntRisingEdge = 3U, kGPIO_IntFallingEdge = 4U, kGPIO_IntRisingOrFallingEdge = 5U } |
GPIO interrupt mode definition. More... | |
Functions | |
void | GPIO_PinInit (GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *Config) |
Initializes a GPIO pin used by the board. More... | |
void | GPIO_PortInit (GPIO_Type *base, uint32_t port) |
Initializes the GPIO peripheral. More... | |
void | GPIO_PinSetInterruptConfig (GPIO_Type *base, uint32_t pin, gpio_interrupt_mode_t pinInterruptMode) |
Initializes the GPIO peripheral. More... | |
Driver version | |
#define | FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
LPC GPIO driver version 2.0.0. More... | |
struct gpio_pin_config_t |
Every pin can only be configured as either output pin or input pin at a time. If configured as a input pin, then leave the outputConfig unused.
Data Fields | |
gpio_pin_direction_t | direction |
Specifies the pin direction. More... | |
uint8_t | outputLogic |
Set a default output logic, which has no use in input. | |
gpio_pin_direction_t gpio_pin_config_t::direction |
#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
enum gpio_pin_direction_t |
void GPIO_PinInit | ( | GPIO_Type * | base, |
uint32_t | pin, | ||
const gpio_pin_config_t * | Config | ||
) |
To initialize the GPIO, define a pin configuration, either input or output, in the user file. Then, call the GPIO_PinInit() function.
This is an example to define an input pin or output pin configuration:
base | GPIO peripheral base pointer(Typically GPIO) |
pin | GPIO pin number |
config | GPIO pin configuration pointer |
void GPIO_PortInit | ( | GPIO_Type * | base, |
uint32_t | port | ||
) |
This function ungates the GPIO clock.
base | GPIO peripheral base pointer. |
port | GPIO port number. |
void GPIO_PinSetInterruptConfig | ( | GPIO_Type * | base, |
uint32_t | pin, | ||
gpio_interrupt_mode_t | pinInterruptMode | ||
) |
This function ungates the GPIO clock.
base | GPIO peripheral base pointer. |
pin | GPIO pin number |
pinInterruptMode | GPIO interrupt mode |