All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Power Driver

## Overview

Power driver provides APIs to control peripherals power and control the system power mode.

## Macros

#define | PMUC_PCON_RESERVED_MASK ((0xf << 4) | (0x6 << 8) | 0xfffff000u)
| PMU PCON reserved mask, used to clear reserved field which should not write 1.

## Enumerations

enum | _power_wakeup
| Deep sleep and power down mode wake up configurations.
enum | _power_dpd_wakeup_pin
| Deep power down mode wake up pins.
enum | _power_deep_sleep_active
| Deep sleep/power down mode active part.
enum | power_gen_reg_t { kPmu_GenReg0 = 0U, kPmu_GenReg1 = 1U, kPmu_GenReg2 = 2U, kPmu_GenReg3 = 3U, kPmu_GenReg4 = 4U }
| pmu general purpose register index More...
enum | power_bod_reset_level_t { kBod_ResetLevel0 = 0U }
| BOD reset level, if VDD below reset level value, the reset will be asserted. More...
enum | power_bod_interrupt_level_t { kBod_InterruptLevelReserved = 0U, kBod_InterruptLevel1, kBod_InterruptLevel2, kBod_InterruptLevel3 }
| BOD interrupt level, if VDD below interrupt level value, the BOD interrupt will be asserted. More...

## Driver version

#define | FSL_POWER_DRIVER_VERSION (MAKE_VERSION(2, 1, 0))
| power driver version 2.1.0. More...

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

## ARM core Power Configuration

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

## PMU functionality

void | POWER_EnterSleep (void)
| API to enter sleep power mode. More...
void | POWER_EnterDeepSleep (uint32_t activePart)
| API to enter deep sleep power mode. More...
void | POWER_EnterPowerDown (uint32_t activePart)
| API to enter power down mode. More...
void | POWER_EnterDeepPowerDownMode (void)
| API to enter deep power down mode. More...
static uint32_t | POWER_GetSleepModeFlag (void)
| API to get sleep mode flag. More...
static void | POWER_ClrSleepModeFlag (void)
| API to clear sleep mode flag.
static uint32_t | POWER_GetDeepPowerDownModeFlag (void)
| API to get deep power down mode flag. More...
static void | POWER_ClrDeepPowerDownModeFlag (void)
| API to clear deep power down mode flag.
static void | POWER_ClrWakeupPinFlag (void)
| API to clear wake up pin status flag.
static void | POWER_EnableNonDpd (bool enable)
| API to enable non deep power down mode. More...
static void | POWER_EnableLPO (bool enable)
| API to enable LPO. More...
static void | POWER_WakeUpConfig (uint32_t mask, bool powerDown)
| API to config wakeup configurations for deep sleep mode and power down mode. More...
static void | POWER_DeepSleepConfig (uint32_t mask, bool powerDown)
| API to config active part for deep sleep mode and power down mode. More...

## API to enable wake up pin for deep power down mode

Parameters

  wakeup_pin | wake up pin for which to enable.reference _power_dpd_wakeup_pin.

Returns
  none

static void | POWER_DeepPowerDownWakeupSourceSelect (uint32_t wakeup_pin)
static void | POWER_SetRetainData (power_gen_reg_t index, uint32_t data)
| API to retore data to general purpose register which can be retain during deep power down mode. More...
static uint32_t | POWER_GetRetainData (power_gen_reg_t index)
| API to get data from general purpose register which retain during deep power down mode. More...
static void | POWER_SetBodLevel (power_bod_reset_level_t resetLevel, power_bod_interrupt_level_t interruptLevel, bool enable)
| Set Bod interrupt level and reset level. More...

## Macro Definition Documentation

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

## Enumeration Type Documentation

enum power_gen_reg_t

Enumerator
kPmu_GenReg0 | general purpose register0
kPmu_GenReg1 | general purpose register1
kPmu_GenReg2 | general purpose register2
kPmu_GenReg3 | general purpose register3
kPmu_GenReg4 | general purpose reguster4

enum power_bod_reset_level_t

Enumerator
kBod_ResetLevel0 | BOD Reset Level0: 1.51V.

enum power_bod_interrupt_level_t

Enumerator
kBod_InterruptLevelReserved | BOD interrupt level reserved.
kBod_InterruptLevel1 | BOD interrupt level1: 2.24V.
kBod_InterruptLevel2 | BOD interrupt level2: 2.52V.
kBod_InterruptLevel3 | BOD interrupt level3: 2.81V.

## Function Documentation

static void POWER_EnablePD | ( | pd_bit_t | en | ) |

inlinestatic

Note that enabling the bit powers down the peripheral

Parameters

  en | peripheral 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

  en | peripheral 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

void POWER_EnterSleep | ( | void |  | ) |

Returns
  none

void POWER_EnterDeepSleep | ( | uint32_t | activePart | ) |

Parameters

  activePart,: | should be a single or combine value of _power_deep_sleep_active .

Returns
  none

void POWER_EnterPowerDown | ( | uint32_t | activePart | ) |

Parameters

  activePart,: | should be a single or combine value of _power_deep_sleep_active .

Returns
  none

void POWER_EnterDeepPowerDownMode | ( | void |  | ) |

Returns
  none

static uint32_t POWER_GetSleepModeFlag | ( | void |  | ) |

inlinestatic

Returns
  sleep mode flag: 0 is active mode, 1 is sleep mode entered.

static uint32_t POWER_GetDeepPowerDownModeFlag | ( | void |  | ) |

inlinestatic

Returns
  sleep mode flag: 0 not deep power down, 1 is deep power down mode entered.

static void POWER_EnableNonDpd | ( | bool | enable | ) |

inlinestatic

Parameters

  enable,: | true is enable non deep power down, otherwise disable.

static void POWER_EnableLPO | ( | bool | enable | ) |

inlinestatic

Parameters

  enable,: | true to enable LPO, false to disable LPO.

static void POWER_WakeUpConfig | ( | uint32_t | mask,
|  | bool | powerDown
| ) |  |

inlinestatic

Parameters

  mask,: | wake up configurations for deep sleep mode and power down mode, reference _power_wakeup.
  powerDown,: | true is power down the mask part, false is powered part.

static void POWER_DeepSleepConfig | ( | uint32_t | mask,
|  | bool | powerDown
| ) |  |

inlinestatic

Parameters

  mask,: | active part configurations for deep sleep mode and power down mode, reference _power_deep_sleep_active.
  powerDown,: | true is power down the mask part, false is powered part.

static void POWER_SetRetainData | ( | power_gen_reg_t | index,
|  | uint32_t | data
| ) |  |

inlinestatic

Parameters

  index,: | general purpose data register index.
  data,: | data to restore.

static uint32_t POWER_GetRetainData | ( | power_gen_reg_t | index | ) |

inlinestatic

Parameters

  index,: | general purpose data register index.

Returns
  data stored in the general purpose register.

static void POWER_SetBodLevel | ( | power_bod_reset_level_t | resetLevel,
|  | power_bod_interrupt_level_t | interruptLevel,
|  | bool | enable
| ) |  |

inlinestatic

Parameters

  resetLevel | BOD reset threshold level, please refer to power_bod_reset_level_t.
  interruptLevel | BOD interrupt threshold level, please refer to power_bod_interrupt_level_t.
  enable | Used to enable/disable the BOD interrupt and BOD reset.