12#include "fsl_common.h"
26#define FSL_GPIO_DRIVER_VERSION (MAKE_VERSION(2, 0, 6))
60#if defined(__cplusplus)
101static inline void GPIO_WritePinOutput(
GPIO_Type *base, uint32_t pin, uint8_t output)
112static inline void GPIO_PortSet(
GPIO_Type *base, uint32_t mask)
114#if (defined(FSL_FEATURE_IGPIO_HAS_DR_SET) && (FSL_FEATURE_IGPIO_HAS_DR_SET == 1))
125static inline void GPIO_SetPinsOutput(
GPIO_Type *base, uint32_t mask)
127 GPIO_PortSet(base, mask);
136static inline void GPIO_PortClear(
GPIO_Type *base, uint32_t mask)
138#if (defined(FSL_FEATURE_IGPIO_HAS_DR_CLEAR) && (FSL_FEATURE_IGPIO_HAS_DR_CLEAR == 1))
139 base->DR_CLEAR = mask;
149static inline void GPIO_ClearPinsOutput(
GPIO_Type *base, uint32_t mask)
151 GPIO_PortClear(base, mask);
160static inline void GPIO_PortToggle(
GPIO_Type *base, uint32_t mask)
162#if (defined(FSL_FEATURE_IGPIO_HAS_DR_TOGGLE) && (FSL_FEATURE_IGPIO_HAS_DR_TOGGLE == 1))
163 base->DR_TOGGLE = mask;
176static inline uint32_t GPIO_PinRead(
GPIO_Type *base, uint32_t pin)
180 return (((base->DR) >> pin) & 0x1U);
187static inline uint32_t GPIO_ReadPinInput(
GPIO_Type *base, uint32_t pin)
189 return GPIO_PinRead(base, pin);
205static inline uint8_t GPIO_PinReadPadStatus(
GPIO_Type *base, uint32_t pin)
209 return (uint8_t)(((base->PSR) >> pin) & 0x1U);
216static inline uint8_t GPIO_ReadPadStatus(
GPIO_Type *base, uint32_t pin)
218 return GPIO_PinReadPadStatus(base, pin);
253static inline void GPIO_PortEnableInterrupts(
GPIO_Type *base, uint32_t mask)
264static inline void GPIO_EnableInterrupts(
GPIO_Type *base, uint32_t mask)
266 GPIO_PortEnableInterrupts(base, mask);
275static inline void GPIO_PortDisableInterrupts(
GPIO_Type *base, uint32_t mask)
284static inline void GPIO_DisableInterrupts(
GPIO_Type *base, uint32_t mask)
286 GPIO_PortDisableInterrupts(base, mask);
295static inline uint32_t GPIO_PortGetInterruptFlags(
GPIO_Type *base)
306static inline uint32_t GPIO_GetPinsInterruptFlags(
GPIO_Type *base)
308 return GPIO_PortGetInterruptFlags(base);
318static inline void GPIO_PortClearInterruptFlags(
GPIO_Type *base, uint32_t mask)
330static inline void GPIO_ClearPinsInterruptFlags(
GPIO_Type *base, uint32_t mask)
332 GPIO_PortClearInterruptFlags(base, mask);
336#if defined(__cplusplus)
_gpio_pin_direction
GPIO direction definition.
Definition: fsl_gpio.h:31
void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)
Sets the output level of the individual GPIO pin to logic 1 or 0.
Definition: fsl_gpio.c:115
uint8_t outputLogic
Definition: fsl_gpio.h:51
struct _gpio_pin_config gpio_pin_config_t
GPIO Init structure definition.
void GPIO_PinInit(GPIO_Type *base, uint32_t pin, const gpio_pin_config_t *Config)
Initializes the GPIO peripheral according to the specified parameters in the initConfig.
Definition: fsl_gpio.c:75
enum _gpio_interrupt_mode gpio_interrupt_mode_t
GPIO interrupt mode definition.
void GPIO_PinSetInterruptConfig(GPIO_Type *base, uint32_t pin, gpio_interrupt_mode_t pinInterruptMode)
Sets the current pin interrupt mode.
Definition: fsl_gpio.c:144
gpio_interrupt_mode_t interruptMode
Definition: fsl_gpio.h:53
gpio_pin_direction_t direction
Definition: fsl_gpio.h:50
enum _gpio_pin_direction gpio_pin_direction_t
GPIO direction definition.
_gpio_interrupt_mode
GPIO interrupt mode definition.
Definition: fsl_gpio.h:38
@ kGPIO_DigitalOutput
Definition: fsl_gpio.h:33
@ kGPIO_DigitalInput
Definition: fsl_gpio.h:32
@ kGPIO_IntFallingEdge
Definition: fsl_gpio.h:43
@ kGPIO_NoIntmode
Definition: fsl_gpio.h:39
@ kGPIO_IntHighLevel
Definition: fsl_gpio.h:41
@ kGPIO_IntRisingEdge
Definition: fsl_gpio.h:42
@ kGPIO_IntRisingOrFallingEdge
Definition: fsl_gpio.h:44
@ kGPIO_IntLowLevel
Definition: fsl_gpio.h:40
Definition: MIMXRT1052.h:22478
GPIO Init structure definition.
Definition: fsl_gpio.h:49