HbbTv  17.9.0
Open source HBBTV engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
hbbtv_sif_os.h File Reference

System Interface, Operating System. More...

#include "techtype.h"

Go to the source code of this file.

Macros

#define HBBTV_OS_TIMEOUT_NOW   0
 
#define HBBTV_OS_TIMEOUT_NEVER   0xffff
 

Functions

void * HBBTV_OSAlloc (U32BIT size)
 Allocates the specified number of bytes. More...
 
void HBBTV_OSFree (void *ptr)
 Releases previously allocated memory. More...
 
void * HBBTV_OSCreateMutex (void)
 Creates a new mutex. More...
 
void HBBTV_OSDeleteMutex (void *mutex)
 Deletes an exisiting mutex. More...
 
void HBBTV_OSMutexLock (void *mutex)
 Locks the specified mutex. More...
 
void HBBTV_OSMutexUnlock (void *mutex)
 Unlocks the specified mutex. More...
 
void * HBBTV_OSCreateCountSemaphore (U32BIT value)
 Creates a new counting semaphore, with the count set to value. More...
 
void HBBTV_OSDeleteSemaphore (void *semaphore)
 Deletes an exisiting semaphore. More...
 
void HBBTV_OSSemaphoreWait (void *semaphore)
 Waits for specified semaphore to be cleared. More...
 
BOOLEAN HBBTV_OSSemaphoreWaitTimeout (void *semaphore, U16BIT timeout)
 Waits a specified timeout period for a specified semaphore to be cleared. More...
 
void HBBTV_OSSemaphoreSignal (void *semaphore)
 Clears specified semaphore. More...
 
void * HBBTV_OSCreateTask (void(*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name)
 Creates a new task. More...
 
void HBBTV_OSDestroyTask (void *task_id)
 Destroys the specified task. More...
 
void HBBTV_OSTaskDelay (U16BIT time)
 Suspends current task for given period. More...
 
U32BIT HBBTV_OSGetClockMilliseconds (void)
 Returns the number of milliseconds since the system booted. More...
 
U32BIT HBBTV_OSGetTimeNow (void)
 Returns the current time. More...
 
void * HBBTV_OSCreateQueue (U16BIT msg_size, U16BIT msg_max)
 Creates a new message queue. More...
 
void HBBTV_OSDeleteQueue (void *queue)
 Deletes the specified message queue. More...
 
BOOLEAN HBBTV_OSReadQueue (void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
 Reads a message from specified queue. More...
 
BOOLEAN HBBTV_OSWriteQueue (void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
 Writes a message to specified queue. More...
 

Detailed Description

System Interface, Operating System.

Date
January 2014
Author
Sergio Panseri

Function Documentation

void* HBBTV_OSAlloc ( U32BIT  size)

Allocates the specified number of bytes.

Parameters
sizeRequired size of new memory block.
Returns
Pointer to memory location.
void* HBBTV_OSCreateCountSemaphore ( U32BIT  value)

Creates a new counting semaphore, with the count set to value.

Parameters
valueInitial value of count
Returns
New semaphore handle
void* HBBTV_OSCreateMutex ( void  )

Creates a new mutex.

Returns
New mutex handle
void* HBBTV_OSCreateQueue ( U16BIT  msg_size,
U16BIT  msg_max 
)

Creates a new message queue.

Parameters
msg_sizeSize of each message in queue
msg_maxMaximum number of messages in queue
Returns
New queue handle
void* HBBTV_OSCreateTask ( void(*)(void *)  function,
void *  param,
U32BIT  stack,
U8BIT  priority,
U8BIT *  name 
)

Creates a new task.

Parameters
functionPointer to callback function
paramParameter of above function
stackSize of stack required in bytes
priority0 - 15 (15 is highest)
nameName to assign to task
Returns
New task handle
void HBBTV_OSDeleteMutex ( void *  mutex)

Deletes an exisiting mutex.

Parameters
mutexMutex handle
void HBBTV_OSDeleteQueue ( void *  queue)

Deletes the specified message queue.

Parameters
queueQueue handle
void HBBTV_OSDeleteSemaphore ( void *  semaphore)

Deletes an exisiting semaphore.

Parameters
semaphoreSemaphore handle
void HBBTV_OSDestroyTask ( void *  task_id)

Destroys the specified task.

Parameters
task_idTask handle
void HBBTV_OSFree ( void *  ptr)

Releases previously allocated memory.

Parameters
ptrPointer to the memory block to be freed
U32BIT HBBTV_OSGetClockMilliseconds ( void  )

Returns the number of milliseconds since the system booted.

Returns
Time in milliseconds
U32BIT HBBTV_OSGetTimeNow ( void  )

Returns the current time.

Returns
Current time expressed in number of seconds passed since midnight (UTC) 1 January 1970
void HBBTV_OSMutexLock ( void *  mutex)

Locks the specified mutex.

Parameters
mutexMutex handle
void HBBTV_OSMutexUnlock ( void *  mutex)

Unlocks the specified mutex.

Parameters
mutexMutex handle
BOOLEAN HBBTV_OSReadQueue ( void *  queue,
void *  msg,
U16BIT  msg_size,
U16BIT  timeout 
)

Reads a message from specified queue.

Parameters
queueQueue handle
msgPointer to the buffer where the received message will be copied
msg_sizeSize of message
timeoutTimeout value (ms)
Returns
TRUE if message arrived, FALSE if timed out.
void HBBTV_OSSemaphoreSignal ( void *  semaphore)

Clears specified semaphore.

Parameters
semaphoreSemaphore handle
void HBBTV_OSSemaphoreWait ( void *  semaphore)

Waits for specified semaphore to be cleared.

Parameters
semaphoreSemaphore handle
BOOLEAN HBBTV_OSSemaphoreWaitTimeout ( void *  semaphore,
U16BIT  timeout 
)

Waits a specified timeout period for a specified semaphore to be cleared.

Parameters
semaphoreSemaphore handle
timeoutThe timeout in milliseconds, HBBTV_OS_TIMEOUT_NOW or HBBTV_OS_TIMEOUT_NEVER
Returns
TRUE if the semaphore was obtained, FALSE otherwise.
void HBBTV_OSTaskDelay ( U16BIT  time)

Suspends current task for given period.

Parameters
timeNumber of milliseconds the task will be suspended
BOOLEAN HBBTV_OSWriteQueue ( void *  queue,
void *  msg,
U16BIT  msg_size,
U16BIT  timeout 
)

Writes a message to specified queue.

Parameters
queueQueue handle
msgPointer to the message to be written
msg_sizeSize of message
timeoutTimeout value (ms)
Returns
TRUE if message arrived, FALSE if timed out.