|
PIC24 Support Libraries
|
Central code for Embedded Systems Operating System (ESOS) More...
#include "esos.h"Go to the source code of this file.
Functions | |
| ESOS_TASK_HANDLE | esos_RegisterTask (uint8_t(*taskname)(ESOS_TASK_HANDLE pstTask)) |
| uint8_t | esos_UnregisterTask (uint8_t(*taskname)(ESOS_TASK_HANDLE pstTask)) |
| ESOS_TASK_HANDLE | esos_GetTaskHandle (uint8_t(*taskname)(ESOS_TASK_HANDLE pstTask)) |
| ESOS_TASK_HANDLE | esos_GetTaskHandleFromID (uint16_t u16_TaskID) |
| ESOS_TASK_HANDLE | esos_GetFreeChildTaskStruct () |
| void | esos_SetRandomUint32Seed (uint32_t u32_in) |
| uint32_t | esos_GetRandomUint32 (void) |
| uint32_t | esos_buffer_hash_u32 (void *buf, uint16_t len) |
| uint32_t | esos_string_hash_u32 (char *psz_str) |
| uint8_t | esos_GetMaxNumberTasks (void) |
| ESOS_TMR_HANDLE | esos_RegisterTimer (void(*timername)(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) |
Central code for Embedded Systems Operating System (ESOS)
Definition in file esos.c.
| 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 | ( | ) |
| uint8_t esos_GetMaxNumberTasks | ( | void | ) |
| 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_TASK_HANDLE esos_RegisterTask | ( | uint8_t(*)(ESOS_TASK_HANDLE pstTask) | taskname | ) |
Adds a task to the scheduler. Task will start executing at the next opportunity. (almost immediately)
| taskname | name of task (argument to ESOS_USER_TASK declaration |
| NULLPTR | if no more tasks can execute at this time (scheduler is full) |
| TaskHandle | the handle of the just registered and scheduled task |
| 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 |
| void esos_SetRandomUint32Seed | ( | uint32_t | u32_in | ) |
Sets the seed value in the ESOS pseudo-random number generator (PRNG).
| 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_UnregisterTask | ( | uint8_t(*)(ESOS_TASK_HANDLE pstTask) | taskname | ) |
Removes the task from the scheduler
| taskname | name of task (argument to ESOS_USER_TASK declaration |
| TRUE | if task was found in scheduler and removed |
| FALSE | otherwise |
| 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 |
1.8.13