Energy Management Unit (EMU) Peripheral API. More...
![]() |
Data Structures | |
struct | EMU_EM4Init_TypeDef |
struct | EMU_BUPDInit_TypeDef |
Defines | |
#define | EMU_EM4INIT_DEFAULT |
#define | EMU_BUPDINIT_DEFAULT |
Enumerations | |
enum | EMU_EM4Osc_TypeDef { emuEM4Osc_ULFRCO = EMU_EM4CONF_OSC_ULFRCO, emuEM4Osc_LFXO = EMU_EM4CONF_OSC_LFXO, emuEM4Osc_LFRCO = EMU_EM4CONF_OSC_LFRCO } |
enum | EMU_Probe_TypeDef { emuProbe_Disable = EMU_BUCTRL_PROBE_DISABLE, emuProbe_VDDDReg = EMU_BUCTRL_PROBE_VDDDREG, emuProbe_BUIN = EMU_BUCTRL_PROBE_BUIN, emuProbe_BUOUT = EMU_BUCTRL_PROBE_BUOUT } |
enum | EMU_Resistor_TypeDef { emuRes_Res0 = EMU_PWRCONF_PWRRES_RES0, emuRes_Res1 = EMU_PWRCONF_PWRRES_RES1, emuRes_Res2 = EMU_PWRCONF_PWRRES_RES2, emuRes_Res3 = EMU_PWRCONF_PWRRES_RES3 } |
enum | EMU_Power_TypeDef { emuPower_None = EMU_BUINACT_PWRCON_NONE, emuPower_BUMain = EMU_BUINACT_PWRCON_BUMAIN, emuPower_MainBU = EMU_BUINACT_PWRCON_MAINBU, emuPower_NoDiode = EMU_BUINACT_PWRCON_NODIODE } |
enum | EMU_BODMode_TypeDef { emuBODMode_Active, emuBODMode_Inactive } |
Functions | |
__STATIC_INLINE void | EMU_EnterEM1 (void) |
Enter energy mode 1 (EM1). | |
void | EMU_EnterEM2 (bool restore) |
Enter energy mode 2 (EM2). | |
void | EMU_EnterEM3 (bool restore) |
Enter energy mode 3 (EM3). | |
void | EMU_EnterEM4 (void) |
Enter energy mode 4 (EM4). | |
void | EMU_MemPwrDown (uint32_t blocks) |
Power down memory block. | |
void | EMU_UpdateOscConfig (void) |
Update EMU module with CMU oscillator selection/enable status. | |
void | EMU_EM4Init (EMU_EM4Init_TypeDef *em4init) |
Update EMU module with Energy Mode 4 configuration. | |
void | EMU_BUPDInit (EMU_BUPDInit_TypeDef *bupdInit) |
Configure Backup Power Domain settings. | |
void | EMU_BUThresholdSet (EMU_BODMode_TypeDef mode, uint32_t value) |
Configure Backup Power Domain BOD Threshold value. | |
void | EMU_BUThresRangeSet (EMU_BODMode_TypeDef mode, uint32_t value) |
Configure Backup Power Domain BOD Threshold Range. | |
__STATIC_INLINE void | EMU_EM4Lock (bool enable) |
Enable or disable EM4 lock configuration. | |
__STATIC_INLINE void | EMU_BUReady (void) |
Halts until backup power functionality is ready. | |
__STATIC_INLINE void | EMU_BUPinEnable (bool enable) |
Disable BU_VIN support. | |
__STATIC_INLINE void | EMU_Lock (void) |
Lock the EMU in order to protect all its registers against unintended modification. | |
__STATIC_INLINE void | EMU_Unlock (void) |
Unlock the EMU so that writing to locked registers again is possible. | |
__STATIC_INLINE void | EMU_EM2Block (void) |
Block entering EM2 or higher number energy modes. | |
__STATIC_INLINE void | EMU_EM2UnBlock (void) |
Unblock entering EM2 or higher number energy modes. |
Energy Management Unit (EMU) Peripheral API.
#define EMU_BUPDINIT_DEFAULT |
{ emuProbe_Disable, /* Do not enable voltage probe */ \ false, /* Disable BOD calibration mode */ \ false, /* Disable BU_STAT pin for backup mode indication */ \ \ emuRes_Res0, /* RES0 series resistance between main and backup power */ \ false, /* Don't enable strong switch */ \ false, /* Don't enable medium switch */ \ false, /* Don't enable weak switch */ \ \ emuPower_None, /* No connection between main and backup power (inactive mode) */ \ emuPower_None, /* No connection between main and backup power (active mode) */ \ true /* Enable BUPD enter on BOD, enable BU_VIN pin, release BU reset */ \ }
Default
#define EMU_EM4INIT_DEFAULT |
{ false, /* Dont't lock configuration after it's been set */ \ emuEM4Osc_ULFRCO, /* Use default ULFRCO oscillator */ \ true, /* Wake up on EM4 BURTC interrupt */ \ true, /* Enable VREG */ \ }
Default initialization of EM4 configuration
enum EMU_BODMode_TypeDef |
enum EMU_EM4Osc_TypeDef |
enum EMU_Power_TypeDef |
Backup Power Domain power connection
enum EMU_Probe_TypeDef |
enum EMU_Resistor_TypeDef |
Backup Power Domain resistor selection
void EMU_BUPDInit | ( | EMU_BUPDInit_TypeDef * | bupdInit | ) |
Configure Backup Power Domain settings.
[in] | bupdInit | Backup power domain initialization structure |
Definition at line 548 of file em_emu.c.
References EMU_BUPDInit_TypeDef::activePower, BITBAND_Peripheral(), EMU_BUPDInit_TypeDef::bodCal, EMU_BUPinEnable(), EMU_BUPDInit_TypeDef::enable, EMU_BUPDInit_TypeDef::inactivePower, EMU_BUPDInit_TypeDef::probe, EMU_BUPDInit_TypeDef::resistor, EMU_BUPDInit_TypeDef::statusPinEnable, EMU_BUPDInit_TypeDef::voutMed, EMU_BUPDInit_TypeDef::voutStrong, and EMU_BUPDInit_TypeDef::voutWeak.
__STATIC_INLINE void EMU_BUPinEnable | ( | bool | enable | ) |
Disable BU_VIN support.
[in] | enable | If true, enables BU_VIN input pin support, if false disables it |
Definition at line 247 of file em_emu.h.
References BITBAND_Peripheral().
Referenced by EMU_BUPDInit().
__STATIC_INLINE void EMU_BUReady | ( | void | ) |
void EMU_BUThresholdSet | ( | EMU_BODMode_TypeDef | mode, | |
uint32_t | value | |||
) |
Configure Backup Power Domain BOD Threshold value.
[in] | mode | Active or Inactive mode |
[in] | value |
Definition at line 609 of file em_emu.c.
References emuBODMode_Active, and emuBODMode_Inactive.
void EMU_BUThresRangeSet | ( | EMU_BODMode_TypeDef | mode, | |
uint32_t | value | |||
) |
Configure Backup Power Domain BOD Threshold Range.
[in] | mode | Active or Inactive mode |
[in] | value |
Definition at line 633 of file em_emu.c.
References emuBODMode_Active, and emuBODMode_Inactive.
__STATIC_INLINE void EMU_EM2Block | ( | void | ) |
Block entering EM2 or higher number energy modes.
Definition at line 283 of file em_emu.h.
References BITBAND_Peripheral().
__STATIC_INLINE void EMU_EM2UnBlock | ( | void | ) |
Unblock entering EM2 or higher number energy modes.
Definition at line 292 of file em_emu.h.
References BITBAND_Peripheral().
void EMU_EM4Init | ( | EMU_EM4Init_TypeDef * | em4init | ) |
Update EMU module with Energy Mode 4 configuration.
[in] | em4init | Energy Mode 4 configuration structure |
Definition at line 518 of file em_emu.c.
References EMU_EM4Init_TypeDef::buRtcWakeup, EMU_EM4Init_TypeDef::lockConfig, EMU_EM4Init_TypeDef::osc, and EMU_EM4Init_TypeDef::vreg.
__STATIC_INLINE void EMU_EM4Lock | ( | bool | enable | ) |
Enable or disable EM4 lock configuration.
[in] | enable | If true, locks down EM4 configuration |
Definition at line 227 of file em_emu.h.
References BITBAND_Peripheral().
__STATIC_INLINE void EMU_EnterEM1 | ( | void | ) |
void EMU_EnterEM2 | ( | bool | restore | ) |
Enter energy mode 2 (EM2).
When entering EM2, the high frequency clocks are disabled, ie HFXO, HFRCO and AUXHFRCO (for AUXHFRCO, see exception note below). When re-entering EM0, HFRCO is re-enabled and the core will be clocked by the configured HFRCO band. This ensures a quick wakeup from EM2.
However, prior to entering EM2, the core may have been using another oscillator than HFRCO. The restore
parameter gives the user the option to restore all HF oscillators according to state prior to entering EM2, as well as the clock used to clock the core. This restore procedure is handled by SW. However, since handled by SW, it will not be restored before completing the interrupt function(s) waking up the core!
restore
parameter.[in] | restore |
|
restore
option should only be used if all clock control is done via the CMU API. void EMU_EnterEM3 | ( | bool | restore | ) |
Enter energy mode 3 (EM3).
When entering EM3, the high frequency clocks are disabled by HW, ie HFXO, HFRCO and AUXHFRCO (for AUXHFRCO, see exception note below). In addition, the low frequency clocks, ie LFXO and LFRCO are disabled by SW. When re-entering EM0, HFRCO is re-enabled and the core will be clocked by the configured HFRCO band. This ensures a quick wakeup from EM3.
However, prior to entering EM3, the core may have been using another oscillator than HFRCO. The restore
parameter gives the user the option to restore all HF/LF oscillators according to state prior to entering EM3, as well as the clock used to clock the core. This restore procedure is handled by SW. However, since handled by SW, it will not be restored before completing the interrupt function(s) waking up the core!
restore
parameter.[in] | restore |
|
restore
option should only be used if all clock control is done via the CMU API. Definition at line 361 of file em_emu.c.
References CMU_Lock(), and CMU_Unlock().
void EMU_EnterEM4 | ( | void | ) |
__STATIC_INLINE void EMU_Lock | ( | void | ) |
Lock the EMU in order to protect all its registers against unintended modification.
Definition at line 264 of file em_emu.h.
Referenced by RMU_ResetCauseClear().
void EMU_MemPwrDown | ( | uint32_t | blocks | ) |
Power down memory block.
[in] | blocks | Specifies a logical OR of bits indicating memory blocks to power down. Bit 0 selects block 1, bit 1 selects block 2, etc. Memory block 0 cannot be disabled. Please refer to the EFM32 reference manual for available memory blocks for a device. |
__STATIC_INLINE void EMU_Unlock | ( | void | ) |
Unlock the EMU so that writing to locked registers again is possible.
Definition at line 274 of file em_emu.h.
Referenced by RMU_ResetCauseClear().
void EMU_UpdateOscConfig | ( | void | ) |
Update EMU module with CMU oscillator selection/enable status.
When entering EM2 and EM3, the HW may change the core clock oscillator used, as well as disabling some oscillators. The user may optionally select to restore the oscillators after waking up from EM2 and EM3 through the SW API.
However, in order to support this in a safe way, the EMU module must be kept up-to-date on the actual selected configuration. The CMU module must keep the EMU module up-to-date.
This function is mainly intended for internal use by the CMU module, but if the applications changes oscillator configurations without using the CMU API, this function can be used to keep the EMU module up-to-date.
Definition at line 503 of file em_emu.c.
Referenced by CMU_ClockSelectSet(), and CMU_OscillatorEnable().