![]() |
MHEG5
22.3.0
|
Header file - Function prototypes for operating system. More...
#include "techtype.h"
Go to the source code of this file.
Macros | |
#define | TIMEOUT_NOW 0 |
#define | TIMEOUT_NEVER 0xffff |
Functions | |
U32BIT | STB_OSGetClockMilliseconds (void) |
Get Current Computer Clock Time. More... | |
void * | STB_OSCreateTask (void(*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name) |
Create a New Task to the calling process. Upon success, the created task runs on its own stack, as part of the calling process context. Task termination must be achieved by calling STB_OSDestroyTask() More... | |
void | STB_OSTaskDelay (U16BIT timeout) |
Delay Task for Specifed Time Period. More... | |
void | STB_OSDestroyTask (void *task) |
Delete Task must be called upon termination of each task as it frees all OS specific resources allocated for the specific task. It is NOT called from the exiting task. More... | |
void * | STB_OSCreateQueue (U16BIT msg_size, U16BIT msg_max) |
Create Queue of given number of messages and size of message. More... | |
BOOLEAN | STB_OSReadQueue (void *queue, void *msg, U16BIT msg_size, U16BIT timeout) |
Read a message from a queue. More... | |
BOOLEAN | STB_OSWriteQueue (void *queue, void *msg, U16BIT msg_size, U16BIT timeout) |
Write a message to the queue. More... | |
BOOLEAN | STB_OSDestroyQueue (void *queue) |
Destroy Queue. More... | |
void * | STB_OSCreateSemaphore (void) |
Create a Binary Semaphore. That is maximum value of 1. The initial value should be 1, so that first call to STB_OSSemaphoreWait will not block. More... | |
void * | STB_OSCreateCountSemaphore (U32BIT value) |
Create a counting semaphore. More... | |
void | STB_OSSemaphoreWait (void *semaphore) |
Wait on Semaphore Indefinity or Until Released. More... | |
void | STB_OSSemaphoreSignal (void *semaphore) |
Signal a Semaphore to Release it by decrementing its counter. More... | |
BOOLEAN | STB_OSSemaphoreWaitTimeout (void *semaphore, U16BIT timeout) |
Wait on Semaphore for Set Time Period in an Attempt to Acquire. More... | |
void | STB_OSDeleteSemaphore (void *semaphore) |
Delete a Semaphore. More... | |
void * | STB_OSCreateMutex (void) |
Create a mutex. More... | |
void | STB_OSMutexLock (void *mutex) |
Lock a mutex (a.k.a. 'enter', 'wait' or 'get'). More... | |
void | STB_OSMutexUnlock (void *mutex) |
Unlock a mutex (a.k.a. 'leave', 'signal' or 'release') More... | |
void | STB_OSDeleteMutex (void *mutex) |
Delete a mutex. More... | |
Header file - Function prototypes for operating system.
void* STB_OSCreateCountSemaphore | ( | U32BIT | value | ) |
Create a counting semaphore.
value | initial value for semaphore. |
void* STB_OSCreateMutex | ( | void | ) |
Create a mutex.
void* STB_OSCreateQueue | ( | U16BIT | msg_size, |
U16BIT | msg_max | ||
) |
Create Queue of given number of messages and size of message.
msg_size | Queue Message Packet Size |
num_msgs | Queue Message Depth in Packets |
void* STB_OSCreateSemaphore | ( | void | ) |
Create a Binary Semaphore. That is maximum value of 1. The initial value should be 1, so that first call to STB_OSSemaphoreWait will not block.
void* STB_OSCreateTask | ( | void(*)(void *) | function, |
void * | param, | ||
U32BIT | stack, | ||
U8BIT | priority, | ||
U8BIT * | name | ||
) |
Create a New Task to the calling process. Upon success, the created task runs on its own stack, as part of the calling process context. Task termination must be achieved by calling STB_OSDestroyTask()
function | task entry point |
param | user defined parameter passed when task is started |
stack | stack size |
priority | task priority, min 0, max 15 |
name | task name |
void STB_OSDeleteMutex | ( | void * | mutex | ) |
Delete a mutex.
mutex_var | The mutex to delete. |
void STB_OSDeleteSemaphore | ( | void * | semaphore | ) |
Delete a Semaphore.
semaphore | Semaphore handle. |
BOOLEAN STB_OSDestroyQueue | ( | void * | queue | ) |
Destroy Queue.
queue | Unique Queue Handle Identifier Variable Address. |
void STB_OSDestroyTask | ( | void * | task | ) |
Delete Task must be called upon termination of each task as it frees all OS specific resources allocated for the specific task. It is NOT called from the exiting task.
task | Handle of task |
U32BIT STB_OSGetClockMilliseconds | ( | void | ) |
Get Current Computer Clock Time.
void STB_OSMutexLock | ( | void * | mutex | ) |
Lock a mutex (a.k.a. 'enter', 'wait' or 'get').
mutex_var | The mutex to lock. |
void STB_OSMutexUnlock | ( | void * | mutex | ) |
Unlock a mutex (a.k.a. 'leave', 'signal' or 'release')
mutex_var | The mutex to unlock. |
BOOLEAN STB_OSReadQueue | ( | void * | queue, |
void * | msg, | ||
U16BIT | msg_size, | ||
U16BIT | timeout | ||
) |
Read a message from a queue.
queue | Queue Handle |
data | User's Read Message Buffer Start Address. |
msg_size | Message Packet Size in Bytes. |
timeout | timeout in milliseconds |
void STB_OSSemaphoreSignal | ( | void * | semaphore | ) |
Signal a Semaphore to Release it by decrementing its counter.
semaphore | Semaphore handle. |
void STB_OSSemaphoreWait | ( | void * | semaphore | ) |
Wait on Semaphore Indefinity or Until Released.
semaphore | Semaphore handle. |
BOOLEAN STB_OSSemaphoreWaitTimeout | ( | void * | semaphore, |
U16BIT | timeout | ||
) |
Wait on Semaphore for Set Time Period in an Attempt to Acquire.
semaphore | Semaphore handle. |
timeout | Time Period to Wait in milliseconds. |
void STB_OSTaskDelay | ( | U16BIT | timeout | ) |
Delay Task for Specifed Time Period.
timeout | delay in milliSeconds. |
BOOLEAN STB_OSWriteQueue | ( | void * | queue, |
void * | msg, | ||
U16BIT | msg_size, | ||
U16BIT | timeout | ||
) |
Write a message to the queue.
queue | Queue Handle |
data | message to be queued |
msg_size | size of message in bytes |
timeout | timeout in milliseconds |