stm32_seq.c File Reference

Simple sequencer implementation. More...

`#include "stm32_seq.h"`
`#include "utilities_conf.h"`

Go to the source code of this file.

## Data Structures

struct | UTIL_SEQ_Priority_t
| structure used to manage task scheduling More...

## Macros

#define | UTIL_SEQ_ENTER_CRITICAL_SECTION_IDLE() UTIL_SEQ_ENTER_CRITICAL_SECTION( )
| macro used to enter the critical section before calling the IDLE function More...
#define | UTIL_SEQ_EXIT_CRITICAL_SECTION_IDLE() UTIL_SEQ_EXIT_CRITICAL_SECTION( )
| macro used to exit the critical section when exiting the IDLE function More...
#define | UTIL_SEQ_NOTASKRUNNING (0xFFFFFFFFU)
| define to represent no task running More...
#define | UTIL_SEQ_NO_BIT_SET (0U)
| define to represent no bit set inside uint32_t mapping More...
#define | UTIL_SEQ_ALL_BIT_SET (~0U)
| define to represent all bits set inside uint32_t mapping More...
#define | UTIL_SEQ_CONF_TASK_NBR (32)
| default number of task is default 32 (maximum), can be reduced by redefining in utilities_conf.h More...
#define | UTIL_SEQ_CONF_PRIO_NBR (2)
| default value of priority number. More...
#define | UTIL_SEQ_MEMSET8(dest, value, size) UTILS_MEMSET8( dest, value, size )
| default memset function. More...

## Functions

uint8_t | SEQ_BitPosition (uint32_t Value)
| return the position of the first bit set to 1 More...
void | UTIL_SEQ_Init (void)
| This function initializes the sequencer resources. More...
void | UTIL_SEQ_DeInit (void)
| This function un-initializes the sequencer resources. More...
void | UTIL_SEQ_Run (UTIL_SEQ_bm_t Mask_bm)
| This function requests the sequencer to execute all pending tasks using round robin mechanism. When no task are pending, it calls UTIL_SEQ_Idle(); This function should be called in a while loop in the application. More...
void | UTIL_SEQ_RegTask (UTIL_SEQ_bm_t TaskId_bm, uint32_t Flags, void(*Task)(void))
| This function registers a task in the sequencer. More...
void | UTIL_SEQ_SetTask (UTIL_SEQ_bm_t TaskId_bm, uint32_t Task_Prio)
| This function requests a task to be executed. More...
uint32_t | UTIL_SEQ_IsSchedulableTask (UTIL_SEQ_bm_t TaskId_bm)
| This function checks if a task could be scheduled. More...
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 default, all tasks are executed by the sequencer when set with UTIL_SEQ_SetTask() When a task is paused, it is moved out from the sequencer list. More...
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 the sequencer when set with UTIL_SEQ_SetTask() The exit of the pause shall be done by the function UTIL_SEQ_ResumeTask. More...
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 is used in relation with UTIL_SEQ_PauseTask() More...
void | UTIL_SEQ_SetEvt (UTIL_SEQ_bm_t EvtId_bm)
| This function sets an event that is waited with UTIL_SEQ_WaitEvt() More...
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 when the UTIL_SEQ_SetEvt() is called several time to notify the same event. Due to Software Architecture where the timings are hard to control, this may be an unwanted case. More...
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 event is set When called recursively, it acts as a First in / Last out mechanism. The sequencer waits for the last event requested to be set even though one of the already requested event has been set. More...
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_EvtIdle() is overloaded by the application. In that case, when the low power mode needs to be executed, the application shall first check whether the waited event is pending or not. Both the event checking and the low power mode processing should be done in critical section. More...
__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. More...
__WEAK void | UTIL_SEQ_Idle (void)
| This function is called by the sequencer in critical section (PRIMASK bit) when. More...
__WEAK void | UTIL_SEQ_PreIdle (void)
| This function is called by the sequencer outside critical section just before calling UTIL_SEQ_Idle( ) UTIL_SEQ_PreIdle() is considered as the last task executed before calling UTIL_SEQ_Idle( ) In case a task or an event is set from an interrupt handler just after UTIL_SEQ_PreIdle() is called, UTIL_SEQ_Idle() will not be called. More...
__WEAK void | UTIL_SEQ_PostIdle (void)
| This function is called by the sequencer outside critical section either. More...

## Detailed Description

Simple sequencer implementation.

Author
  MCD Application Team

Attention

##
© Copyright (c) 2019 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32_seq.c.