sam/sleepmgr.h
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 
37 #ifndef SAM_SLEEPMGR_INCLUDED
38 #define SAM_SLEEPMGR_INCLUDED
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #include <compiler.h>
45 #include <conf_sleepmgr.h>
46 #include <sleep.h>
47 #include <interrupt.h>
48 
71 #if (!(SAMG51 || SAMG53 || SAMG54))
74 #endif
76 };
77 
83 #if defined(CONFIG_SLEEPMGR_ENABLE) || defined(__DOXYGEN__)
84 extern uint8_t sleepmgr_locks[];
86 #endif /* CONFIG_SLEEPMGR_ENABLE */
87 
89 
90 static inline void sleepmgr_sleep(const enum sleepmgr_mode sleep_mode)
91 {
92  Assert(sleep_mode != SLEEPMGR_ACTIVE);
93 #ifdef CONFIG_SLEEPMGR_ENABLE
95 
96  // Atomically enable the global interrupts and enter the sleep mode.
97  pmc_sleep(sleep_mode);
98 #else
99  UNUSED(sleep_mode);
100  cpu_irq_enable();
101 #endif /* CONFIG_SLEEPMGR_ENABLE */
102 
103 }
104 
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* SAM_SLEEPMGR_INCLUDED */
#define cpu_irq_disable()
Disable interrupts globally.
#define UNUSED(v)
Marking v as a unused parameter or value.
Definition: compiler.h:86
Chip-specific sleep manager configuration.
static void sleepmgr_sleep(const enum sleepmgr_mode sleep_mode)
Definition: sam/sleepmgr.h:90
Commonly used includes, types and macros.
Global interrupt management for 8- and 32-bit AVR.
Active mode.
Definition: sam/sleepmgr.h:55
Backup mode. Potential Wake Up sources: WKUPs, SM, RTT, RTC.
Definition: sam/sleepmgr.h:73
sleepmgr_mode
Sleep mode locks.
Definition: sam/sleepmgr.h:53
#define Assert(expr)
This macro is used to test fatal errors.
Definition: compiler.h:196
#define cpu_irq_enable()
Enable interrupts globally.
Sleep mode access.


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58