MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
GINT: Group GPIO Input Interrupt Driver

Overview

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

Files

file  fsl_gint.h
 

Typedefs

typedef void(* gint_cb_t )(void)
 GINT Callback function. More...
 

Enumerations

enum  gint_comb_t {
  kGINT_CombineOr = 0U,
  kGINT_CombineAnd = 1U
}
 GINT combine inputs type. More...
 
enum  gint_trig_t {
  kGINT_TrigEdge = 0U,
  kGINT_TrigLevel = 1U
}
 GINT trigger type. More...
 

Functions

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

Driver version

#define FSL_GINT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 Version 2.0.1. More...
 

Macro Definition Documentation

#define FSL_GINT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))

Typedef Documentation

typedef void(* gint_cb_t)(void)

Enumeration Type Documentation

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.

Function Documentation

void GINT_Init ( GINT_Type *  base)

This function initializes the GINT peripheral and enables the clock.

Parameters
baseBase address of the GINT peripheral.
Return values
None.
void GINT_SetCtrl ( GINT_Type *  base,
gint_comb_t  comb,
gint_trig_t  trig,
gint_cb_t  callback 
)

This function sets the control parameters of GINT peripheral.

Parameters
baseBase address of the GINT peripheral.
combControls if the enabled inputs are logically ORed or ANDed for interrupt generation.
trigControls if the enabled inputs are level or edge sensitive based on polarity.
callbackThis function is called when configured group interrupt is generated.
Return values
None.
void GINT_GetCtrl ( GINT_Type *  base,
gint_comb_t comb,
gint_trig_t trig,
gint_cb_t callback 
)

This function returns the control parameters of GINT peripheral.

Parameters
baseBase address of the GINT peripheral.
combPointer to store combine input value.
trigPointer to store trigger value.
callbackPointer to store callback function.
Return values
None.
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
baseBase address of the GINT peripheral.
portPort number.
polarityMaskEach bit position selects the polarity of the corresponding enabled pin. 0 = The pin is active LOW. 1 = The pin is active HIGH.
enableMaskEach bit position selects if the corresponding pin is enabled or not. 0 = The pin is disabled. 1 = The pin is enabled.
Return values
None.
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
baseBase address of the GINT peripheral.
portPort number.
polarityMaskPointer 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.
enableMaskPointer 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
None.
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
baseBase address of the GINT peripheral.
Return values
None.
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
baseBase address of the peripheral.
Return values
None.
static void GINT_ClrStatus ( GINT_Type *  base)
inlinestatic

This function clears the GINT status bit.

Parameters
baseBase address of the GINT peripheral.
Return values
None.
static uint32_t GINT_GetStatus ( GINT_Type *  base)
inlinestatic

This function returns the GINT status.

Parameters
baseBase 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
baseBase address of the GINT peripheral.
Return values
None.