eLooM for STM32 application  v3.3.0
A framework for multitasking low power embedded applications powerd by STM32
Loading...
Searching...
No Matches
AManagedTask.h
Go to the documentation of this file.
1
23#ifndef INCLUDE_SERVICES_AMANAGEDTASK_H_
24#define INCLUDE_SERVICES_AMANAGEDTASK_H_
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
32/* MISRA messages linked to FreeRTOS include are ignored */
33/*cstat -MISRAC2012-* */
34#include "tx_api.h"
35/*cstat -MISRAC2012-* */
36
40#define MT_MAX_ERROR_COUNT 0x3U
41
42#ifndef MT_ALLOWED_ERROR_COUNT
47#define MT_ALLOWED_ERROR_COUNT 0x2U
48#endif
49
50#define AMT_MS_TO_TICKS( xTimeInMs ) ( (uint32_t) (((uint32_t )(xTimeInMs) * (uint32_t)TX_TIMER_TICKS_PER_SECOND) / (uint32_t)1000))
51
52
57
62
67
68
69/* Public API declaration */
70/**************************/
71
82static inline sys_error_code_t AMTHardwareInit(AManagedTask *_this, void *pParams);
83
110static inline sys_error_code_t AMTOnCreateTask(AManagedTask *_this, tx_entry_function_t *pvTaskCode, CHAR **pcName,
111 VOID **pvStackStart, ULONG *pnStackSize,
112 UINT *pnPriority, UINT *pnPreemptThreshold,
113 ULONG *pnTimeSlice, ULONG *pnAutoStart,
114 ULONG *pnParams);
115
130static inline sys_error_code_t AMTDoEnterPowerMode(AManagedTask *_this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode);
131
139static inline sys_error_code_t AMTHandleError(AManagedTask *_this, SysEvent xError);
140
150
158static inline sys_error_code_t AMTInit(AManagedTask *_this);
159
165static inline EPowerMode AMTGetSystemPowerMode(void);
166
174static inline EPowerMode AMTGetTaskPowerMode(AManagedTask *_this);
175
185
204static inline void AMTReportErrOnStepExecution(AManagedTask *_this, sys_error_code_t nStepError);
205
211static inline void AMTResetAEDCounter(AManagedTask *_this);
212
219static inline boolean_t AMTIsPowerModeSwitchPending(AManagedTask *_this);
220
234static inline sys_error_code_t AMTSetPMStateRemapFunc(AManagedTask *_this, const EPowerMode *pPMState2PMStateMap);
235
241VOID AMTRun(ULONG pParams);
242
243
244#ifdef __cplusplus
245}
246#endif
247
248
249#endif /* INCLUDE_SERVICES_AMANAGEDTASK_H_ */
sys_error_code_t() ExecuteStepFunc_t(AManagedTask *_this)
Definition AManagedTask.h:61
VOID AMTRun(ULONG pParams)
static sys_error_code_t AMTSetPMStateRemapFunc(AManagedTask *_this, const EPowerMode *pPMState2PMStateMap)
Definition AManagedTask_vtbl.h:245
static EPowerMode AMTGetSystemPowerMode(void)
Definition AManagedTask_vtbl.h:194
static sys_error_code_t AMTOnEnterTaskControlLoop(AManagedTask *_this)
Definition AManagedTask_vtbl.h:173
static void AMTReportErrOnStepExecution(AManagedTask *_this, sys_error_code_t nStepError)
Definition AManagedTask_vtbl.h:236
static boolean_t AMTIsPowerModeSwitchPending(AManagedTask *_this)
Definition AManagedTask_vtbl.h:229
static sys_error_code_t AMTHandleError(AManagedTask *_this, SysEvent xError)
Definition AManagedTask_vtbl.h:168
static sys_error_code_t AMTDoEnterPowerMode(AManagedTask *_this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode)
Definition AManagedTask_vtbl.h:153
static sys_error_code_t AMTHardwareInit(AManagedTask *_this, void *pParams)
Definition AManagedTask_vtbl.h:139
static void AMTResetAEDCounter(AManagedTask *_this)
Definition AManagedTask_vtbl.h:223
static EPowerMode AMTGetTaskPowerMode(AManagedTask *_this)
Definition AManagedTask_vtbl.h:199
static sys_error_code_t AMTNotifyIsStillRunning(AManagedTask *_this, sys_error_code_t nStepError)
Definition AManagedTask_vtbl.h:210
static sys_error_code_t AMTInit(AManagedTask *_this)
Definition AManagedTask_vtbl.h:178
static sys_error_code_t AMTOnCreateTask(AManagedTask *_this, tx_entry_function_t *pvTaskCode, CHAR **pcName, VOID **pvStackStart, ULONG *pnStackSize, UINT *pnPriority, UINT *pnPreemptThreshold, ULONG *pnTimeSlice, ULONG *pnAutoStart, ULONG *pnParams)
Definition AManagedTask_vtbl.h:144
sys_error_code_t(* pExecuteStepFunc_t)(AManagedTask *_this)
Definition AManagedTask.h:66
Umbrella header for the basic system features.
Definition AManagedTask_vtbl.h:94
uint16_t sys_error_code_t
Definition syserror.h:41
This file declares the public API related to the power management.
Definition sysevent.h:41