MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
stb_os.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 #ifndef _STB_OS_H
26 #define _STB_OS_H
27 
28 #include "techtype.h"
29 
30 /*---Constant and macro definitions for public use-----------------------------*/
31 
32 // timeouts for queues, semaphores etc
33 #define TIMEOUT_NOW 0
34 #define TIMEOUT_NEVER 0xffff
35 
36 /*---Enumerations for public use-----------------------------------------------*/
37 
38 /*---Global type defs for public use-------------------------------------------*/
39 
40 /*---Global Function prototypes for public use---------------------------------*/
41 
46 U32BIT STB_OSGetClockMilliseconds(void);
47 
60 void* STB_OSCreateTask(void (*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name);
61 
66 void STB_OSTaskDelay(U16BIT timeout);
67 
72 void STB_OSDestroyTask(void *task);
73 
80 void* STB_OSCreateQueue(U16BIT msg_size, U16BIT msg_max);
81 
90 BOOLEAN STB_OSReadQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout);
91 
100 BOOLEAN STB_OSWriteQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout);
101 
107 BOOLEAN STB_OSDestroyQueue(void *queue);
108 
115 void* STB_OSCreateSemaphore(void);
116 
122 void* STB_OSCreateCountSemaphore(U32BIT value);
123 
129 void STB_OSSemaphoreWait(void *semaphore);
130 
135 void STB_OSSemaphoreSignal(void *semaphore);
136 
143 BOOLEAN STB_OSSemaphoreWaitTimeout(void *semaphore, U16BIT timeout);
144 
150 void STB_OSDeleteSemaphore(void *semaphore);
151 
156 void* STB_OSCreateMutex(void);
157 
162 void STB_OSMutexLock(void *mutex);
163 
168 void STB_OSMutexUnlock(void *mutex);
169 
174 void STB_OSDeleteMutex(void *mutex);
175 
176 #endif // _STB_OS_H
177 
U32BIT STB_OSGetClockMilliseconds(void)
Get Current Computer Clock Time.
void STB_OSSemaphoreWait(void *semaphore)
Wait on Semaphore Indefinity or Until Released.
void STB_OSTaskDelay(U16BIT timeout)
Delay Task for Specifed Time Period.
void STB_OSDeleteMutex(void *mutex)
Delete a mutex.
BOOLEAN STB_OSDestroyQueue(void *queue)
Destroy Queue.
BOOLEAN STB_OSWriteQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
Write a message to the queue.
void STB_OSMutexUnlock(void *mutex)
Unlock a mutex (a.k.a. 'leave', 'signal' or 'release')
void * STB_OSCreateSemaphore(void)
Create a Binary Semaphore. That is maximum value of 1. The initial value should be 1...
void * STB_OSCreateQueue(U16BIT msg_size, U16BIT msg_max)
Create Queue of given number of messages and size of message.
void * STB_OSCreateMutex(void)
Create a mutex.
BOOLEAN STB_OSReadQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
Read a message from a queue.
BOOLEAN STB_OSSemaphoreWaitTimeout(void *semaphore, U16BIT timeout)
Wait on Semaphore for Set Time Period in an Attempt to Acquire.
System Wide Global Technical Data Type Definitions.
void STB_OSMutexLock(void *mutex)
Lock a mutex (a.k.a. 'enter', 'wait' or 'get').
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...
void * STB_OSCreateCountSemaphore(U32BIT value)
Create a counting semaphore.
void STB_OSDestroyTask(void *task)
Delete Task must be called upon termination of each task as it frees all OS specific resources alloca...
void STB_OSDeleteSemaphore(void *semaphore)
Delete a Semaphore.
void STB_OSSemaphoreSignal(void *semaphore)
Signal a Semaphore to Release it by decrementing its counter.