MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
PINT: Pin Interrupt and Pattern Match Driver

Overview

The MCUXpresso SDK provides a driver for the Pin Interrupt and Pattern match (PINT).

It can configure one or more pins to generate a pin interrupt when the pin or pattern match conditions are met. The pins do not have to be configured as gpio pins however they must be connected to PINT via INPUTMUX. Only the pin interrupt or pattern match function can be active for interrupt generation. If the pin interrupt function is enabled then the pattern match function can be used for wakeup via RXEV.

Pin Interrupt and Pattern match Driver operation

PINT_PinInterruptConfig() function configures the pins for pin interrupt.

PINT_PatternMatchConfig() function configures the pins for pattern match.

Pin Interrupt use case

void pint_intr_callback(pint_pin_int_t pintr, uint32_t pmatch_status)
{
/* Take action for pin interrupt */
}
/* Connect trigger sources to PINT */
INPUTMUX_Init(INPUTMUX);
INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt0, PINT_PIN_INT0_SRC);
/* Initialize PINT */
PINT_Init(PINT);
/* Setup Pin Interrupt 0 for rising edge */
/* Enable callbacks for PINT */

Pattern match use case

void pint_intr_callback(pint_pin_int_t pintr, uint32_t pmatch_status)
{
/* Take action for pin interrupt */
}
pint_pmatch_cfg_t pmcfg;
/* Connect trigger sources to PINT */
INPUTMUX_Init(INPUTMUX);
INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt0, PINT_PIN_INT0_SRC);
/* Initialize PINT */
PINT_Init(PINT);
/* Setup Pattern Match Bit Slice 0 */
pmcfg.bs_src = kPINT_PatternMatchInp0Src;
pmcfg.callback = pint_intr_callback;
pmcfg.end_point = true;
/* Enable PatternMatch */
/* Enable callbacks for PINT */

Files

file  fsl_pint.h
 

Typedefs

typedef void(* pint_cb_t )(pint_pin_int_t pintr, uint32_t pmatch_status)
 PINT Callback function. More...
 

Enumerations

enum  pint_pin_enable_t {
  kPINT_PinIntEnableNone = 0U,
  kPINT_PinIntEnableRiseEdge = PINT_PIN_RISE_EDGE,
  kPINT_PinIntEnableFallEdge = PINT_PIN_FALL_EDGE,
  kPINT_PinIntEnableBothEdges = PINT_PIN_BOTH_EDGE,
  kPINT_PinIntEnableLowLevel = PINT_PIN_LOW_LEVEL,
  kPINT_PinIntEnableHighLevel = PINT_PIN_HIGH_LEVEL
}
 PINT Pin Interrupt enable type. More...
 
enum  pint_pin_int_t { kPINT_PinInt0 = 0U }
 PINT Pin Interrupt type. More...
 
enum  pint_pmatch_input_src_t {
  kPINT_PatternMatchInp0Src = 0U,
  kPINT_PatternMatchInp1Src = 1U,
  kPINT_PatternMatchInp2Src = 2U,
  kPINT_PatternMatchInp3Src = 3U,
  kPINT_PatternMatchInp4Src = 4U,
  kPINT_PatternMatchInp5Src = 5U,
  kPINT_PatternMatchInp6Src = 6U,
  kPINT_PatternMatchInp7Src = 7U
}
 PINT Pattern Match bit slice input source type. More...
 
enum  pint_pmatch_bslice_t { kPINT_PatternMatchBSlice0 = 0U }
 PINT Pattern Match bit slice type. More...
 
enum  pint_pmatch_bslice_cfg_t {
  kPINT_PatternMatchAlways = 0U,
  kPINT_PatternMatchStickyRise = 1U,
  kPINT_PatternMatchStickyFall = 2U,
  kPINT_PatternMatchStickyBothEdges = 3U,
  kPINT_PatternMatchHigh = 4U,
  kPINT_PatternMatchLow = 5U,
  kPINT_PatternMatchNever = 6U,
  kPINT_PatternMatchBothEdges = 7U
}
 PINT Pattern Match configuration type. More...
 

Functions

void PINT_Init (PINT_Type *base)
 Initialize PINT peripheral. More...
 
void PINT_PinInterruptConfig (PINT_Type *base, pint_pin_int_t intr, pint_pin_enable_t enable, pint_cb_t callback)
 Configure PINT peripheral pin interrupt. More...
 
void PINT_PinInterruptGetConfig (PINT_Type *base, pint_pin_int_t pintr, pint_pin_enable_t *enable, pint_cb_t *callback)
 Get PINT peripheral pin interrupt configuration. More...
 
static void PINT_PinInterruptClrStatus (PINT_Type *base, pint_pin_int_t pintr)
 Clear Selected pin interrupt status. More...
 
static uint32_t PINT_PinInterruptGetStatus (PINT_Type *base, pint_pin_int_t pintr)
 Get Selected pin interrupt status. More...
 
static void PINT_PinInterruptClrStatusAll (PINT_Type *base)
 Clear all pin interrupts status. More...
 
static uint32_t PINT_PinInterruptGetStatusAll (PINT_Type *base)
 Get all pin interrupts status. More...
 
static void PINT_PinInterruptClrFallFlag (PINT_Type *base, pint_pin_int_t pintr)
 Clear Selected pin interrupt fall flag. More...
 
static uint32_t PINT_PinInterruptGetFallFlag (PINT_Type *base, pint_pin_int_t pintr)
 Get selected pin interrupt fall flag. More...
 
static void PINT_PinInterruptClrFallFlagAll (PINT_Type *base)
 Clear all pin interrupt fall flags. More...
 
static uint32_t PINT_PinInterruptGetFallFlagAll (PINT_Type *base)
 Get all pin interrupt fall flags. More...
 
static void PINT_PinInterruptClrRiseFlag (PINT_Type *base, pint_pin_int_t pintr)
 Clear Selected pin interrupt rise flag. More...
 
static uint32_t PINT_PinInterruptGetRiseFlag (PINT_Type *base, pint_pin_int_t pintr)
 Get selected pin interrupt rise flag. More...
 
static void PINT_PinInterruptClrRiseFlagAll (PINT_Type *base)
 Clear all pin interrupt rise flags. More...
 
static uint32_t PINT_PinInterruptGetRiseFlagAll (PINT_Type *base)
 Get all pin interrupt rise flags. More...
 
void PINT_PatternMatchConfig (PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg)
 Configure PINT pattern match. More...
 
void PINT_PatternMatchGetConfig (PINT_Type *base, pint_pmatch_bslice_t bslice, pint_pmatch_cfg_t *cfg)
 Get PINT pattern match configuration. More...
 
static uint32_t PINT_PatternMatchGetStatus (PINT_Type *base, pint_pmatch_bslice_t bslice)
 Get pattern match bit slice status. More...
 
static uint32_t PINT_PatternMatchGetStatusAll (PINT_Type *base)
 Get status of all pattern match bit slices. More...
 
uint32_t PINT_PatternMatchResetDetectLogic (PINT_Type *base)
 Reset pattern match detection logic. More...
 
static void PINT_PatternMatchEnable (PINT_Type *base)
 Enable pattern match function. More...
 
static void PINT_PatternMatchDisable (PINT_Type *base)
 Disable pattern match function. More...
 
static void PINT_PatternMatchEnableRXEV (PINT_Type *base)
 Enable RXEV output. More...
 
static void PINT_PatternMatchDisableRXEV (PINT_Type *base)
 Disable RXEV output. More...
 
void PINT_EnableCallback (PINT_Type *base)
 Enable callback. More...
 
void PINT_DisableCallback (PINT_Type *base)
 Disable callback. More...
 
void PINT_Deinit (PINT_Type *base)
 Deinitialize PINT peripheral. More...
 

Driver version

#define FSL_PINT_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 Version 2.0.0.
 

Typedef Documentation

typedef void(* pint_cb_t)(pint_pin_int_t pintr, uint32_t pmatch_status)

Enumeration Type Documentation

Enumerator
kPINT_PinIntEnableNone 

Do not generate Pin Interrupt.

kPINT_PinIntEnableRiseEdge 

Generate Pin Interrupt on rising edge.

kPINT_PinIntEnableFallEdge 

Generate Pin Interrupt on falling edge.

kPINT_PinIntEnableBothEdges 

Generate Pin Interrupt on both edges.

kPINT_PinIntEnableLowLevel 

Generate Pin Interrupt on low level.

kPINT_PinIntEnableHighLevel 

Generate Pin Interrupt on high level.

Enumerator
kPINT_PinInt0 

Pin Interrupt 0.

Enumerator
kPINT_PatternMatchInp0Src 

Input source 0.

kPINT_PatternMatchInp1Src 

Input source 1.

kPINT_PatternMatchInp2Src 

Input source 2.

kPINT_PatternMatchInp3Src 

Input source 3.

kPINT_PatternMatchInp4Src 

Input source 4.

kPINT_PatternMatchInp5Src 

Input source 5.

kPINT_PatternMatchInp6Src 

Input source 6.

kPINT_PatternMatchInp7Src 

Input source 7.

Enumerator
kPINT_PatternMatchBSlice0 

Bit slice 0.

Enumerator
kPINT_PatternMatchAlways 

Always Contributes to product term match.

kPINT_PatternMatchStickyRise 

Sticky Rising edge.

kPINT_PatternMatchStickyFall 

Sticky Falling edge.

kPINT_PatternMatchStickyBothEdges 

Sticky Rising or Falling edge.

kPINT_PatternMatchHigh 

High level.

kPINT_PatternMatchLow 

Low level.

kPINT_PatternMatchNever 

Never contributes to product term match.

kPINT_PatternMatchBothEdges 

Either rising or falling edge.

Function Documentation

void PINT_Init ( PINT_Type *  base)

This function initializes the PINT peripheral and enables the clock.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
void PINT_PinInterruptConfig ( PINT_Type *  base,
pint_pin_int_t  intr,
pint_pin_enable_t  enable,
pint_cb_t  callback 
)

This function configures a given pin interrupt.

Parameters
baseBase address of the PINT peripheral.
intrPin interrupt.
enableSelects detection logic.
callbackCallback.
Return values
None.
void PINT_PinInterruptGetConfig ( PINT_Type *  base,
pint_pin_int_t  pintr,
pint_pin_enable_t enable,
pint_cb_t callback 
)

This function returns the configuration of a given pin interrupt.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
enablePointer to store the detection logic.
callbackCallback.
Return values
None.
static void PINT_PinInterruptClrStatus ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function clears the selected pin interrupt status.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
None.
static uint32_t PINT_PinInterruptGetStatus ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function returns the selected pin interrupt status.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
status= 0 No pin interrupt request. = 1 Selected Pin interrupt request active.
static void PINT_PinInterruptClrStatusAll ( PINT_Type *  base)
inlinestatic

This function clears the status of all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static uint32_t PINT_PinInterruptGetStatusAll ( PINT_Type *  base)
inlinestatic

This function returns the status of all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
statusEach bit position indicates the status of corresponding pin interrupt. = 0 No pin interrupt request. = 1 Pin interrupt request active.
static void PINT_PinInterruptClrFallFlag ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function clears the selected pin interrupt fall flag.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
None.
static uint32_t PINT_PinInterruptGetFallFlag ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function returns the selected pin interrupt fall flag.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
flag= 0 Falling edge has not been detected. = 1 Falling edge has been detected.
static void PINT_PinInterruptClrFallFlagAll ( PINT_Type *  base)
inlinestatic

This function clears the fall flag for all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static uint32_t PINT_PinInterruptGetFallFlagAll ( PINT_Type *  base)
inlinestatic

This function returns the fall flag of all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
flagsEach bit position indicates the falling edge detection of the corresponding pin interrupt. 0 Falling edge has not been detected. = 1 Falling edge has been detected.
static void PINT_PinInterruptClrRiseFlag ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function clears the selected pin interrupt rise flag.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
None.
static uint32_t PINT_PinInterruptGetRiseFlag ( PINT_Type *  base,
pint_pin_int_t  pintr 
)
inlinestatic

This function returns the selected pin interrupt rise flag.

Parameters
baseBase address of the PINT peripheral.
pintrPin interrupt.
Return values
flag= 0 Rising edge has not been detected. = 1 Rising edge has been detected.
static void PINT_PinInterruptClrRiseFlagAll ( PINT_Type *  base)
inlinestatic

This function clears the rise flag for all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static uint32_t PINT_PinInterruptGetRiseFlagAll ( PINT_Type *  base)
inlinestatic

This function returns the rise flag of all pin interrupts.

Parameters
baseBase address of the PINT peripheral.
Return values
flagsEach bit position indicates the rising edge detection of the corresponding pin interrupt. 0 Rising edge has not been detected. = 1 Rising edge has been detected.
void PINT_PatternMatchConfig ( PINT_Type *  base,
pint_pmatch_bslice_t  bslice,
pint_pmatch_cfg_t *  cfg 
)

This function configures a given pattern match bit slice.

Parameters
baseBase address of the PINT peripheral.
bslicePattern match bit slice number.
cfgPointer to bit slice configuration.
Return values
None.
void PINT_PatternMatchGetConfig ( PINT_Type *  base,
pint_pmatch_bslice_t  bslice,
pint_pmatch_cfg_t *  cfg 
)

This function returns the configuration of a given pattern match bit slice.

Parameters
baseBase address of the PINT peripheral.
bslicePattern match bit slice number.
cfgPointer to bit slice configuration.
Return values
None.
static uint32_t PINT_PatternMatchGetStatus ( PINT_Type *  base,
pint_pmatch_bslice_t  bslice 
)
inlinestatic

This function returns the status of selected bit slice.

Parameters
baseBase address of the PINT peripheral.
bslicePattern match bit slice number.
Return values
status= 0 Match has not been detected. = 1 Match has been detected.
static uint32_t PINT_PatternMatchGetStatusAll ( PINT_Type *  base)
inlinestatic

This function returns the status of all bit slices.

Parameters
baseBase address of the PINT peripheral.
Return values
statusEach bit position indicates the match status of corresponding bit slice. = 0 Match has not been detected. = 1 Match has been detected.
uint32_t PINT_PatternMatchResetDetectLogic ( PINT_Type *  base)

This function resets the pattern match detection logic if any of the product term is matching.

Parameters
baseBase address of the PINT peripheral.
Return values
pmstatusEach bit position indicates the match status of corresponding bit slice. = 0 Match was detected. = 1 Match was not detected.
static void PINT_PatternMatchEnable ( PINT_Type *  base)
inlinestatic

This function enables the pattern match function.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static void PINT_PatternMatchDisable ( PINT_Type *  base)
inlinestatic

This function disables the pattern match function.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static void PINT_PatternMatchEnableRXEV ( PINT_Type *  base)
inlinestatic

This function enables the pattern match RXEV output.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
static void PINT_PatternMatchDisableRXEV ( PINT_Type *  base)
inlinestatic

This function disables the pattern match RXEV output.

Parameters
baseBase address of the PINT peripheral.
Return values
None.
void PINT_EnableCallback ( PINT_Type *  base)

This function enables the interrupt for the selected PINT 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 PINT peripheral.
Return values
None.
void PINT_DisableCallback ( PINT_Type *  base)

This function disables the interrupt for the selected PINT peripheral. Although the pins are still being monitored but the callback function is not called.

Parameters
baseBase address of the peripheral.
Return values
None.
void PINT_Deinit ( PINT_Type *  base)

This function disables the PINT clock.

Parameters
baseBase address of the PINT peripheral.
Return values
None.