PIC24 Support Libraries
|
#include "all_generic.h"
#include "esos_task.h"
#include "esos_mail.h"
#include "esos_comm.h"
#include "esos_irq.h"
Go to the source code of this file.
Data Structures | |
struct | stMailBoxDesc |
struct | stMailEnvelope |
Macros | |
#define | MAX_NUM_CHILD_TASKS MAX_NUM_USER_TASKS |
#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_A |
#define | ESOS_USER_FLAG_B |
#define | ESOS_USER_FLAG_C |
#define | ESOS_USER_FLAG_D |
#define | ESOS_USER_FLAG_E |
#define | ESOS_USER_FLAG_F |
#define | ESOS_USER_TIMER(timername) |
#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_GetNumberRunningTimers() |
#define | esos_IsTimerRunning(hndl) |
Typedefs | |
typedef int | main_t |
typedef uint8_t | ESOS_TMR_HANDLE |
Functions | |
void | user_init (void) |
ESOS_TASK_HANDLE | esos_GetFreeChildTaskStruct () |
uint32_t | esos_GetRandomUint32 () |
ESOS_TASK_HANDLE | esos_GetTaskHandle (uint8_t(*taskname)(ESOS_TASK_HANDLE pstTask)) |
ESOS_TASK_HANDLE | esos_GetTaskHandleFromID (uint16_t u16_TaskID) |
uint32_t | esos_string_hash_u32 (char *psz_str) |
uint32_t | esos_buffer_hash_u32 (void *buf, uint16_t len) |
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) |
Embedded Systems Operating System (ESOS)
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 | ( | ) |
Get the current number of user software timers registers (running) in the ESOS timer services
Definition at line 445 of file esos.h.
Referenced by esos_GetTimerHandle(), and esos_RegisterTimer().
#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 |
Definition at line 458 of file esos.h.
Referenced by esos_ChangeTimerPeriod(), esos_GetTimerHandle(), and esos_UnregisterTimer().
#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_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_A |
#define ESOS_USER_FLAG_B |
#define ESOS_USER_FLAG_C |
#define ESOS_USER_FLAG_D |
#define ESOS_USER_FLAG_E |
#define ESOS_USER_FLAG_F |
#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
Definition at line 112 of file esos.h.
Referenced by esos_GetFreeChildTaskStruct().
typedef uint8_t ESOS_TMR_HANDLE |
Handle to a software timer in the ESOS timer service.
typedef int main_t |
uint32_t esos_buffer_hash_u32 | ( | void * | buf, |
uint16_t | len | ||
) |
Create a 32-bit (uint32_t) hash value for a buffer of voids Routine maintains "state" in the form of variable __esos_u32FNVHash This "state" is used in all of the ESOS FNV hash functions. Based on the Fowler/Noll/Vo (FNV1a) hash algorithm and code provided at http://www.isthe.com/chongo/tech/comp/fnv/
buf | pointer to a buffer of voids |
len | length of the buffer of voids |
uint32_t | value of the resulting hash |
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 | ( | ) |
uint32_t esos_GetRandomUint32 | ( | void | ) |
Returns a 31-bit pseudo-random number generated by the Park-Miller algorithm.
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 |
uint32_t esos_string_hash_u32 | ( | char * | psz_str | ) |
Create a 32-bit (uint32_t) hash value for a provided string Routine maintains "state" in the form of variable __esos_u32FNVHash This "state" is used in all of the ESOS FNV hash functions. Based on the Fowler/Noll/Vo (FNV1a) hash algorithm and code provided at http://www.isthe.com/chongo/tech/comp/fnv/
psz_str | pointer to zero-terminated string |
uint32_t | value of the resulting hash |
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 116 of file app_ecan_receiver.c.