Fujitsu DTV/STB solution driver (FAPex driver) Documentation [V01L00R00]


abst_common.c File Reference

abstraction library source file (common system service) More...

Defines

#define FAPEX_SYS_OK   0
#define FAPEX_SYS_NG   1
#define FAPEX_SYS_RTOS_OK   1
#define FAPEX_SYS_RTOS_NG   0
#define FAPEX_SYS_THREAD_DMSG(fmt,...)
#define FAPEX_SYS_TC_ST_NO_INIT   0
#define FAPEX_SYS_TC_ST_INIT   1
#define FAPEX_SYS_MAILBOX_DMSG(fmt,...)
#define FAPEX_SYS_MBOX_USE   1
#define FAPEX_SYS_MBOX_NOUSE   2
#define FAPEX_SYS_MAILBOX_TYPE_POINTER   'P'
#define FAPEX_SYS_MAILBOX_TYPE_BUFFER   'B'
#define FAPEX_SYS_MAILBOX_DESC_NOWAIT   1
#define FAPEX_SYS_MAILBOX_TIMEOUT   2
#define FAPEX_SYS_MAILBOX_NO_DATA   3
#define FAPEX_SYS_MAILBOX_ERROR   4
#define FAPEX_SYS_TIME_WAIT_UNIT   1
#define FAPEX_SYS_MBOX_LIST_MAX   256
#define FAPEX_SYS_TIME_TRUE   1
#define FAPEX_SYS_TIME_FALSE   2
#define FAPEX_SYS_PRIORITY_ADJUST_CEILING   1
#define FAPEX_SYS_PRIORITY_ADJUST_RESET   0
#define FAPEX_SYS_SET_NULL_VALUE   =0
#define FAPEX_SYS_EVENT_NAME_SIZE   8
#define FAPEX_SYS_EVENT_TABLE_SIZE   256
 number of event table entries
#define FAPEX_SYS_MAX_MAILQUEUE_ENTRIES   4096
#define FAPEX_SYS_EVENT_TYPE_UNDEFINED   0x00000000UL
#define FAPEX_SYS_THREAD_STATE_EVENT_WAIT   0x00000040UL
#define FAPEX_SYS_EVENT_TYPE_MAILQUEUE   0x00000044UL
#define FAPEX_SYS_THREAD_STATE_DESTROY_WAIT   0x00000080UL
#define FAPEX_SYS_ERR_BASE   -100000
#define FAPEX_SYS_ERR_INVALID_HANDLE   FAPEX_SYS_ERR_BASE-104
 Bad handle passed.
#define FAPEX_SYS_ERR_INVALID_PARAMETER   FAPEX_SYS_ERR_BASE-105
 Bad parameter passed.
#define FAPEX_SYS_ERR_TIMEOUT   FAPEX_SYS_ERR_BASE-106
 operation timed out
#define FAPEX_SYS_ERR_OUT_OF_MEMORY   FAPEX_SYS_ERR_BASE-107
 Memory allocation failed.
#define FAPEX_SYS_ERR_NOT_ALLOWED   FAPEX_SYS_ERR_BASE-108
 Not allowed in interrupt context.
#define FAPEX_SYS_ERR_HANDLE_DESTROYED   FAPEX_SYS_ERR_BASE-109
 Handle destroyed in the meantime.
#define FAPEX_SYS_FILE_DMSG(fmt,...)

Typedefs

typedef struct timeval FAPEX_SYS_TIME_T
typedef fapex_sys_thread_listT FAPEX_SYS_ThreadInfoT

Functions

int32_t FAPEX_SYS_SelectGetSize (uint32_t mode)
 Get select status memory size.
int32_t FAPEX_SYS_SelectInit (FAPEX_SYS_SelectParamStrT *psel, void *pbase, uint32_t mode)
 Initialize select.
int32_t FAPEX_SYS_SelectSetID (FAPEX_SYS_SelectParamStrT *psel, int32_t id, uint32_t mode)
 Set select status.
int32_t FAPEX_SYS_SelectClearID (FAPEX_SYS_SelectParamStrT *psel, int32_t id, uint32_t mode)
 Clear select status.
int32_t FAPEX_SYS_SelectSetParam (FAPEX_SYS_SelectParamStrT *psel, int32_t maxid, FAPEX_SYS_TIMEVAL_T *pTimeout)
 set parameter to a select structure.
int32_t FAPEX_SYS_SelectCall (FAPEX_SYS_SelectParamStrT *psel)
 Call select. This function allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation.
int32_t FAPEX_SYS_SelectCheck (FAPEX_SYS_SelectParamStrT *psel, int32_t id, uint32_t mode)
 Check select. This function checks whether data of this id is readable/writeable/exceptional.
FAPEX_SYS_SemaphoreT FAPEX_SYS_CreateSemaphore (uint32_t value)
 Create a semaphore.
int32_t FAPEX_SYS_DestroySemaphore (FAPEX_SYS_SemaphoreT sem)
 Destroy a semaphore.
int32_t FAPEX_SYS_GetSemaphore (FAPEX_SYS_SemaphoreT sem, int32_t timeout)
 Get a semaphore.
int32_t FAPEX_SYS_SetSemaphore (FAPEX_SYS_SemaphoreT sem, int32_t timeout)
 Set a semaphore.
FAPEX_SYS_ThreadT FAPEX_SYS_CreateThread (uint32_t *stackBuffer, uint32_t stackSize, uint32_t priority, FAPEX_SYS_ThreadFunctionT function, void *optArg, void *optData, const char_t *optName)
 Create a new thread.
uint32_t FAPEX_SYS_DestroyThread (FAPEX_SYS_ThreadT threadHandle)
 Destroy the current thread.
FAPEX_SYS_ThreadT FAPEX_SYS_GetThread (void)
 Get the thread handle of the current thread.
uint32_t FAPEX_SYS_GetThreadState (FAPEX_SYS_ThreadT threadHandle)
 Get current state of the given thread handle.
const char_tFAPEX_SYS_GetThreadName (FAPEX_SYS_ThreadT threadHandle)
 Get the thread name of the given thread handle.
uint32_t FAPEX_SYS_SuspendThread (FAPEX_SYS_ThreadT threadHandle)
 Suspends the given thread.
uint32_t FAPEX_SYS_WakeupThread (FAPEX_SYS_ThreadT threadHandle)
 Wake up a suspended thread.
int32_t FAPEX_SYS_WaitEndThread (FAPEX_SYS_ThreadT threadHandle)
 wait for termination of another thread
void FAPEX_SYS_WaitEndAllThread ()
void FAPEX_SYS_InitServices (void)
void FAPEX_SYS_ExitApplication (int32_t status)
const char_tFAPEX_SYS_GetIdentity (void)
void FAPEX_SYS_StartMultitasking (void)
void FAPEX_SYS_StartPrintThread (void)
void FAPEX_SYS_StopPrintThread (void)
int32_t FAPEX_SYS_GetLastError (void)
 Retrieve the last error code of the current thread.
uint32_t FAPEX_SYS_CriticalSection_Init (void)
uint32_t FAPEX_SYS_EnterCriticalSection (void)
void FAPEX_SYS_LeaveCriticalSection (uint32_t cpuStatus)
FAPEX_SYS_MailboxT FAPEX_SYS_CreateMailbox (uint32_t messageBytes)
uint32_t FAPEX_SYS_DestroyMailbox (FAPEX_SYS_MailboxT mailboxHandle)
uint32_t FAPEX_SYS_SetMailbox (FAPEX_SYS_MailboxT mailboxHandle, void *messagePtr, uint32_t msecsTimeout)
uint32_t FAPEX_SYS_GetMailbox (FAPEX_SYS_MailboxT mailboxHandle, void *resultBuffer, uint32_t msecsTimeout)
FAPEX_SYS_MailqueueT FAPEX_SYS_CreateMailqueue (uint32_t queueElements, uint32_t elementBytes)
 Create a new mailqueue event structure.
uint32_t FAPEX_SYS_DestroyMailqueue (FAPEX_SYS_MailqueueT mailqueuePtr)
 Destroy a mailqueue event structure.
uint32_t FAPEX_SYS_GetMailqueue (FAPEX_SYS_MailqueueT mailqueueHandle, void *resultBuffer, uint32_t msecsTimeout)
 Get a mailqueue message.
uint32_t FAPEX_SYS_SetMailqueue (FAPEX_SYS_MailqueueT mailqueueHandle, void *messagePtr, uint32_t toFront, uint32_t msecsTimeout)
 Send a message to a mailqueue.
int32_t FAPEX_SYS_FFindFirst (const char *filename, FAPEX_SYS_FFindStrT *find)
 Find first file or subdirectory in a specified directory.
int32_t FAPEX_SYS_FFindNext (FAPEX_SYS_FFindStrT *find)
 Finds the next file or subdirectory in a specified directory after a previous call to FAPEX_SYS_FFindFirst or FAPEX_SYS_FFindNext.
long FAPEX_SYS_FFileLength (const char *filename)
int32_t FAPEX_SYS_KEYIN (char_t *keycode, int32_t *length)
uint32_t FAPEX_SYS_CalculateCrc32 (const uint8_t *dataPtr, const uint32_t dataLength, const uint32_t *const crcTable)
 Calculate CRC32 checksum for a given data array.
uint64_t FAPEX_TIMER_GetTimeStamp (uint32_t resolution)
 Retrievs the current counter of a given timer.

Variables

uint32_t fapex_sys_IsrActive FAPEX_SYS_SET_NULL_VALUE

Detailed Description

abstraction library source file (common system service)

These function is executed in user space.

Attention:
This program is provided as is. You can redistribute it and/or modify it. Fujitsu Semiconductor Limited accepts no responsibility or liability for any errors or omissions.

Copyright (C) 2008-2010 Fujitsu Semiconductor Limited, All Rights Reserved.


Define Documentation

#define FAPEX_SYS_OK   0
#define FAPEX_SYS_NG   1
#define FAPEX_SYS_RTOS_OK   1
#define FAPEX_SYS_RTOS_NG   0
#define FAPEX_SYS_THREAD_DMSG (   fmt,
  ... 
)
#define FAPEX_SYS_TC_ST_NO_INIT   0
#define FAPEX_SYS_TC_ST_INIT   1
#define FAPEX_SYS_MAILBOX_DMSG (   fmt,
  ... 
)
#define FAPEX_SYS_MBOX_USE   1
#define FAPEX_SYS_MBOX_NOUSE   2
#define FAPEX_SYS_MAILBOX_TYPE_POINTER   'P'
#define FAPEX_SYS_MAILBOX_TYPE_BUFFER   'B'
#define FAPEX_SYS_MAILBOX_DESC_NOWAIT   1
#define FAPEX_SYS_MAILBOX_TIMEOUT   2
#define FAPEX_SYS_MAILBOX_NO_DATA   3
#define FAPEX_SYS_MAILBOX_ERROR   4
#define FAPEX_SYS_TIME_WAIT_UNIT   1
#define FAPEX_SYS_MBOX_LIST_MAX   256
#define FAPEX_SYS_TIME_TRUE   1
#define FAPEX_SYS_TIME_FALSE   2
#define FAPEX_SYS_PRIORITY_ADJUST_CEILING   1
#define FAPEX_SYS_PRIORITY_ADJUST_RESET   0
uint32_t fapex_sys_TimerTickPeriodMsecs FAPEX_SYS_SET_NULL_VALUE   =0
#define FAPEX_SYS_EVENT_NAME_SIZE   8
#define FAPEX_SYS_EVENT_TABLE_SIZE   256

number of event table entries

#define FAPEX_SYS_MAX_MAILQUEUE_ENTRIES   4096
#define FAPEX_SYS_EVENT_TYPE_UNDEFINED   0x00000000UL
#define FAPEX_SYS_THREAD_STATE_EVENT_WAIT   0x00000040UL
#define FAPEX_SYS_EVENT_TYPE_MAILQUEUE   0x00000044UL
#define FAPEX_SYS_THREAD_STATE_DESTROY_WAIT   0x00000080UL
#define FAPEX_SYS_ERR_BASE   -100000
#define FAPEX_SYS_ERR_INVALID_HANDLE   FAPEX_SYS_ERR_BASE-104

Bad handle passed.

#define FAPEX_SYS_ERR_INVALID_PARAMETER   FAPEX_SYS_ERR_BASE-105

Bad parameter passed.

#define FAPEX_SYS_ERR_TIMEOUT   FAPEX_SYS_ERR_BASE-106

operation timed out

#define FAPEX_SYS_ERR_OUT_OF_MEMORY   FAPEX_SYS_ERR_BASE-107

Memory allocation failed.

#define FAPEX_SYS_ERR_NOT_ALLOWED   FAPEX_SYS_ERR_BASE-108

Not allowed in interrupt context.

#define FAPEX_SYS_ERR_HANDLE_DESTROYED   FAPEX_SYS_ERR_BASE-109

Handle destroyed in the meantime.

#define FAPEX_SYS_FILE_DMSG (   fmt,
  ... 
)

Typedef Documentation

typedef struct timeval FAPEX_SYS_TIME_T
typedef fapex_sys_thread_listT FAPEX_SYS_ThreadInfoT

Function Documentation

int32_t FAPEX_SYS_SelectGetSize ( uint32_t  mode )

Get select status memory size.

Parameters:
moderead/write/exception flag
The value of mode is the bitwise-inclusive OR of values from the following list.

Return values:
>0size of the memory for select status
See also:
FAPEX_SYS_SelectInit
int32_t FAPEX_SYS_SelectInit ( FAPEX_SYS_SelectParamStrT psel,
void *  pbase,
uint32_t  mode 
)

Initialize select.

Parameters:
*pselThe pointer to a select structure
*pbaseThe pointer to a select status context
This pbase is top of memory area that size should be large than returned size of FAPEX_SYS_SelectGetSize().
moderead/write/exception flag
The value of mode is the bitwise-inclusive OR of values from the following list.

Return values:
0process OK
Note:
If this 'mode' is different from 'mode' used in FAPEX_SYS_SelectGetSize(), the operation of *psel is not guaranteed.
See also:
FAPEX_SYS_SelectGetSize
int32_t FAPEX_SYS_SelectSetID ( FAPEX_SYS_SelectParamStrT psel,
int32_t  id,
uint32_t  mode 
)

Set select status.

Parameters:
*pselThe pointer to a select structure
idThe identifier for file descriptor.
moderead/write/exception flag
The value of mode is the bitwise-inclusive OR of values from the following list.

Return values:
0process OK
-1process fails
Note:
If *psel initialized in FAPEX_SYS_SelectInit() is not used, this operation is not guaranteed.
See also:
FAPEX_SYS_SelectInit
FAPEX_SYS_SelectClearID
int32_t FAPEX_SYS_SelectClearID ( FAPEX_SYS_SelectParamStrT psel,
int32_t  id,
uint32_t  mode 
)

Clear select status.

Parameters:
*pselThe pointer to a select structure
idThe identifier for file descriptor.
moderead/write/exception flag
The value of mode is the bitwise-inclusive OR of values from the following list.

Return values:
0process OK
-1process fails
Note:
If *psel initialized in FAPEX_SYS_SelectInit() is not used, this operation is not guaranteed.
See also:
FAPEX_SYS_SelectInit
FAPEX_SYS_SelectSetID
int32_t FAPEX_SYS_SelectSetParam ( FAPEX_SYS_SelectParamStrT psel,
int32_t  maxid,
FAPEX_SYS_TIMEVAL_T pTimeout 
)

set parameter to a select structure.

Parameters:
*pselThe pointer to a select structure
maxidThe maximum value of watched identifiers
*pTimeoutThe pointer to a time structure (with seconds and microseconds)
Return values:
0process OK
Note:
If *psel initialized in FAPEX_SYS_SelectInit() is not used, this operation is not guaranteed.
See also:
FAPEX_SYS_SelectInit
int32_t FAPEX_SYS_SelectCall ( FAPEX_SYS_SelectParamStrT psel )

Call select. This function allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become "ready" for some class of I/O operation.

Parameters:
*pselThe pointer to a select structure
Return values:
>0process OK, its value is the total number of bits set in the bit masks.
0process timeout
-1process fails, its value is set to errno.
Note:
If *psel initialized in FAPEX_SYS_SelectInit() is not used, this operation is not guaranteed.
See also:
FAPEX_SYS_SelectInit
FAPEX_SYS_SelectSetID
FAPEX_SYS_SelectClearID
FAPEX_SYS_SelectSetParam
int32_t FAPEX_SYS_SelectCheck ( FAPEX_SYS_SelectParamStrT psel,
int32_t  id,
uint32_t  mode 
)

Check select. This function checks whether data of this id is readable/writeable/exceptional.

Parameters:
*pselThe pointer to a select structure
idThe identifier for file descriptor.
moderead/write/exception flag
The value of mode is the bitwise-inclusive OR of values from the following list.

Return values:
>0process OK
-1process fails.
Note:
If *psel initialized in FAPEX_SYS_SelectInit() is not used, this operation is not guaranteed.
See also:
FAPEX_SYS_SelectInit
FAPEX_SYS_SemaphoreT FAPEX_SYS_CreateSemaphore ( uint32_t  value )

Create a semaphore.

Parameters:
valueThe initial value of the semaphore.
Return values:
>0Handle to the new semaphore (sucessful)
0semaphore could not be created.
See also:
FAPEX_SYS_DestroySemaphore
FAPEX_SYS_GetSemaphore
FAPEX_SYS_SetSemaphore
int32_t FAPEX_SYS_DestroySemaphore ( FAPEX_SYS_SemaphoreT  sem )

Destroy a semaphore.

Parameters:
semThe semaphore to destroy. It must come from a previous call to FAPEX_SYS_CreateSemaphore.
Return values:
0sucessful
!0semaphore could not be destroyed.
See also:
FAPEX_SYS_CreateSemaphore
FAPEX_SYS_GetSemaphore
FAPEX_SYS_SetSemaphore
int32_t FAPEX_SYS_GetSemaphore ( FAPEX_SYS_SemaphoreT  sem,
int32_t  timeout 
)

Get a semaphore.

Parameters:
semThe semaphore to get. It must come from a previous call to FAPEX_SYS_CreateSemaphore.
timeouttimeout value

  • FAPEX_SYS_SUSPEND
    The current thread should wait until the semaphore is free (blocking mode).
  • FAPEX_SYS_NO_SUSPEND
    The current thread should not be blocked (non-blocking mode).
  • other
    The value represents the time in milliseconds to (at most) wait for the semaphore (timeout mode).
Return values:
0sucessful
!0unsuccessful
See also:
FAPEX_SYS_CreateSemaphore
FAPEX_SYS_DestroySemaphore
FAPEX_SYS_SetSemaphore
int32_t FAPEX_SYS_SetSemaphore ( FAPEX_SYS_SemaphoreT  sem,
int32_t  timeout 
)

Set a semaphore.

Parameters:
semThe semaphore to set. It must come from a previous call to FAPEX_SYS_CreateSemaphore.
timeouttimeout value

  • FAPEX_SYS_SUSPEND
    The current thread should wait until the semaphore is free (blocking mode).
  • FAPEX_SYS_NO_SUSPEND
    The current thread should not be blocked (non-blocking mode).
  • other
    The value represents the time in milliseconds to (at most) wait for the semaphore (timeout mode).
Return values:
0sucessful
!0unsuccessful
See also:
FAPEX_SYS_CreateSemaphore
FAPEX_SYS_DestroySemaphore
FAPEX_SYS_GetSemaphore
FAPEX_SYS_ThreadT FAPEX_SYS_CreateThread ( uint32_t *  stackBuffer,
uint32_t  stackSize,
uint32_t  priority,
FAPEX_SYS_ThreadFunctionT  function,
void *  optArg,
void *  optData,
const char_t optName 
)

Create a new thread.

This function creates a new thread. It searches an unused element within the internal thread table and initializes it with the given values.

Parameters:
stackBuffera pointer to the begin (low address) of a memory buffer to be used as thread stack. A NULL pointer forces the internal dynamical allocate of memory using the size argument stackBytes.
stackSizethe number of 4 kbyte elements in the given stack memory. This value must not be '0'.
prioritythe priority value for the thread to create, this value will be used only by the priority-control scheduler, the round-robin scheduler silently ignores this value.
functiona pointer to the real thread function, this function must accept an optional void* argument and must not return a value.
optArgan optional function argument passed to the real thread function during the initial wakeup.
optDataan optional data pointer to be stored in the thread structure.
optNamean optional string containing a thread name (max.15 chars)
Returns:
  • A pointer of eventType FAPEX_SYS_ThreadT which will be required by other kernel thread functions
  • NULL in case of error, please use FAPEX_SYS_GetLastError() to read the last error code.
uint32_t FAPEX_SYS_DestroyThread ( FAPEX_SYS_ThreadT  threadHandle )

Destroy the current thread.

This function destroys the given thread and performs a context switch to activate the next waiting thread.

Parameters:
threadHandleThe thread handle to destroy.
Return values:
0sucessful
!0unsuccessful
Note:
in case of a '0' return value you should check the real error code by calling FAPEX_SYS_GetLastError().
FAPEX_SYS_ThreadT FAPEX_SYS_GetThread ( void   )

Get the thread handle of the current thread.

This function returns the thread identifier of the current thread which will be required as argument to other kernel thread functions.

Returns:
  • The thread handle of the current thread.
  • The thread handle of the IDLE thread is case of problems
uint32_t FAPEX_SYS_GetThreadState ( FAPEX_SYS_ThreadT  threadHandle )

Get current state of the given thread handle.

Parameters:
threadHandleThe thread handle to access.
const char_t* FAPEX_SYS_GetThreadName ( FAPEX_SYS_ThreadT  threadHandle )

Get the thread name of the given thread handle.

This function returns the optional thread name from the given thread handle.

Parameters:
threadHandleThe thread handle to access.
Returns:
  • '0' if the given thread identifier did not address a valid thread
  • any other positiv value specifies the pointer to the data element.
uint32_t FAPEX_SYS_SuspendThread ( FAPEX_SYS_ThreadT  threadHandle )

Suspends the given thread.

This function suspends the given thread. A suspended thread can be re-activated only by the function FAMOS_ThreadWakeup(). After setting the thread mode to SUSPENDED to scheduler will be called to execute the next waiting thread.

Parameters:
threadHandleThe thread handle to access.
Return values:
0sucessful
!0unsuccessful
uint32_t FAPEX_SYS_WakeupThread ( FAPEX_SYS_ThreadT  threadHandle )

Wake up a suspended thread.

This function wakes up a previously suspended thread. Only threads which were suspended before using the function FAMOS_ThreadSuspend() can be re-activated.

Parameters:
threadHandleThe thread handle to access.
Return values:
0sucessful
!0unsuccessful
int32_t FAPEX_SYS_WaitEndThread ( FAPEX_SYS_ThreadT  threadHandle )

wait for termination of another thread

this function suspends execution of the calling thread until the target thread terminates, unless the target thread has already terminated.

Parameters:
threadHandleThe thread handle to wait.
Return values:
0sucessful
!0unsuccessful
void FAPEX_SYS_WaitEndAllThread ( void   )
void FAPEX_SYS_InitServices ( void   )
void FAPEX_SYS_ExitApplication ( int32_t  status )
const char_t* FAPEX_SYS_GetIdentity ( void   )
void FAPEX_SYS_StartMultitasking ( void   )
void FAPEX_SYS_StartPrintThread ( void   )
void FAPEX_SYS_StopPrintThread ( void   )
int32_t FAPEX_SYS_GetLastError ( void   )

Retrieve the last error code of the current thread.

This function reads the last error code from the current thread handle.

Returns:
the last error code value
uint32_t FAPEX_SYS_CriticalSection_Init ( void   )
uint32_t FAPEX_SYS_EnterCriticalSection ( void   )
void FAPEX_SYS_LeaveCriticalSection ( uint32_t  cpuStatus )
FAPEX_SYS_MailboxT FAPEX_SYS_CreateMailbox ( uint32_t  messageBytes )
uint32_t FAPEX_SYS_DestroyMailbox ( FAPEX_SYS_MailboxT  mailboxHandle )
uint32_t FAPEX_SYS_SetMailbox ( FAPEX_SYS_MailboxT  mailboxHandle,
void *  messagePtr,
uint32_t  msecsTimeout 
)
uint32_t FAPEX_SYS_GetMailbox ( FAPEX_SYS_MailboxT  mailboxHandle,
void *  resultBuffer,
uint32_t  msecsTimeout 
)
FAPEX_SYS_MailqueueT FAPEX_SYS_CreateMailqueue ( uint32_t  queueElements,
uint32_t  elementBytes 
)

Create a new mailqueue event structure.

Parameters:
queueElementsThe number of void pointers in the internal queue table
elementBytesThe number of void pointers in the internal queue table The special value FAPEX_SYS_MSG_IS_POINTER can be used to tell the mailqueue to transport a pointers to messages and not their contentses.
Returns:
  • An identifier to the newly created mailqueue event structure
  • NULL if either no more mailqueue are available or the requested amount of mailqueue elements could not be dynamically allocated
uint32_t FAPEX_SYS_DestroyMailqueue ( FAPEX_SYS_MailqueueT  mailqueuePtr )

Destroy a mailqueue event structure.

Parameters:
mailqueuePtrThe mailqueue handle to destroy.
Return values:
1if the mailqueue could be destroyed
0if the given mailqueue identifier is invalid.
uint32_t FAPEX_SYS_GetMailqueue ( FAPEX_SYS_MailqueueT  mailqueueHandle,
void *  resultBuffer,
uint32_t  msecsTimeout 
)

Get a mailqueue message.

Parameters:
mailqueueHandleThe mailbox event handle to access.
resultBufferThe buffer where to copy the mailqueue message into, must be big enough to get the message. The size of a message must have been given in a previous call of RTOS_CreateMailqueue().
msecsTimeoutThe timeout value in msecs to wait before returning to the calling function, the following value are allowed:

  • FAPEX_SYS_SUSPEND
    The current thread should wait until the semaphore is free (blocking mode).
  • FAPEX_SYS_NO_SUSPEND
    The current thread should not be blocked (non-blocking mode).
  • other
    The value represents the time in milliseconds to (at most) wait for the semaphore (timeout mode).
Return values:
1if a message was successfully read from the mailqueue
0if either the given mailqueue handle is invalid or if this function is called in ISR context
uint32_t FAPEX_SYS_SetMailqueue ( FAPEX_SYS_MailqueueT  mailqueueHandle,
void *  messagePtr,
uint32_t  toFront,
uint32_t  msecsTimeout 
)

Send a message to a mailqueue.

Parameters:
mailqueueHandleThe mailequeue event handle to access.
messagePtrThe message pointer to store in the mailbox.
toFrontA flag which decides whether to put the given message to the front of the queue (if '1') or to the end.
msecsTimeoutThe timeout value in msecs to wait before returning to the calling function, the following value are allowed:

  • FAPEX_SYS_SUSPEND
    The current thread should wait until the semaphore is free (blocking mode).
  • FAPEX_SYS_NO_SUSPEND
    The current thread should not be blocked (non-blocking mode).
  • other
    The value represents the time in milliseconds to (at most) wait for the semaphore (timeout mode).
Return values:
1if the given message was successfully send to the mailqueue
0if either the given mailqueue handle is invalid or if the given message points to NULL.
int32_t FAPEX_SYS_FFindFirst ( const char *  filename,
FAPEX_SYS_FFindStrT find 
)

Find first file or subdirectory in a specified directory.

Parameters:
filenamename of file to find.
findwhere to store find information.
Return values:
0sucessful
-1unsuccessful
int32_t FAPEX_SYS_FFindNext ( FAPEX_SYS_FFindStrT find )

Finds the next file or subdirectory in a specified directory after a previous call to FAPEX_SYS_FFindFirst or FAPEX_SYS_FFindNext.

Parameters:
findfind information (created by FAPEX_SYS_FFindFirst call)
Return values:
0sucessful
-1unsuccessful
long FAPEX_SYS_FFileLength ( const char *  filename )
int32_t FAPEX_SYS_KEYIN ( char_t keycode,
int32_t *  length 
)
uint32_t FAPEX_SYS_CalculateCrc32 ( const uint8_t *  dataPtr,
const uint32_t  dataLength,
const uint32_t *const   crcTable 
)

Calculate CRC32 checksum for a given data array.

Parameters:
dataPtrPointer to data array.
dataLengthSize of data array in bytes.
crcTablePointer to the CRC LUT to be used. This array should be included as a header file by the user of the CRC function. (eg: #include <fapi/sys_crc_0x82608EDB.h>) The hex number represents the polynom used for calculating the CRC.
Returns:
CRC32 checksum value.
uint64_t FAPEX_TIMER_GetTimeStamp ( uint32_t  resolution )

Retrievs the current counter of a given timer.

This function retrieves the current 64 bit counter value of the hardware timer. Based on the given resolution value the current hardware timer counter will be divided to return the current value in the requested resolution.

Parameters:
resolutionThe resolution value to set for the given timer block as follows.

Return values:
0unsuccessful, if the resolution value is out of range
>0the current timer counter value 1..0xFFFFFFFFFFFFFFFF

Variable Documentation

uint32_t fapex_sys_TimerTickPeriodMsecs FAPEX_SYS_SET_NULL_VALUE


Copyright © 2006-2010 by Fujitsu Semiconductor Europe GmbH
Copyright © 2008-2010 by Fujitsu Semiconductor Limited

Disclaimer:
Please note that the use of this has been based on the terms and conditions of "DK Consent Letter (For Linux)" agreement between you and Fujitsu Semiconductor Limited.
The contents of this document may be revised without prior notice. Contact our sales department for confirmation. The information in this document are presented as is, no license is granted by implication or otherwise.
More...

FUJITSU sales representatives