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
|
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...
|
|
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
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
pin | RGPIO port pin number |
config | RGPIO pin configuration pointer |
uint32_t RGPIO_GetInstance |
( |
RGPIO_Type * |
base | ) |
|
- Parameters
-
base | RGPIO peripheral base pointer(PTA, PTB, PTC, etc.) |
- Return values
-
static void RGPIO_PinWrite |
( |
RGPIO_Type * |
base, |
|
|
uint32_t |
pin, |
|
|
uint8_t |
output |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
pin | RGPIO pin number |
output | RGPIO 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
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO 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
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO 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
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO pin number macro |
static void RGPIO_PortToggle |
( |
RGPIO_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO 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
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
pin | RGPIO pin number |
- Return values
-
RGPIO | port 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 |
static void RGPIO_EnablePortInput |
( |
RGPIO_Type * |
base, |
|
|
uint32_t |
mask, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO pin number mask |
enable | RGPIO digital input enable/disable flag. |
- Parameters
-
base | RGPIO peripheral base pointer. |
pin | RGPIO pin number. |
sel | RGPIO pin interrupt selection(0-3). |
config | RGPIO pin interrupt configuration. |
- Parameters
-
base | RGPIO peripheral base pointer (RGPIOA, RGPIOB, RGPIOC, and so on.) |
mask | RGPIO pin number macro. |
sel | RGPIO pin interrupt selection(0-3). |
config | RGPIO pin interrupt configuration. |
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
-
base | RGPIO peripheral base pointer. |
sel | RGPIO 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
-
base | RGPIO peripheral base pointer. |
sel | RGPIO pin interrupt selection(0-3). |
mask | RGPIO pin number macro. |