Layered PM Infrastructure

Detailed Description

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

Function Documentation

◆ pm_block()

void pm_block ( unsigned  mode)

Block a power mode.

Parameters
[in]modepower mode to block

◆ pm_get_blocker()

pm_blocker_t pm_get_blocker ( void  )

Get currently blocked PM modes.

Returns
The current blocker state

This function atomically retrieves the currently blocked PM modes.

◆ pm_set()

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.

Parameters
[in]modeTarget power mode

◆ pm_unblock()

void pm_unblock ( unsigned  mode)

Unblock a power mode.

Parameters
[in]modepower mode to unblock