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

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, for example, the peripheral is powered on when the bit is cleared and powered off when bit is set. The API POWER_DisablePD() is used to power on a peripheral and POWER_EnablePD() is used to power off a peripheral. The API takes a parameter 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, for example, 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 resumes 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 is powered on during deep sleep. 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 voltage 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 48 MHz.

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