stm32_seq.h
Go to the documentation of this file.
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32_SEQ_H
#define STM32_SEQ_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stdint.h"
/* Exported types ------------------------------------------------------------*/
typedef uint32_t UTIL_SEQ_bm_t;
/* Exported constants --------------------------------------------------------*/
#define UTIL_SEQ_RFU 0
#define UTIL_SEQ_DEFAULT (~0U)
/* External variables --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
#define UTIL_SEQ_TaskParamDef(_FUNC_,_PARAM_VAL_) \
static void SEQ_FUNC_##_FUNC_##_PARAM_VAL_(void); \
static void SEQ_FUNC_##_FUNC_##_PARAM_VAL_(void) \
{ \
static void *SEQ_PARAM_##_FUNC_ = (void*)&_PARAM_VAL_;\
_FUNC_(SEQ_PARAM_##_FUNC_); \
}
#define UTIL_SEQ_TaskFunction(_FUNC_,_PARAM_VAL_) SEQ_FUNC_##_FUNC_##_PARAM_VAL_
/* Exported functions ------------------------------------------------------- */
void UTIL_SEQ_Init( void );
void UTIL_SEQ_DeInit( void );
void UTIL_SEQ_Idle( void );
void UTIL_SEQ_PreIdle( void );
void UTIL_SEQ_PostIdle( void );
void UTIL_SEQ_Run( UTIL_SEQ_bm_t Mask_bm );
void UTIL_SEQ_RegTask( UTIL_SEQ_bm_t TaskId_bm, uint32_t Flags, void (*Task)( void ) );
void UTIL_SEQ_SetTask( UTIL_SEQ_bm_t TaskId_bm , uint32_t Task_Prio );
uint32_t UTIL_SEQ_IsSchedulableTask( UTIL_SEQ_bm_t TaskId_bm);
void UTIL_SEQ_PauseTask( UTIL_SEQ_bm_t TaskId_bm );
uint32_t UTIL_SEQ_IsPauseTask( UTIL_SEQ_bm_t TaskId_bm );
void UTIL_SEQ_ResumeTask( UTIL_SEQ_bm_t TaskId_bm );
void UTIL_SEQ_SetEvt( UTIL_SEQ_bm_t EvtId_bm );
void UTIL_SEQ_ClrEvt( UTIL_SEQ_bm_t EvtId_bm );
void UTIL_SEQ_WaitEvt( UTIL_SEQ_bm_t EvtId_bm );
UTIL_SEQ_bm_t UTIL_SEQ_IsEvtPend( void );
void UTIL_SEQ_EvtIdle( UTIL_SEQ_bm_t TaskId_bm, UTIL_SEQ_bm_t EvtWaited_bm );
#ifdef __cplusplus
}
#endif
#endif /*__STM32_SEQ_H */
/************************ (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