The MCUXpresso SDK provides a driver for the Group GPIO Input Interrupt (GINT).
It can configure one or more pins to generate a group interrupt when the pin conditions are met. The pins do not have to be configured as gpio pins.
Group GPIO Input Interrupt Driver operation
GINT_SetCtrl() and GINT_ConfigPins() functions configure the pins.
GINT_EnableCallback() function enables the callback functionality. Callback function is called when the pin conditions are met.
Typical use case
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/gint
|
void | GINT_Init (GINT_Type *base) |
| Initialize GINT peripheral. More...
|
|
void | GINT_SetCtrl (GINT_Type *base, gint_comb_t comb, gint_trig_t trig, gint_cb_t callback) |
| Setup GINT peripheral control parameters. More...
|
|
void | GINT_GetCtrl (GINT_Type *base, gint_comb_t *comb, gint_trig_t *trig, gint_cb_t *callback) |
| Get GINT peripheral control parameters. More...
|
|
void | GINT_ConfigPins (GINT_Type *base, gint_port_t port, uint32_t polarityMask, uint32_t enableMask) |
| Configure GINT peripheral pins. More...
|
|
void | GINT_GetConfigPins (GINT_Type *base, gint_port_t port, uint32_t *polarityMask, uint32_t *enableMask) |
| Get GINT peripheral pin configuration. More...
|
|
void | GINT_EnableCallback (GINT_Type *base) |
| Enable callback. More...
|
|
void | GINT_DisableCallback (GINT_Type *base) |
| Disable callback. More...
|
|
static void | GINT_ClrStatus (GINT_Type *base) |
| Clear GINT status. More...
|
|
static uint32_t | GINT_GetStatus (GINT_Type *base) |
| Get GINT status. More...
|
|
void | GINT_Deinit (GINT_Type *base) |
| Deinitialize GINT peripheral. More...
|
|
typedef void(* gint_cb_t)(void) |
Enumerator |
---|
kGINT_CombineOr |
A grouped interrupt is generated when any one of the enabled inputs is active.
|
kGINT_CombineAnd |
A grouped interrupt is generated when all enabled inputs are active.
|
Enumerator |
---|
kGINT_TrigEdge |
Edge triggered based on polarity.
|
kGINT_TrigLevel |
Level triggered based on polarity.
|
void GINT_Init |
( |
GINT_Type * |
base | ) |
|
This function initializes the GINT peripheral and enables the clock.
- Parameters
-
base | Base address of the GINT peripheral. |
- Return values
-
This function sets the control parameters of GINT peripheral.
- Parameters
-
base | Base address of the GINT peripheral. |
comb | Controls if the enabled inputs are logically ORed or ANDed for interrupt generation. |
trig | Controls if the enabled inputs are level or edge sensitive based on polarity. |
callback | This function is called when configured group interrupt is generated. |
- Return values
-
This function returns the control parameters of GINT peripheral.
- Parameters
-
base | Base address of the GINT peripheral. |
comb | Pointer to store combine input value. |
trig | Pointer to store trigger value. |
callback | Pointer to store callback function. |
- Return values
-
void GINT_ConfigPins |
( |
GINT_Type * |
base, |
|
|
gint_port_t |
port, |
|
|
uint32_t |
polarityMask, |
|
|
uint32_t |
enableMask |
|
) |
| |
This function enables and controls the polarity of enabled pin(s) of a given port.
- Parameters
-
base | Base address of the GINT peripheral. |
port | Port number. |
polarityMask | Each bit position selects the polarity of the corresponding enabled pin. 0 = The pin is active LOW. 1 = The pin is active HIGH. |
enableMask | Each bit position selects if the corresponding pin is enabled or not. 0 = The pin is disabled. 1 = The pin is enabled. |
- Return values
-
void GINT_GetConfigPins |
( |
GINT_Type * |
base, |
|
|
gint_port_t |
port, |
|
|
uint32_t * |
polarityMask, |
|
|
uint32_t * |
enableMask |
|
) |
| |
This function returns the pin configuration of a given port.
- Parameters
-
base | Base address of the GINT peripheral. |
port | Port number. |
polarityMask | Pointer to store the polarity mask Each bit position indicates the polarity of the corresponding enabled pin. 0 = The pin is active LOW. 1 = The pin is active HIGH. |
enableMask | Pointer to store the enable mask. Each bit position indicates if the corresponding pin is enabled or not. 0 = The pin is disabled. 1 = The pin is enabled. |
- Return values
-
void GINT_EnableCallback |
( |
GINT_Type * |
base | ) |
|
This function enables the interrupt for the selected GINT peripheral. Although the pin(s) are monitored as soon as they are enabled, the callback function is not enabled until this function is called.
- Parameters
-
base | Base address of the GINT peripheral. |
- Return values
-
void GINT_DisableCallback |
( |
GINT_Type * |
base | ) |
|
This function disables the interrupt for the selected GINT peripheral. Although the pins are still being monitored but the callback function is not called.
- Parameters
-
base | Base address of the peripheral. |
- Return values
-
static void GINT_ClrStatus |
( |
GINT_Type * |
base | ) |
|
|
inlinestatic |
This function clears the GINT status bit.
- Parameters
-
base | Base address of the GINT peripheral. |
- Return values
-
static uint32_t GINT_GetStatus |
( |
GINT_Type * |
base | ) |
|
|
inlinestatic |
This function returns the GINT status.
- Parameters
-
base | Base address of the GINT peripheral. |
- Return values
-
status | = 0 No group interrupt request. = 1 Group interrupt request active. |
void GINT_Deinit |
( |
GINT_Type * |
base | ) |
|
This function disables the GINT clock.
- Parameters
-
base | Base address of the GINT peripheral. |
- Return values
-