ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
isf_pm.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2013, Freescale Semiconductor, Inc.
4  *
5 */
6 
7 
8 /*!
9  * @file isf_pm.h
10  *
11  * @brief isf_pm.h describes the API definitions, types, and macros for the Intelligent Sensing
12  * Framework (ISF) Power Manager (PM).
13  *
14 */
15 
16 #ifndef ISF_PM_H_
17 #define ISF_PM_H_
18 
19 
20 
21 /*******************
22 ** Macro Definitions
23 */
24 
25 
26 
27 /**************
28 ** Enumerations
29 */
30 
31 /*!
32  * @brief ISF power management settings.
33 */
34 typedef enum
35 {
36 
37  /*! At the normal power level, the CPU and clocks are active. */
39 
40  /*! At the low power level, the CPU stops and the peripheral clocks
41  * continue to run at full speed. The system is awakened by interrupts.
42  */
44 
45  /*! At the sleep level, the CPU and most peripheral clocks are stopped.
46  * The system can be awakened by various interrupt sources such as uart port,
47  * gpio signals, and low power timer.
48  */
50 
52 
53 
54 /*********************
55 ** Struct and Typedefs
56 */
57 
58 /*! @brief Type for the power levels supported by the Power Manager. */
60 
61 
62 /*********************
63 ** Function Prototypes
64 */
65 
66 
67 
68 /*! @brief This API initializes the Power Manager.
69  *
70  * @details The Power Manager requires a one-time initialization at system
71  * startup performed by this API call. It creates and initializes
72  * internal variables, and installs an interrupt service routine for
73  * the digital frame interrupt.
74  *
75  * @return ::isf_status_t pm_init() returns a value of type
76  * ::isf_status_t indicating the status of the
77  * initialization operation.
78  *
79  * @retval ::ISF_SUCCESS The initialization completes successfully.
80  *
81  * @retval ::ISF_ERR_LIB_INIT Internal synchronization objects could
82  * not be created.
83  *
84  * @Constraints None
85  *
86  * @Reentrant No
87  *
88  * @Libs isf_core.lib
89  *
90  */
91 isf_status_t pm_init(void);
92 
93 
94 
95 /*! @brief This API sets the requested power level for power management.
96  *
97  * @details The Power Manager provides the capability to automatically
98  * control the power mode when the system is idle. Part of the power
99  * management is an idle task running at the lowest system priority.
100  * When all higher-priority tasks are blocked waiting for events, the
101  * idle task is executed. In the idle task, the system power state is
102  * set to one of the states described by the ::pm_power_level_enum values
103  * as specified as the argument to this API call.
104  *
105  * The user may retrieves the current power level setting by invoking
106  * ::isf_power_get().
107  *
108  * @param[in] aLevel Power level of type ::power_level_t to set in
109  * the Power Manager.
110  *
111  * @return isf_power_set() returns a value of type ::power_level_t
112  * indicating the aLevel power setting. If aLevel is
113  * invalid, then the current power setting is returned.
114  *
115  * @Constraints The following constraints must be observed when using
116  * this function. If these constraints are not met, this
117  * API returns an error.
118  * @li pm_init() must be invoked prior to using this function.
119  *
120  * @Reentrant Yes
121  *
122  * @Libs isf_core.lib
123  *
124  * @see isf_power_get(), power_level_t
125  *
126  *
127  */
129 
130 
131 /*! @brief This API returns the current power level for power management.
132  *
133  * @details The current power level setting of the Power Manager is returned.
134  *
135  * @return isf_power_get() returns a value of type ::power_level_t
136  * indicating the current power setting.
137  *
138  * @Constraints The following constraints must be observed when using
139  * this function. If these constraints are not met, this
140  * API returns an error.
141  * @li pm_init() must be invoked prior to using this function.
142  *
143  * @Reentrant Yes
144  *
145  * @Libs isf_core.lib
146  *
147  * @see isf_power_set(), power_level_t
148  *
149  */
151 
152 
153 
154 
155 #endif // ISF_PM_H_
156 
pm_power_level_enum
ISF power management settings.
Definition: isf_pm.h:34
power_level_t isf_power_set(power_level_t aLevel)
This API sets the requested power level for power management.
Definition: pm.c:57
int32 isf_status_t
ISF return status type.
Definition: isf.h:51
power_level_t isf_power_get(void)
This API returns the current power level for power management.
Definition: pm.c:149
isf_status_t pm_init(void)
This API initializes the Power Manager.
Definition: pm.c:44
pm_power_level_enum power_level_t
Type for the power levels supported by the Power Manager.
Definition: isf_pm.h:59