pm_layered.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
34 #ifndef PM_LAYERED_H
35 #define PM_LAYERED_H
36 
37 #include "periph_cpu.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #ifndef PROVIDES_PM_OFF
44 #define PROVIDES_PM_OFF
45 #endif
46 
47 #ifndef PROVIDES_PM_SET_LOWEST
48 #define PROVIDES_PM_SET_LOWEST
49 #endif
50 
54 typedef union {
55  uint32_t val_u32;
56  uint8_t val_u8[PM_NUM_MODES];
57 } pm_blocker_t;
58 
64 void pm_block(unsigned mode);
65 
71 void pm_unblock(unsigned mode);
72 
83 void pm_set(unsigned mode);
84 
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* PM_LAYERED_H */
99 
pm_unblock
void pm_unblock(unsigned mode)
Unblock a power mode.
pm_blocker_t
Power Management mode blocker typedef.
Definition: pm_layered.h:54
pm_get_blocker
pm_blocker_t pm_get_blocker(void)
Get currently blocked PM modes.
pm_set
void pm_set(unsigned mode)
Switches the MCU to a new power mode.
pm_blocker_t::val_u32
uint32_t val_u32
power mode blockers u32
Definition: pm_layered.h:55
pm_block
void pm_block(unsigned mode)
Block a power mode.