MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The MCUXpresso SDK provides a power driver for the MCUXpresso SDK devices.

Function description

Power driver and library provides these functions:

Power enable and disable

Power driver provides two API's POWER_EnablePD() and POWER_DisablePD() to enable or disable the PDRUNCFG bits in SYSCON The PDRUNCFG has an inverted logic i.e. the peripheral is powered on when the bit is cleared and powered off when bit is set. So the API POWER_DisablePD() is used to power on a peripheral and POWER_EnablePD() is used to power off a peripheral. The API's take a parameter of type pd_bit_t which organizes the PDRUNCFG bits. The driver also provides two separate API's to power down and power up Flash, POWER_PowerDownFlash() and POWER_PowerUpFlash()

Enable and Disable Deep Sleep in Core

The power driver provides two API's POWER_EnableDeepSleep() and POWER_DisableDeepSleep() to enable or disable the deep sleep bit in the ARM Core. POWER_EnableDeepSleep() is used to enable deep sleep and POWER_DisableDeepSleep() is used to disable deep sleep.

Entering Power Modes

The Power library provides two API's to enter low power modes i.e. Deep Sleep and Deep Power Down. Deep Sleep is a sleep mode in which the ARM Core, Flash and many other peripheral are turned off to save power. The processor can be woken by an IO activity and will resume executing from next instruction after sleep. If a peripheral or RAM needs to On for wakeup or to retain memory then those peripheral need to be kept on during deep sleep. Deep power down is a power down mode where the processor resets upon wake up and during power down the entire part is powered down except for the RTC. For Deep Power Down only the Reset and RTC Alarm or WakeUp can be wakeup sources. The power library provides an API POWER_EnterDeepSleep() to enter deep sleep mode. This function takes a parameter which is a bit mask of the PDRUNCFG register. Any bit that is set will be powered on during deep sleep. So this mask would usually has the RAM memory that needs to retain power and also any wakeup source. The API POWER_EnterDeepPowerDown() is used to enter deep power down mode. This API also has a parameter but since the volatge is cut off for the peripheral this parameter has no effect

Set Voltages for Frequency

The power library provides API's to set the voltage for the desired operating frequency of the processor. The voltage regulation system can be in normal regulation mode or in low power regulation mode. The API POWER_SetVoltageForFreq() is used to set the voltage for normal regulation mode. Based on the frequency parameter the optimum voltage level is set. The API POWER_SetLowPowerVoltageForFreq() is used to set the low power voltage regulation mode and set the voltages for the desired frequency. For POWER_SetLowPowerVoltageForFreq() only two FRO frequencies are supported, 12MHz and 48MHz.

Typical use case

Power Enable and Set Voltage example

POWER_DisablePD(kPDRUNCFG_PD_FRO_EN); /*!< Ensure FRO is on so that we can switch to its 12MHz mode temporarily 

Files

file  fsl_power.h
 

Power Configuration

static void POWER_EnablePD (pd_bit_t en)
 API to enable PDRUNCFG bit in the Syscon. More...
 
static void POWER_DisablePD (pd_bit_t en)
 API to disable PDRUNCFG bit in the Syscon. More...
 
static void POWER_EnableDeepSleep (void)
 API to enable deep sleep bit in the ARM Core. More...
 
static void POWER_DisableDeepSleep (void)
 API to disable deep sleep bit in the ARM Core. More...
 
static void POWER_PowerDownFlash (void)
 API to power down flash controller. More...
 
static void POWER_PowerUpFlash (void)
 API to power up flash controller. More...
 
void POWER_EnterPowerMode (power_mode_cfg_t mode, uint64_t exclude_from_pd)
 Power Library API to enter different power mode. More...
 
void POWER_EnterSleep (void)
 Power Library API to enter sleep mode. More...
 
void POWER_EnterDeepSleep (uint32_t exclude_from_pd)
 Power Library API to enter deep sleep mode. More...
 
void POWER_EnterDeepPowerDown (uint32_t exclude_from_pd)
 Power Library API to enter deep power down mode. More...
 
void POWER_SetVoltageForFreq (uint32_t freq)
 Power Library API to choose normal regulation and set the voltage for the desired operating frequency. More...
 
void POWER_SetLowPowerVoltageForFreq (uint32_t freq)
 Power Library API to choose low power regulation and set the voltage for the desired operating frequency. More...
 
uint32_t POWER_GetLibVersion (void)
 Power Library API to return the library version. More...
 

Function Documentation

static void POWER_EnablePD ( pd_bit_t  en)
inlinestatic

Note that enabling the bit powers down the peripheral

Parameters
enperipheral for which to enable the PDRUNCFG bit
Returns
none
static void POWER_DisablePD ( pd_bit_t  en)
inlinestatic

Note that disabling the bit powers up the peripheral

Parameters
enperipheral for which to disable the PDRUNCFG bit
Returns
none
static void POWER_EnableDeepSleep ( void  )
inlinestatic
Returns
none
static void POWER_DisableDeepSleep ( void  )
inlinestatic
Returns
none
static void POWER_PowerDownFlash ( void  )
inlinestatic
Returns
none
static void POWER_PowerUpFlash ( void  )
inlinestatic
Returns
none
void POWER_EnterPowerMode ( power_mode_cfg_t  mode,
uint64_t  exclude_from_pd 
)
Parameters
exclude_from_pdBit mask of the PDRUNCFG bits that needs to be powered on during deep sleep
Returns
none
void POWER_EnterSleep ( void  )
Returns
none
void POWER_EnterDeepSleep ( uint32_t  exclude_from_pd)
Parameters
exclude_from_pdBit mask of the PDRUNCFG bits that needs to be powered on during deep sleep
Returns
none
void POWER_EnterDeepPowerDown ( uint32_t  exclude_from_pd)
Parameters
exclude_from_pdBit mask of the PDRUNCFG bits that needs to be powered on during deep power down mode, but this is has no effect as the voltages are cut off.
Returns
none
void POWER_SetVoltageForFreq ( uint32_t  freq)
Parameters
freq- The desired frequency at which the part would like to operate, note that the voltage and flash wait states should be set before changing frequency
Returns
none
void POWER_SetLowPowerVoltageForFreq ( uint32_t  freq)
Parameters
freq- The desired frequency at which the part would like to operate, note only 12MHz and 48Mhz are supported
Returns
none
uint32_t POWER_GetLibVersion ( void  )
Returns
version number of the power library