ESOS32
ESOSOn32-bitProcessors
|
#include "all_generic.h"
#include "esos_utils.h"
#include "esos_task.h"
#include "esos_mail.h"
#include "esos_comm.h"
Go to the source code of this file.
Data Structures | |
struct | stMailBoxDesc |
struct | stMailEnvelope |
struct | stTimer |
Macros | |
#define | BUILT_ON_ESOS |
#define | MAX_NUM_USER_TASKS 32 |
#define | ESOS_USE_SERIAL_PORT |
#define | OS_END while(1) |
#define | OS_ITERATE |
#define | MAX_NUM_CHILD_TASKS MAX_NUM_USER_TASKS |
#define | REMOVE_IDX 0xFE |
#define | ESOS_USER_FLAG_0 |
#define | ESOS_USER_FLAG_1 |
#define | ESOS_USER_FLAG_2 |
#define | ESOS_USER_FLAG_3 |
#define | ESOS_USER_FLAG_4 |
#define | ESOS_USER_FLAG_5 |
#define | ESOS_USER_FLAG_6 |
#define | ESOS_USER_FLAG_7 |
#define | ESOS_USER_FLAG_8 |
#define | ESOS_USER_FLAG_9 |
#define | ESOS_USER_FLAG_10 |
#define | ESOS_USER_FLAG_11 |
#define | ESOS_USER_FLAG_12 |
#define | ESOS_USER_FLAG_13 |
#define | ESOS_USER_FLAG_14 |
#define | ESOS_USER_FLAG_15 |
#define | ESOS_USER_FLAG_16 |
#define | ESOS_USER_FLAG_17 |
#define | ESOS_USER_FLAG_18 |
#define | ESOS_USER_FLAG_19 |
#define | ESOS_USER_FLAG_20 |
#define | ESOS_USER_FLAG_21 |
#define | ESOS_USER_FLAG_22 |
#define | ESOS_USER_FLAG_23 |
#define | ESOS_USER_FLAG_24 |
#define | ESOS_USER_FLAG_25 |
#define | ESOS_USER_FLAG_26 |
#define | ESOS_USER_FLAG_27 |
#define | ESOS_USER_FLAG_28 |
#define | ESOS_USER_FLAG_29 |
#define | ESOS_USER_FLAG_30 |
#define | ESOS_USER_FLAG_31 |
#define | ESOS_USER_TIMER(timername) |
#define | __MILLISECONDS_PER_TICK 1 |
#define | MILLISECONDS __MILLISECONDS_PER_TICK |
#define | SECONDS MILLISECONDS*1000 |
#define | MINUTES SECONDS*60 |
#define | HOURS MINUTES*60 |
#define | DAYS HOURS*24 |
#define | esos_GetSystemTick() |
#define | esos_GetNumberRegisteredTasks() |
#define | esos_GetFutureSystemTick(deltaT) |
#define | esos_SetUserFlag(mask) |
#define | esos_ClearUserFlag(mask) |
#define | esos_IsUserFlagSet(mask) |
#define | esos_IsUserFlagClear(mask) |
#define | __esos_SetSystemFlag(mask) BIT_SET_MASK(__esos_u32SystemFlags, (mask)) |
#define | __esos_ClearSystemFlag(mask) BIT_CLEAR_MASK(__esos_u32SystemFlags, (mask)) |
#define | __esos_IsSystemFlagSet(mask) IS_BIT_SET_MASK(__esos_u32SystemFlags, (mask)) |
#define | __esos_IsSystemFlagClear(mask) IS_BIT_CLEAR_MASK(__esos_u32SystemFlags, (mask)) |
#define | ESOS_TMR_FAILURE 0xFF |
#define | MAX_NUM_TMRS 16 |
#define | esos_GetNumberRunningTimers() |
#define | esos_IsTimerRunning(hndl) |
#define | __esos_MarkTimerRunning(hndl) BIT_SET_MASK(__esos_u32TmrActiveFlags, (ESOS_BIT0<<(hndl))) |
#define | __esos_MarkTimerStopped(hndl) BIT_CLEAR_MASK(__esos_u32TmrActiveFlags, (ESOS_BIT0<<(hndl))) |
#define | __ESOS_SYS_FLAG_PACK_TASKS ESOS_BIT0 |
#define | __ESOS_SYS_FLAG_NULL_LAST_TASK ESOS_BIT1 |
#define | __ESOS_SYS_COMM_TX_IS_BUSY ESOS_BIT2 |
#define | __ESOS_SYS_COMM_RX_IS_BUSY ESOS_BIT3 |
#define | __ESOS_SYS_COMM_TX_ONGOING ESOS_BIT4 |
#define | __ESOS_SYS_I2C_IN_USE ESOS_BIT8 |
#define | __ESOS_SYS_SPI_IN_USE ESOS_BIT9 |
#define | __ESOS_SYS_ADC_IN_USE ESOS_BIT10 |
#define | __abs(x) (((x) < 0) ? -(x) : (x)) |
Typedefs | |
typedef int | main_t |
typedef uint8_t | ESOS_TMR_HANDLE |
Functions | |
void | user_init (void) |
ESOS_TASK_HANDLE | esos_RegisterTask (uint8_t(*pfn_TaskFcn)(struct stTask *pst_Task)) |
uint8_t | esos_UnregisterTask (uint8_t(*pfn_TaskFcn)(struct stTask *pst_Task)) |
ESOS_TASK_HANDLE | esos_GetFreeChildTaskStruct () |
ESOS_TASK_HANDLE | esos_GetTaskHandle (uint8_t(*taskname)(ESOS_TASK_HANDLE pstTask)) |
ESOS_TASK_HANDLE | esos_GetTaskHandleFromID (uint16_t u16_TaskID) |
ESOS_TMR_HANDLE | esos_RegisterTimer (void(*pfnTmrFcn)(void), uint32_t u32_period) |
uint8_t | esos_UnregisterTimer (ESOS_TMR_HANDLE hnd_timer) |
ESOS_TMR_HANDLE | esos_GetTimerHandle (void(*pfnTmrFcn)(void)) |
uint8_t | esos_ChangeTimerPeriod (ESOS_TMR_HANDLE hnd_timer, uint32_t u32_period) |
void | __esos_hw_InitSystemTick (void) |
uint32_t | __esos_hw_GetSystemTickCount (void) |
uint32_t | __esos_hw_PRNG_u32 (void) |
void | __esos_hw_config_PRNG (void) |
void | __esos_hw_set_PRNG_Seed (uint32_t u32_seed) |
uint16_t | __esos_hasTickDurationPassed (uint32_t u32_startTick, uint32_t u32_period) |
void | __esos_tmrSvcsExecute (void) |
void | __esos_InitCommSystem (void) |
Variables | |
uint8_t | __esos_u8UserTasksRegistered |
uint32_t | __esos_u32UserFlags |
uint32_t | __esos_u32SystemFlags |
Embedded Systems Operating System 32-bit (ESOS32)
Definition in file esos.h.
#define esos_ClearUserFlag | ( | mask | ) |
Clears bits in the global user flags provided by ESOS
mask | An uint16 value composed of the OR-ed user mask flag masks, where each flag in the OR will be cleared |
#define esos_GetFutureSystemTick | ( | deltaT | ) |
Returns the system tick value of a future time
deltaT | the number of ticks in the future you'd like the system tick value for |
#define esos_GetNumberRegisteredTasks | ( | ) |
Get the current number of user task registered with the ESOS scheduler.
#define esos_GetNumberRunningTimers | ( | ) |
#define esos_GetSystemTick | ( | ) |
Get the current value of the ESOS system tick counter In the current implementation of ESOS, a tick equal 1.0ms. Therefore, the value returned by this function is approximately equal to the number of milliseconds since the since was last reset.
#define esos_IsTimerRunning | ( | hndl | ) |
Determines if the software timer represented by the handle is currently running
hndl | The ESOS_TMR_HANDLE of a software timer |
TRUE | if the timer is currently running |
FALSE | if the timer is not currently running |
#define esos_IsUserFlagClear | ( | mask | ) |
Queries whether the global user flags provided by ESOS are clear
mask | An uint16 value composed of the OR-ed user mask flag masks, where each flag in the OR will be checked for being clear |
TRUE | if at least one of the flags is clear |
FALSE | if none of the flags are clear |
#define esos_IsUserFlagSet | ( | mask | ) |
Queries whether the global user flags provided by ESOS are set
mask | An uint16 value composed of the OR-ed user mask flag masks, where each flag in the OR will be checked for being set |
TRUE | if at least one of the flags is set |
FALSE | if none of the flags are set |
#define esos_SetUserFlag | ( | mask | ) |
Sets bits in the global user flags provided by ESOS
mask | An uint16 value composed of the OR-ed user mask flag masks, where each flag in the OR will be set |
#define ESOS_USER_FLAG_0 |
#define ESOS_USER_FLAG_1 |
#define ESOS_USER_FLAG_10 |
#define ESOS_USER_FLAG_11 |
#define ESOS_USER_FLAG_12 |
#define ESOS_USER_FLAG_13 |
#define ESOS_USER_FLAG_14 |
#define ESOS_USER_FLAG_15 |
#define ESOS_USER_FLAG_16 |
#define ESOS_USER_FLAG_17 |
#define ESOS_USER_FLAG_18 |
#define ESOS_USER_FLAG_19 |
#define ESOS_USER_FLAG_2 |
#define ESOS_USER_FLAG_20 |
#define ESOS_USER_FLAG_21 |
#define ESOS_USER_FLAG_22 |
#define ESOS_USER_FLAG_23 |
#define ESOS_USER_FLAG_24 |
#define ESOS_USER_FLAG_25 |
#define ESOS_USER_FLAG_26 |
#define ESOS_USER_FLAG_27 |
#define ESOS_USER_FLAG_28 |
#define ESOS_USER_FLAG_29 |
#define ESOS_USER_FLAG_3 |
#define ESOS_USER_FLAG_30 |
#define ESOS_USER_FLAG_31 |
#define ESOS_USER_FLAG_4 |
#define ESOS_USER_FLAG_5 |
#define ESOS_USER_FLAG_6 |
#define ESOS_USER_FLAG_7 |
#define ESOS_USER_FLAG_8 |
#define ESOS_USER_FLAG_9 |
#define ESOS_USER_TIMER | ( | timername | ) |
Declaration of an user-defined timer callback (for ESOS timer services)
This macro is used to declare a user-timer. All timers using ESOS timer services must be declared with this macro.
timername | The name of the software timer to create. |
#define MAX_NUM_CHILD_TASKS MAX_NUM_USER_TASKS |
Define the maximum number of user tasks in the system
typedef uint8_t ESOS_TMR_HANDLE |
Handle to a software timer in the ESOS timer service.
typedef int main_t |
uint8_t esos_ChangeTimerPeriod | ( | ESOS_TMR_HANDLE | hnd_timer, |
uint32_t | u32_period | ||
) |
Change a timer period.
hnd_timer | handle to timer whose period is to be changed |
u32_period | new period for timer selected by mask |
FALSE | if timer is not currently running |
TRUE | if timer period was changed |
ESOS_TASK_HANDLE esos_GetFreeChildTaskStruct | ( | ) |
ESOS_TASK_HANDLE esos_GetTaskHandle | ( | uint8_t(*)(ESOS_TASK_HANDLE pstTask) | taskname | ) |
Find the (active) task handle for a given task function
taskname | name of task (argument to ESOS_USER_TASK declaration |
NULLPTR | if task is not found among the active tasks |
TaskHandle | the handle to the task function requested |
ESOS_TASK_HANDLE esos_GetTaskHandleFromID | ( | uint16_t | u16_TaskID | ) |
Find the (active) task handle for a given task function
u16_TaskID | name of task (argument to ESOS_USER_TASK declaration) |
NULLPTR | if task is not found among the active tasks |
TaskHandle | the handle to the task function requested |
ESOS_TMR_HANDLE esos_GetTimerHandle | ( | void(*)(void) | pfnTmrFcn | ) |
Finds the timer handle to the provided and ACTIVE timer function
pfnTmrFcn | pointer to timer function (will execute each time timer expires) |
ESOS_TMR_FAILURE | could not find the function in the active timer list |
timerHandle | handle to timer |
ESOS_TMR_HANDLE esos_RegisterTimer | ( | void(*)(void) | timername, |
uint32_t | u32_period | ||
) |
Adds a timer to the ESOS timer service. Timer function will execute at its next opportunity. Timer functions must have void arguments and void returns.
timername | name under which timer was declared in ESOS_USER_TIMER. and contains the code to run when software timer expires |
u32_period | period of timer in system ticks (currently, milliseconds) |
ESOS_TMR_FAILURE | if no more timers can added at this time |
timerhandle | if timer service was registered |
uint8_t esos_UnregisterTimer | ( | ESOS_TMR_HANDLE | hnd_timer | ) |
Removes a timer from the ESOS timer service.
hnd_timer | handle to timer to remove |
FALSE | if timer wasn't active in the first place |
TRUE | if timer was stopped and removed |
void user_init | ( | void | ) |
User-provided function to initialize user's hardware configuration register user tasks.
Definition at line 807 of file app_example.c.