MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
WUU: Wakeup Unit driver

Overview

The MCUXpresso SDK provides a peripheral driver for the Wakeup Unit (WUU) module of MCUXpresso SDK devices. The WUU module allows the user to select external pin sources or internal modules as a wake-up source from low power modes.

External wakeup pins configuration

Configures the external wakeup pins' edge detection, wake up event and operate mode. Gets, clears, and checks the wakeup pins' flags. External wakeup pins are accessed by the 'pinIndex', which is started from 0. Please read the Reference Manual for the details.

Internal wakeup modules configuration

Enables the internal wakeup modules, configures the wake up event. Internal wakeup modules are accessed by the 'moduleIndex', which is started from 0. Please read the Reference Manual for the details.

Digital pin filter for external wakeup pin configuration.

Configures the digital pin filters' edge detection, wakeup event wakeup pin and operate mode. Gets, clears, and checks the Pin filter flags. The pin digital filters are accessed by the 'filterIndex', which is started from 1. Please read the Reference Manual for the details.

Data Structures

struct  wuu_external_wakeup_pin_config_t
 External WakeUp pin configuration. More...
 
struct  wuu_pin_filter_config_t
 Pin Filter configuration. More...
 

Enumerations

enum  wuu_external_pin_edge_detection_t {
  kWUU_ExternalPinDisable = 0x0U,
  kWUU_ExternalPinRisingEdge = 0x1U,
  kWUU_ExternalPinFallingEdge = 0x2U,
  kWUU_ExternalPinAnyEdge = 0x3U
}
 External WakeUp pin edge detection enumeration. More...
 
enum  wuu_external_wakeup_pin_event_t {
  kWUU_ExternalPinInterrupt = 0x0U,
  kWUU_ExternalPinDMARequest = 0x1U,
  kWUU_ExternalPinTriggerEvent = 0x2U
}
 External input wake up pin event enumeration. More...
 
enum  wuu_external_wakeup_pin_mode_t {
  kWUU_ExternalPinActiveDSPD = 0x0U,
  kWUU_ExternalPinActiveAlways = 0x1U
}
 External input wake up pin mode enumeration. More...
 
enum  wuu_internal_wakeup_module_event_t {
  kWUU_InternalModuleInterrupt = 0x0U,
  kWUU_InternalModuleDMATrigger = 0x1U
}
 Internal module wake up event enumeration. More...
 
enum  wuu_filter_edge_t {
  kWUU_FilterDisabled = 0x0U,
  kWUU_FilterPosedgeEnable = 0x1U,
  kWUU_FilterNegedgeEnable = 0x2U,
  kWUU_FilterAnyEdge = 0x3U
}
 Pin filter edge enumeration. More...
 
enum  wuu_filter_event_t {
  kWUU_FilterInterrupt = 0x0U,
  kWUU_FilterDMARequest = 0x1U,
  kWUU_FilterTriggerEvent = 0x2U
}
 Pin Filter event enumeration. More...
 
enum  wuu_filter_mode_t {
  kWUU_FilterActiveDSPD = 0x0U,
  kWUU_FilterActiveAlways = 0x1U
}
 Pin filter mode enumeration. More...
 

Driver version

#define FSL_WUU_DRIVER_VERSION   (MAKE_VERSION(2, 2, 0))
 Defines WUU driver version 2.2.0. More...
 

External Wake up Pins Control APIs.

void WUU_SetExternalWakeUpPinsConfig (WUU_Type *base, uint8_t pinIndex, const wuu_external_wakeup_pin_config_t *config)
 Enables and Configs External WakeUp Pins. More...
 
static uint32_t WUU_GetExternalWakeUpPinsFlag (WUU_Type *base)
 Gets External Wakeup pin flags. More...
 
static void WUU_ClearExternalWakeUpPinsFlag (WUU_Type *base, uint32_t mask)
 Clears External WakeUp Pin flags. More...
 

Internal Wakeup Module control APIs.

void WUU_SetInternalWakeUpModulesConfig (WUU_Type *base, uint8_t moduleIndex, wuu_internal_wakeup_module_event_t event)
 Config Internal modules' event as the wake up soures. More...
 

Pin Filter Control APIs

void WUU_SetPinFilterConfig (WUU_Type *base, uint8_t filterIndex, const wuu_pin_filter_config_t *config)
 Configs and Enables Pin filters. More...
 
bool WUU_GetPinFilterFlag (WUU_Type *base, uint8_t filterIndex)
 Gets the pin filter configuration. More...
 
void WUU_ClearPinFilterFlag (WUU_Type *base, uint8_t filterIndex)
 Clears the pin filter configuration. More...
 
bool WUU_GetExternalWakeupPinFlag (WUU_Type *base, uint32_t pinIndex)
 brief Gets the external wakeup source flag. More...
 
void WUU_ClearExternalWakeupPinFlag (WUU_Type *base, uint32_t pinIndex)
 brief Clears the external wakeup source flag. More...
 

Data Structure Documentation

struct wuu_external_wakeup_pin_config_t

Data Fields

wuu_external_pin_edge_detection_t edge
 External Input pin edge detection. More...
 
wuu_external_wakeup_pin_event_t event
 External Input wakeup Pin event.
 
wuu_external_wakeup_pin_mode_t mode
 External Input wakeup Pin operate mode. More...
 

Field Documentation

wuu_external_pin_edge_detection_t wuu_external_wakeup_pin_config_t::edge
wuu_external_wakeup_pin_mode_t wuu_external_wakeup_pin_config_t::mode
struct wuu_pin_filter_config_t

Data Fields

uint32_t pinIndex
 The index of wakeup pin to be muxxed into filter. More...
 
wuu_filter_edge_t edge
 The edge of the pin digital filter. More...
 
wuu_filter_event_t event
 The event of the filter output. More...
 
wuu_filter_mode_t mode
 The mode of the filter operate. More...
 

Field Documentation

uint32_t wuu_pin_filter_config_t::pinIndex
wuu_filter_edge_t wuu_pin_filter_config_t::edge
wuu_filter_event_t wuu_pin_filter_config_t::event
wuu_filter_mode_t wuu_pin_filter_config_t::mode

Macro Definition Documentation

#define FSL_WUU_DRIVER_VERSION   (MAKE_VERSION(2, 2, 0))

Enumeration Type Documentation

Enumerator
kWUU_ExternalPinDisable 

External input Pin disabled as wake up input.

kWUU_ExternalPinRisingEdge 

External input Pin enabled with the rising edge detection.

kWUU_ExternalPinFallingEdge 

External input Pin enabled with the falling edge detection.

kWUU_ExternalPinAnyEdge 

External input Pin enabled with any change detection.

Enumerator
kWUU_ExternalPinInterrupt 

External input Pin configured as interrupt.

kWUU_ExternalPinDMARequest 

External input Pin configured as DMA request.

kWUU_ExternalPinTriggerEvent 

External input Pin configured as Trigger event.

Enumerator
kWUU_ExternalPinActiveDSPD 

External input Pin is active only during Deep Sleep/Power Down Mode.

kWUU_ExternalPinActiveAlways 

External input Pin is active during all power modes.

Enumerator
kWUU_InternalModuleInterrupt 

Internal modules' interrupt as a wakeup source.

kWUU_InternalModuleDMATrigger 

Internal modules' DMA/Trigger as a wakeup source.

Enumerator
kWUU_FilterDisabled 

Filter disabled.

kWUU_FilterPosedgeEnable 

Filter posedge detect enabled.

kWUU_FilterNegedgeEnable 

Filter negedge detect enabled.

kWUU_FilterAnyEdge 

Filter any edge detect enabled.

Enumerator
kWUU_FilterInterrupt 

Filter output configured as interrupt.

kWUU_FilterDMARequest 

Filter output configured as DMA request.

kWUU_FilterTriggerEvent 

Filter output configured as Trigger event.

Enumerator
kWUU_FilterActiveDSPD 

External input pin filter is active only during Deep Sleep/Power Down Mode.

kWUU_FilterActiveAlways 

External input Pin filter is active during all power modes.

Function Documentation

void WUU_SetExternalWakeUpPinsConfig ( WUU_Type *  base,
uint8_t  pinIndex,
const wuu_external_wakeup_pin_config_t config 
)

This function enables/disables the external pin as wakeup input. What's more this function configs pins options, including edge detection wakeup event and operate mode.

Parameters
baseMUU peripheral base address.
pinIndexThe index of the external input pin. See Reference Manual for the details.
configPointer to wuu_external_wakeup_pin_config_t structure.
static uint32_t WUU_GetExternalWakeUpPinsFlag ( WUU_Type *  base)
inlinestatic

This function return the external wakeup pin flags.

Parameters
baseWUU peripheral base address.
Returns
Wakeup flags for all external wakeup pins.
static void WUU_ClearExternalWakeUpPinsFlag ( WUU_Type *  base,
uint32_t  mask 
)
inlinestatic

This function clears external wakeup pins flags based on the mask.

Parameters
baseWUU peripheral base address.
maskThe mask of Wakeup pin index to be cleared.
void WUU_SetInternalWakeUpModulesConfig ( WUU_Type *  base,
uint8_t  moduleIndex,
wuu_internal_wakeup_module_event_t  event 
)

This function configs the internal modules event as the wake up sources.

Parameters
baseWUU peripheral base address.
moduleIndexThe selected internal module. See the Reference Manual for the details.
eventSelect interrupt or DMA/Trigger of the internal module as the wake up source.
void WUU_SetPinFilterConfig ( WUU_Type *  base,
uint8_t  filterIndex,
const wuu_pin_filter_config_t config 
)

This function configs Pin filter, including pin select, filer operate mode filer wakeup event and filter edge detection.

Parameters
baseWUU peripheral base address.
filterIndexThe index of the pin filer.
configPointer to wuu_pin_filter_config_t structure.
bool WUU_GetPinFilterFlag ( WUU_Type *  base,
uint8_t  filterIndex 
)

This function gets the pin filter flag.

Parameters
baseWUU peripheral base address.
filterIndexA pin filter index, which starts from 1.
Returns
True if the flag is a source of the existing low-leakage power mode.
void WUU_ClearPinFilterFlag ( WUU_Type *  base,
uint8_t  filterIndex 
)

This function clears the pin filter flag.

Parameters
baseWUU peripheral base address.
filterIndexA pin filter index to clear the flag, starting from 1.
bool WUU_GetExternalWakeupPinFlag ( WUU_Type *  base,
uint32_t  pinIndex 
)

This function checks the external pin flag to detect whether the MCU is woken up by the specific pin.

param base WUU peripheral base address. param pinIndex A pin index, which starts from 0. return True if the specific pin is a wakeup source.

void WUU_ClearExternalWakeupPinFlag ( WUU_Type *  base,
uint32_t  pinIndex 
)

This function clears the external wakeup source flag for a specific pin.

param base WUU peripheral base address. param pinIndex A pin index, which starts from 0.