STM32 Sequencer v1.6.0

stm32_seq.h
Go to the documentation of this file.
1
21 /* Define to prevent recursive inclusion -------------------------------------*/
22 #ifndef STM32_SEQ_H
23 #define STM32_SEQ_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /* Includes ------------------------------------------------------------------*/
30 #include "stdint.h"
31
36 /* Exported types ------------------------------------------------------------*/
45 typedef uint32_t UTIL_SEQ_bm_t;
46
51 /* Exported constants --------------------------------------------------------*/
52
61 #define UTIL_SEQ_RFU 0
62
76 #define UTIL_SEQ_DEFAULT (~0U)
77
82 /* External variables --------------------------------------------------------*/
83 /* Exported macros -----------------------------------------------------------*/
84
113 #define UTIL_SEQ_TaskParamDef(_FUNC_,_PARAM_VAL_) \
114 static void SEQ_FUNC_##_FUNC_##_PARAM_VAL_(void); \
115 static void SEQ_FUNC_##_FUNC_##_PARAM_VAL_(void) \
116 { \
117 static void *SEQ_PARAM_##_FUNC_ = (void*)&_PARAM_VAL_;\
118 _FUNC_(SEQ_PARAM_##_FUNC_); \
119 }
120
124 #define UTIL_SEQ_TaskFunction(_FUNC_,_PARAM_VAL_) SEQ_FUNC_##_FUNC_##_PARAM_VAL_
125
130 /* Exported functions ------------------------------------------------------- */
131
142 void UTIL_SEQ_Init( void );
143
150 void UTIL_SEQ_DeInit( void );
151
162 void UTIL_SEQ_Idle( void );
163
173 void UTIL_SEQ_PreIdle( void );
174
186 void UTIL_SEQ_PostIdle( void );
187
201 void UTIL_SEQ_Run( UTIL_SEQ_bm_t Mask_bm );
202
213 void UTIL_SEQ_RegTask( UTIL_SEQ_bm_t TaskId_bm, uint32_t Flags, void (*Task)( void ) );
214
228 void UTIL_SEQ_SetTask( UTIL_SEQ_bm_t TaskId_bm , uint32_t Task_Prio );
229
240 uint32_t UTIL_SEQ_IsSchedulableTask( UTIL_SEQ_bm_t TaskId_bm);
241
253 void UTIL_SEQ_PauseTask( UTIL_SEQ_bm_t TaskId_bm );
254
266 uint32_t UTIL_SEQ_IsPauseTask( UTIL_SEQ_bm_t TaskId_bm );
267
278 void UTIL_SEQ_ResumeTask( UTIL_SEQ_bm_t TaskId_bm );
279
289 void UTIL_SEQ_SetEvt( UTIL_SEQ_bm_t EvtId_bm );
290
302 void UTIL_SEQ_ClrEvt( UTIL_SEQ_bm_t EvtId_bm );
303
317 void UTIL_SEQ_WaitEvt( UTIL_SEQ_bm_t EvtId_bm );
318
330 UTIL_SEQ_bm_t UTIL_SEQ_IsEvtPend( void );
331
346 void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t TaskId_bm, UTIL_SEQ_bm_t EvtWaited_bm );
347
356 #ifdef __cplusplus
357 }
358 #endif
359
360 #endif /*__STM32_SEQ_H */
361
362 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
UTIL_SEQ_SetEvt
void UTIL_SEQ_SetEvt(UTIL_SEQ_bm_t EvtId_bm)
This function sets an event that is waited with UTIL_SEQ_WaitEvt()
Definition: stm32_seq.c:396
UTIL_SEQ_ClrEvt
void UTIL_SEQ_ClrEvt(UTIL_SEQ_bm_t EvtId_bm)
This function may be used to clear the event before calling UTIL_SEQ_WaitEvt() This API may be useful...
Definition: stm32_seq.c:407
UTIL_SEQ_WaitEvt
void UTIL_SEQ_WaitEvt(UTIL_SEQ_bm_t EvtId_bm)
This function waits for a specific event to be set. The sequencer loops UTIL_SEQ_EvtIdle() until the ...
Definition: stm32_seq.c:418
UTIL_SEQ_PreIdle
__WEAK void UTIL_SEQ_PreIdle(void)
This function is called by the sequencer outside critical section just before calling UTIL_SEQ_Idle( ...
Definition: stm32_seq.c:489
UTIL_SEQ_PostIdle
__WEAK void UTIL_SEQ_PostIdle(void)
This function is called by the sequencer outside critical section either.
Definition: stm32_seq.c:497
UTIL_SEQ_IsSchedulableTask
uint32_t UTIL_SEQ_IsSchedulableTask(UTIL_SEQ_bm_t TaskId_bm)
This function checks if a task could be scheduled.
Definition: stm32_seq.c:349
UTIL_SEQ_Idle
__WEAK void UTIL_SEQ_Idle(void)
This function is called by the sequencer in critical section (PRIMASK bit) when.
Definition: stm32_seq.c:484
UTIL_SEQ_SetTask
void UTIL_SEQ_SetTask(UTIL_SEQ_bm_t TaskId_bm, uint32_t Task_Prio)
This function requests a task to be executed.
Definition: stm32_seq.c:337
UTIL_SEQ_ResumeTask
void UTIL_SEQ_ResumeTask(UTIL_SEQ_bm_t TaskId_bm)
This function allows again a task to be called by the sequencer if set with UTIL_SEQ_SetTask() This i...
Definition: stm32_seq.c:385
UTIL_SEQ_EvtIdle
__WEAK void UTIL_SEQ_EvtIdle(UTIL_SEQ_bm_t TaskId_bm, UTIL_SEQ_bm_t EvtWaited_bm)
This function loops until the waited event is set.
Definition: stm32_seq.c:477
UTIL_SEQ_IsEvtPend
UTIL_SEQ_bm_t UTIL_SEQ_IsEvtPend(void)
This function returns whether the waited event is pending or not It is useful only when the UTIL_SEQ_...
Definition: stm32_seq.c:471
UTIL_SEQ_DeInit
void UTIL_SEQ_DeInit(void)
This function un-initializes the sequencer resources.
Definition: stm32_seq.c:199
UTIL_SEQ_IsPauseTask
uint32_t UTIL_SEQ_IsPauseTask(UTIL_SEQ_bm_t TaskId_bm)
This function allows to know if the task has been put in pause. By default, all tasks are executed by...
Definition: stm32_seq.c:374
UTIL_SEQ_PauseTask
void UTIL_SEQ_PauseTask(UTIL_SEQ_bm_t TaskId_bm)
This function prevents a task to be called by the sequencer even when set with UTIL_SEQ_SetTask() By ...
Definition: stm32_seq.c:363
UTIL_SEQ_RegTask
void UTIL_SEQ_RegTask(UTIL_SEQ_bm_t TaskId_bm, uint32_t Flags, void(*Task)(void))
This function registers a task in the sequencer.
Definition: stm32_seq.c:325
UTIL_SEQ_Run
void UTIL_SEQ_Run(UTIL_SEQ_bm_t Mask_bm)
This function requests the sequencer to execute all pending tasks using round robin mechanism....
Definition: stm32_seq.c:209
UTIL_SEQ_Init
void UTIL_SEQ_Init(void)
This function initializes the sequencer resources.
Definition: stm32_seq.c:182
UTIL_SEQ_bm_t
uint32_t UTIL_SEQ_bm_t
bit mapping of the task. this value is used to represent a list of task (each corresponds to a task).
Definition: stm32_seq.h:45