MCUXpresso SDK API Reference Manual  Rev. 1
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

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...
 

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
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
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
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
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