SmartSnippets DA1459x SDK
Files | Functions
Power Manager Service

Power Manager. More...

Files

file  sys_power_mgr.h
 Power Manager header file.
 

Functions

void pm_set_wakeup_mode (bool wait_for_xtalm)
 Sets the wake-up mode of the system with respect to the system clock. More...
 
bool pm_get_wakeup_mode (void)
 Returns the wake-up mode of the system (whether the OS will be resumed with RC or XTAL). More...
 
void pm_set_sys_wakeup_mode (sys_wakeup_mode_t mode)
 Sets the wake-up mode of the system. More...
 
sys_wakeup_mode_t pm_get_sys_wakeup_mode (void)
 Returns the wake-up mode of the system. More...
 
uint8_t pm_get_sys_wakeup_cycles (void)
 Returns the number of LP clock cycles needed for wake-up. More...
 
__RETAINED_CODE void pm_prepare_sleep (sleep_mode_t sleep_mode)
 Prepare system for sleep. More...
 
__RETAINED_CODE void pm_resume_from_sleep (void)
 Perform initialization after wake-up. More...
 

Detailed Description

Power Manager.

Function Documentation

◆ pm_get_sys_wakeup_cycles()

uint8_t pm_get_sys_wakeup_cycles ( void  )

Returns the number of LP clock cycles needed for wake-up.

The number of cycles depend on the wake-up mode set by pm_set_sys_wakeup_mode().

Returns
The number of LP clock cycles needed for wake-up.

◆ pm_get_sys_wakeup_mode()

sys_wakeup_mode_t pm_get_sys_wakeup_mode ( void  )

Returns the wake-up mode of the system.

Returns
The wake-up mode used.

◆ pm_get_wakeup_mode()

bool pm_get_wakeup_mode ( void  )

Returns the wake-up mode of the system (whether the OS will be resumed with RC or XTAL).

Returns
The wake-up mode.
Warning
The function will block if another task is accessing the Power Manager.

◆ pm_prepare_sleep()

__RETAINED_CODE void pm_prepare_sleep ( sleep_mode_t  sleep_mode)

Prepare system for sleep.

Parameters
[in]sleep_modeThe sleep mode.

◆ pm_resume_from_sleep()

__RETAINED_CODE void pm_resume_from_sleep ( void  )

Perform initialization after wake-up.

Note
This function is called before interrupts are enabled.

◆ pm_set_sys_wakeup_mode()

void pm_set_sys_wakeup_mode ( sys_wakeup_mode_t  mode)

Sets the wake-up mode of the system.

Parameters
[in]modeThis is the new wake-up mode.

◆ pm_set_wakeup_mode()

void pm_set_wakeup_mode ( bool  wait_for_xtalm)

Sets the wake-up mode of the system with respect to the system clock.

The wake-up mode specifies if the system will wait upon wake-up for the system clock to be switched to the appropriate clock source before continuing with code execution. If system clock is RC32M then the wake-up mode has no effect since the system always wakes up using RC32M as system clock.

Parameters
[in]wait_for_xtalmWhen false, the system will start executing code immediately after wake-up. When true, upon wake-up the system will wait for the system clock to be switched to the appropriate clock source before continuing with code execution.
Warning
The function will block if another task is accessing the Power Manager.