This module provides a base infrastructure that MCU's may use to implement periph/pm.
This simple power management interface is based on the following assumptions:
In order to use this module, you'll need to implement pm_set().
Files | |
file | pm_layered.h |
Layered low power mode infrastructure. | |
Data Structures | |
union | pm_blocker_t |
Power Management mode blocker typedef. More... | |
Functions | |
void | pm_block (unsigned mode) |
Block a power mode. More... | |
void | pm_unblock (unsigned mode) |
Unblock a power mode. More... | |
void | pm_set (unsigned mode) |
Switches the MCU to a new power mode. More... | |
pm_blocker_t | pm_get_blocker (void) |
Get currently blocked PM modes. More... | |
void pm_block | ( | unsigned | mode | ) |
Block a power mode.
[in] | mode | power mode to block |
pm_blocker_t pm_get_blocker | ( | void | ) |
Get currently blocked PM modes.
This function atomically retrieves the currently blocked PM modes.
void pm_set | ( | unsigned | mode | ) |
Switches the MCU to a new power mode.
This function will be called by pm_set_lowest() after determining the lowest non-blocked mode.
It needs to be implemented for each MCU using this module.
[in] | mode | Target power mode |
void pm_unblock | ( | unsigned | mode | ) |
Unblock a power mode.
[in] | mode | power mode to unblock |