esos/include/esos.h File Reference
#include "all_generic.h"
#include "esos_task.h"
#include "esos_comm.h"
#include "esos_irq.h"
Go to the source code of this file.
Detailed Description
Embedded Systems Operating System (ESOS)
Definition in file esos.h.
Define Documentation
#define esos_ClearUserFlag |
( |
mask |
|
) |
|
#define esos_GetFutureSystemTick |
( |
deltaT |
|
) |
|
Returns the system tick value of a future time
- Parameters:
-
| deltaT | the number of ticks in the future you'd like the system tick value for |
- Returns:
- The uint32 number corresponding to the system tick value of that future time
- See also:
- esos_GetSystemTick
Definition at line 290 of file esos.h.
#define esos_GetNumberRegisteredTasks |
( |
|
) |
|
Get the current number of user task registered with the ESOS scheduler.
- Returns:
- The uint8 number of currently registered user tasks
- Note:
- This value does not include the number of child tasks (tasks of the type ESOS_CHILD_TASK ), just the tasks of the type ESOS_USER_TASK
Definition at line 279 of file esos.h.
#define esos_GetNumberRunningTimers |
( |
|
) |
|
Get the current number of user software timers registers (running) in the ESOS timer services
- Returns:
- The uint8 number of currently registered user tasks
Definition at line 391 of file esos.h.
#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.
- Returns:
- The uint32 value of current value of the ESOS system tick counter
- Note:
- This counter value will roll-over every 49.7 days.
Definition at line 256 of file esos.h.
#define esos_IsTimerRunning |
( |
hndl |
|
) |
|
#define esos_IsUserFlagClear |
( |
mask |
|
) |
|
#define esos_IsUserFlagSet |
( |
mask |
|
) |
|
#define esos_SetUserFlag |
( |
mask |
|
) |
|
Sets bits in the global user flags provided by ESOS
- Parameters:
-
| mask | An uint16 value composed of the OR-ed user mask flag masks, where each flag in the OR will be set |
- Note:
- User should use the provided bits masks like ESOS_USER_FLAG_0 to create their own readable constants
#define HEADLIGHTS_ARE_ON ESOS_USER_FLAG_3
#define MY_USER_FRIENDLY_FLAG ESOS_USER_FLAG_7
esos_SetUserFlag( HEADLIGHTS_ARE_ON | MY_USER_FRIENDLY_FLAG);
- See also:
- esos_ClearUserFlag
esos_IsUserFlagSet
esos_IsUserFlagClear
Definition at line 308 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 105 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 109 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 113 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 117 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 121 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 125 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 129 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 133 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 137 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 141 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 145 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 149 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 153 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 157 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 161 of file esos.h.
Mask for a global user flag provided by ESOS
Definition at line 165 of file esos.h.
#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.
- Parameters:
-
| timername | The name of the software timer to create. |
- Note:
- You are really creating a C function implementing the user timer callback. Since ESOS timer serivces calls this callback function at the appropriate time, this function cannot be passed arguments and cannot return values
Definition at line 180 of file esos.h.
Typedef Documentation
Define the constants and structures required for our little embedded systems operating system
Definition at line 87 of file esos.h.
Function Documentation
ESOS_TASK_HANDLE esos_GetFreeChildTaskStruct |
( |
|
) |
|
Searches child task pool to find a free child task structure and returns a handle (pst) back to the caller
- Return values:
-
| TaskHandle | if a child task structure is available |
| ESOS_BAD_CHILD_TASK_HANDLE | if no structures are available at this time |
Definition at line 186 of file esos.c.
uint32 esos_GetRandomUint32 |
( |
void |
|
) |
|
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.
- Parameters:
-
| 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) |
- Return values:
-
| ESOS_TMR_FAILURE | if no more timers can added at this time |
| timerhandle | if timer service was registered |
- See also:
- ESOS_USER_TIMER
esos_UnregisterTimer
esos_GetTimerHandle
esos_ChangeTimerPeriod
esos_IsTimerRunning
Definition at line 302 of file esos.c.
User-provided function to initialize user's hardware configuration register user tasks.
- Note:
- All ESOS applications MUST provide this function.
This function MUST register at least one ESOS task.
user_init() is a centralized initialization routine where the user can setup their application. It is called automagically by ES_OS during the operating system initialization.
User should set up any state machines and init all application variables. They can also turn on any needed peripherals here.
User shall not mess with the interrupt hardware directly!!! The ESOS must be aware of the interrupts and provides esos_XXXXXXX functions for the user to use. Using these ESOS-provided functions, the user may (and probably should) initialize, register, and enable interrupts in this routine.
Furthermore, the user should register AT LEAST one user application task here via esos_RegisterTask or the ES_OS scheduler will have nothing to schedule to run when this function returns.
Definition at line 191 of file app_childtask.c.