Loading...
Searching...
No Matches
Layered PM Infrastructure

This module provides a base infrastructure that MCU's may use to implement periph/pm. More...

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

struct  WORD_ALIGNED
 Power Management mode blocker typedef. More...
 

Functions

static void pm_block (unsigned mode)
 Block a power mode.
 
static void pm_unblock (unsigned mode)
 Unblock a power mode.
 
void pm_set (unsigned mode)
 Switches the MCU to a new power mode.
 
pm_blocker_t pm_get_blocker (void)
 Get currently blocked PM modes.
 

Macro Definition Documentation

◆ PROVIDES_PM_OFF

#define PROVIDES_PM_OFF

Definition at line 47 of file pm_layered.h.

◆ PROVIDES_PM_SET_LOWEST

#define PROVIDES_PM_SET_LOWEST

Definition at line 51 of file pm_layered.h.

Function Documentation

◆ pm_block()

static void pm_block ( unsigned  mode)
inlinestatic

Block a power mode.

Parameters
[in]modepower mode to block

Definition at line 69 of file pm_layered.h.

◆ 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()

static void pm_unblock ( unsigned  mode)
inlinestatic

Unblock a power mode.

Parameters
[in]modepower mode to unblock

Definition at line 80 of file pm_layered.h.