MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The MCUXpresso SDK provides a peripheral driver for the Rapid General-Purpose Input/Output (RGPIO) module of MCUXpresso SDK devices.

Typical use case

Output Operation

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/rgpio

Input Operation

Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/rgpio

Functions

static void RGPIO_SetPinInterruptConfig (RGPIO_Type *base, uint32_t pin, rgpio_interrupt_sel_t sel, rgpio_interrupt_config_t config)
 Configures the gpio pin interrupt/DMA request. More...
 
static void _SetMultipleInterruptPinsConfig (RGPIO_Type *base, uint32_t mask, rgpio_interrupt_sel_t sel, rgpio_interrupt_config_t config)
 Sets the gpio interrupt configuration in ICR register for multiple pins. More...
 
static uint32_t RGPIO_GetPinsInterruptFlags (RGPIO_Type *base, rgpio_interrupt_sel_t sel)
 Reads the whole gpio status flag. More...
 
static void RGPIO_ClearPinsInterruptFlags (RGPIO_Type *base, rgpio_interrupt_sel_t sel, uint32_t mask)
 Clears the multiple pin interrupt status flag. More...
 

RGPIO Configuration

void RGPIO_PinInit (RGPIO_Type *base, uint32_t pin, const rgpio_pin_config_t *config)
 Initializes a RGPIO pin used by the board. More...
 
uint32_t RGPIO_GetInstance (RGPIO_Type *base)
 Gets the RGPIO instance according to the RGPIO base. More...
 

RGPIO Output Operations

static void RGPIO_PinWrite (RGPIO_Type *base, uint32_t pin, uint8_t output)
 Sets the output level of the multiple RGPIO pins to the logic 1 or 0. More...
 
static void RGPIO_WritePinOutput (RGPIO_Type *base, uint32_t pin, uint8_t output)
 Sets the output level of the multiple RGPIO pins to the logic 1 or 0. More...
 
static void RGPIO_PortSet (RGPIO_Type *base, uint32_t mask)
 Sets the output level of the multiple RGPIO pins to the logic 1. More...
 
static void RGPIO_SetPinsOutput (RGPIO_Type *base, uint32_t mask)
 Sets the output level of the multiple RGPIO pins to the logic 1. More...
 
static void RGPIO_PortClear (RGPIO_Type *base, uint32_t mask)
 Sets the output level of the multiple RGPIO pins to the logic 0. More...
 
static void RGPIO_ClearPinsOutput (RGPIO_Type *base, uint32_t mask)
 Sets the output level of the multiple RGPIO pins to the logic 0. More...
 
static void RGPIO_PortToggle (RGPIO_Type *base, uint32_t mask)
 Reverses the current output logic of the multiple RGPIO pins. More...
 
static void RGPIO_TogglePinsOutput (RGPIO_Type *base, uint32_t mask)
 Reverses the current output logic of the multiple RGPIO pins. More...
 

RGPIO Input Operations

static uint32_t RGPIO_PinRead (RGPIO_Type *base, uint32_t pin)
 Reads the current input value of the RGPIO port. More...
 
static uint32_t RGPIO_ReadPinInput (RGPIO_Type *base, uint32_t pin)
 Reads the current input value of the RGPIO port. More...
 
static void RGPIO_EnablePortInput (RGPIO_Type *base, uint32_t mask, bool enable)
 

Function Documentation

void RGPIO_PinInit ( RGPIO_Type *  base,
uint32_t  pin,
const rgpio_pin_config_t config 
)

To initialize the RGPIO, define a pin configuration, as either input or output, in the user file. Then, call the RGPIO_PinInit() function.

This is an example to define an input pin or an output pin configuration.

* Define a digital input pin configuration,
* {
* 0,
* }
* Define a digital output pin configuration,
* {
* 0,
* }
*
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
pinRGPIO port pin number
configRGPIO pin configuration pointer
uint32_t RGPIO_GetInstance ( RGPIO_Type *  base)
Parameters
baseRGPIO peripheral base pointer(PTA, PTB, PTC, etc.)
Return values
RGPIOinstance
static void RGPIO_PinWrite ( RGPIO_Type *  base,
uint32_t  pin,
uint8_t  output 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
pinRGPIO pin number
outputRGPIO pin output logic level.
  • 0: corresponding pin output low-logic level.
  • 1: corresponding pin output high-logic level.
static void RGPIO_WritePinOutput ( RGPIO_Type *  base,
uint32_t  pin,
uint8_t  output 
)
inlinestatic
Deprecated:
Do not use this function. It has been superceded by RGPIO_PinWrite.
static void RGPIO_PortSet ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number macro
static void RGPIO_SetPinsOutput ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Deprecated:
Do not use this function. It has been superceded by RGPIO_PortSet.
static void RGPIO_PortClear ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number macro
static void RGPIO_ClearPinsOutput ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Deprecated:
Do not use this function. It has been superceded by RGPIO_PortClear.
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number macro
static void RGPIO_PortToggle ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number macro
static void RGPIO_TogglePinsOutput ( RGPIO_Type *  base,
uint32_t  mask 
)
inlinestatic
Deprecated:
Do not use this function. It has been superceded by RGPIO_PortToggle.
static uint32_t RGPIO_PinRead ( RGPIO_Type *  base,
uint32_t  pin 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
pinRGPIO pin number
Return values
RGPIOport input value
  • 0: corresponding pin input low-logic level.
  • 1: corresponding pin input high-logic level.
static uint32_t RGPIO_ReadPinInput ( RGPIO_Type *  base,
uint32_t  pin 
)
inlinestatic
Deprecated:
Do not use this function. It has been superceded by RGPIO_PinRead.
static void RGPIO_EnablePortInput ( RGPIO_Type *  base,
uint32_t  mask,
bool  enable 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number mask
enableRGPIO digital input enable/disable flag.
static void RGPIO_SetPinInterruptConfig ( RGPIO_Type *  base,
uint32_t  pin,
rgpio_interrupt_sel_t  sel,
rgpio_interrupt_config_t  config 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer.
pinRGPIO pin number.
selRGPIO pin interrupt selection(0-3).
configRGPIO pin interrupt configuration.
static void _SetMultipleInterruptPinsConfig ( RGPIO_Type *  base,
uint32_t  mask,
rgpio_interrupt_sel_t  sel,
rgpio_interrupt_config_t  config 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.)
maskRGPIO pin number macro.
selRGPIO pin interrupt selection(0-3).
configRGPIO pin interrupt configuration.
static uint32_t RGPIO_GetPinsInterruptFlags ( RGPIO_Type *  base,
rgpio_interrupt_sel_t  sel 
)
inlinestatic

If a pin is configured to generate the DMA request, the corresponding flag is cleared automatically at the completion of the requested DMA transfer. Otherwise, the flag remains set until a logic one is written to that flag. If configured for a level sensitive interrupt that remains asserted, the flag is set again immediately.

Parameters
baseRGPIO peripheral base pointer.
selRGPIO pin interrupt selection(0-3).
Returns
Current gpio interrupt status flags, for example, 0x00010001 means the pin 0 and 16 have the interrupt.
static void RGPIO_ClearPinsInterruptFlags ( RGPIO_Type *  base,
rgpio_interrupt_sel_t  sel,
uint32_t  mask 
)
inlinestatic
Parameters
baseRGPIO peripheral base pointer.
selRGPIO pin interrupt selection(0-3).
maskRGPIO pin number macro.