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


fapex/abst_types.h File Reference

abstraction library types header file More...

Data Structures

struct  FAPEX_SYS_SelectParamStrT
 select structure More...
struct  FAPEX_SYS_FNameStrT
 find name structure More...
struct  FAPEX_SYS_FFindStrT
 find structure More...

Defines

#define FAPEX_SYS_ERR_FEATURE_NOT_SUPPORTED   (FAPEX_RET_ERR_BASE + FAPEX_ERR_FEATURE_NOT_SUPPORTED)
#define FAPEX_SYS_ERR_INVALID_STATUS   (FAPEX_RET_ERR_BASE + FAPEX_ERR_INVALID_HANDLE)
#define FAPI_NG   (-1)
#define FAPI_SYS_MALLOC   malloc
#define FAPI_SYS_MALLOC_CACHED   malloc
#define FAPI_SYS_REALLOC   realloc
#define FAPI_SYS_FREE   free
#define FAPI_SYS_SLEEP(t)   usleep(1000*t)
#define FAPI_MMU_Free(x, ptr)   FAPI_SYS_FREE( ptr )
#define FAPI_MMU_Malloc(x, bytes)   FAPI_SYS_MALLOC( bytes )
#define FAPI_MMU_Realloc(x, ptr, bytes)   FAPI_SYS_REALLOC( ptr, bytes )
#define FAPI_SYS_CalculateCrc32   FAPEX_SYS_CalculateCrc32
#define FAPEX_SYS_FMAXNAME   256
#define FAPEX_SYS_FMAXEXT   256
#define FAPEX_SYS_FMAXPATH   512
#define FAPEX_SYS_FDRIVERINIT   int
#define FAPEX_SYS_FDRIVER   int
#define FAPEX_SYS_FPosStrT   unsigned long
#define FAPEX_SYS_FPARTITION   int
#define FAPEX_SYS_FATTR_ARC   0x20
#define FAPEX_SYS_FATTR_DIR   0x10
#define FAPEX_SYS_FATTR_VOLUME   0x08
#define FAPEX_SYS_FATTR_SYSTEM   0x04
#define FAPEX_SYS_FATTR_HIDDEN   0x02
#define FAPEX_SYS_FATTR_READONLY   0x01
#define FAPEX_SYS_FCTIME_SEC_SHIFT   0
#define FAPEX_SYS_FCTIME_SEC_MASK   0x001f
#define FAPEX_SYS_FCTIME_MIN_SHIFT   5
#define FAPEX_SYS_FCTIME_MIN_MASK   0x07e0
#define FAPEX_SYS_FCTIME_HOUR_SHIFT   11
#define FAPEX_SYS_FCTIME_HOUR_MASK   0xf800
#define FAPEX_SYS_FCDATE_DAY_SHIFT   0
#define FAPEX_SYS_FCDATE_DAY_MASK   0x001f
#define FAPEX_SYS_FCDATE_MONTH_SHIFT   5
#define FAPEX_SYS_FCDATE_MONTH_MASK   0x01e0
#define FAPEX_SYS_FCDATE_YEAR_SHIFT   9
#define FAPEX_SYS_FCDATE_YEAR_MASK   0xfe00
#define FAPI_SYS_NO_SUSPEND   0x00000000UL
 Advise the system not to suspend the current thread.
#define FAPI_SYS_SUSPEND   0xFFFFFFFFUL
 Advise the system to suspend the current thread.
#define FAPI_SYS_SemaphoreT   FAPEX_SYS_SemaphoreT
#define FAPI_SYS_CREATE_SEMAPHORE(value)   FAPEX_SYS_CreateSemaphore(value)
#define FAPI_SYS_DESTROY_SEMAPHORE(sem)   FAPEX_SYS_DestroySemaphore(sem)
#define FAPI_SYS_GET_SEMAPHORE(sem, type)   FAPEX_SYS_GetSemaphore(sem, type)
#define FAPI_SYS_SET_SEMAPHORE(sem, type)   FAPEX_SYS_SetSemaphore(sem, type)
#define FAPI_SYS_PRINT_MSG(fmt,...)   printf(fmt,##__VA_ARGS__)
#define FAPI_SYS_PRINT_DEBUG(level,...)
#define FAPEX_SYS_PRIORITY_LOWEST   1
#define FAPEX_SYS_PRIORITY_LOW   25
#define FAPEX_SYS_PRIORITY_MEDIUM   50
#define FAPEX_SYS_PRIORITY_HIGH   75
#define FAPEX_SYS_PRIORITY_HIGHEST   99
#define FAPI_SYS_PRINT_ERR(fmt, err)
#define FAPEX_TIMER_RESOLUTION_1_USEC   1UL
 timer resolution 1 usec
#define FAPEX_TIMER_RESOLUTION_10_USEC   10UL
 timer resolution 10 usec
#define FAPEX_TIMER_RESOLUTION_100_USEC   100UL
 timer resolution 100 usec
#define FAPEX_TIMER_RESOLUTION_1_MSEC   1000UL
 timer resolution 1 msec
#define FAPEX_TIMER_RESOLUTION_10_MSEC   10000UL
 timer resolution 10 msec
#define FAPEX_TIMER_RESOLUTION_100_MSEC   100000UL
 timer resolution 100 msec
#define FAPEX_TIMER_RESOLUTION_1_SEC   1000000UL
 timer resolution 1 sec
#define FAPEX_TIMER_RESOLUTION_1_MIN   60000000UL
 timer resolution 1 minute
#define FAPEX_TIMER_RESOLUTION_1_HOUR   3600000000UL
 timer resolution 1 hour
#define FAPEX_SYS_SUSPEND   FAPI_SYS_SUSPEND
#define FAPEX_SYS_NO_SUSPEND   FAPI_SYS_NO_SUSPEND
#define FAPEX_SYS_MSG_IS_POINTER   0xFFFFFFFFUL
 the message to transport is a generic pointer only
#define FAPEX_SYS_EnterCritical(status_reg)   status_reg=FAPEX_SYS_EnterCriticalSection()
#define FAPEX_SYS_LeaveCritical(status_reg)   FAPEX_SYS_LeaveCriticalSection(status_reg)
#define FAPEX_SYS_FSEEK_SET   SEEK_SET
#define FAPEX_SYS_FSEEK_CUR   SEEK_CUR
#define FAPEX_SYS_FSEEK_END   SEEK_END
#define FAPEX_SYS_FFILE   FILE
 refer to FILE structure.
#define FAPEX_SYS_FOpen   fopen
 refer to fopen().
#define FAPEX_SYS_FClose   fclose
 refer to fclose().
#define FAPEX_SYS_FSeek   fseek
 refer to fseek().
#define FAPEX_SYS_FTell   ftell
 refer to ftell().
#define FAPEX_SYS_FGetc   fgetc
 refer to fgetc().
#define FAPEX_SYS_FPutc   fputc
 refer to fputc().
#define FAPEX_SYS_FRewind   rewind
 refer to rewind().
#define FAPEX_SYS_FEof   feof
 refer to feof().
#define FAPEX_SYS_FRead   fread
 refer to fread().
#define FAPEX_SYS_FWrite   fwrite
 refer to fwrite().

Typedefs

typedef sem_t * FAPEX_SYS_SemaphoreT
typedef void * FAPEX_SYS_HandleT
typedef void * FAPEX_SYS_MailboxT
typedef void(* FAPEX_SYS_ThreadFunctionT )(void *)
typedef void * FAPEX_SYS_ThreadT
typedef void * FAPEX_SYS_MailqueueT
typedef void * FAPEX_SYS_EventT
typedef int32_t FAPEXOPENRET_T
typedef int32_t FAPEXOPENARG1_T
typedef int32_t FAPEXOPENARG2_T
typedef void * FAPEXOPENARG3_T
typedef int32_t FAPEXRELRET_T
typedef int32_t FAPEXRELARG1_T
typedef int32_t FAPEXREADRET_T
typedef int32_t FAPEXREADARG1_T
typedef void * FAPEXREADARG2_T
typedef int32_t FAPEXREADARG3_T
typedef int32_t FAPEXWRTRET_T
typedef int32_t FAPEXWRTARG1_T
typedef const void * FAPEXWRTARG2_T
typedef int32_t FAPEXWRTARG3_T
typedef int32_t FAPEXIOCRET_T
typedef int32_t FAPEXIOCARG1_T
typedef uint32_t FAPEXIOCARG2_T
typedef uint32_t FAPEXIOCARG3_T
typedef void * FAPEXMMPRET_T
typedef int32_t FAPEXMUNMPRET_T
typedef void * FAPEXMMPARG1_T
typedef size_t FAPEXMMPARG2_T
typedef int32_t FAPEXMMPARG3_T
typedef int32_t FAPEXMMPARG4_T
typedef int32_t FAPEXMMPARG5_T
typedef off_t FAPEXMMPARG6_T
typedef fd_set FAPEX_SYS_SLCTSTAT_T
typedef struct timeval FAPEX_SYS_TIMEVAL_T

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)
void FAPEX_SYS_InitServices (void)
uint32_t FAPEX_SYS_InitKernel (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.

Detailed Description

abstraction library types header file

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_ERR_FEATURE_NOT_SUPPORTED   (FAPEX_RET_ERR_BASE + FAPEX_ERR_FEATURE_NOT_SUPPORTED)

FAPex sys error code base value

Feature or function is not available.

#define FAPEX_SYS_ERR_INVALID_STATUS   (FAPEX_RET_ERR_BASE + FAPEX_ERR_INVALID_HANDLE)

Invalid status.

#define FAPI_NG   (-1)
#define FAPI_SYS_MALLOC   malloc
#define FAPI_SYS_MALLOC_CACHED   malloc
#define FAPI_SYS_REALLOC   realloc
#define FAPI_SYS_FREE   free
#define FAPI_SYS_SLEEP (   t )    usleep(1000*t)
#define FAPI_MMU_Free (   x,
  ptr 
)    FAPI_SYS_FREE( ptr )
#define FAPI_MMU_Malloc (   x,
  bytes 
)    FAPI_SYS_MALLOC( bytes )
#define FAPI_MMU_Realloc (   x,
  ptr,
  bytes 
)    FAPI_SYS_REALLOC( ptr, bytes )
#define FAPI_SYS_CalculateCrc32   FAPEX_SYS_CalculateCrc32
#define FAPEX_SYS_FMAXNAME   256
#define FAPEX_SYS_FMAXEXT   256
#define FAPEX_SYS_FMAXPATH   512
#define FAPEX_SYS_FDRIVERINIT   int
#define FAPEX_SYS_FDRIVER   int
#define FAPEX_SYS_FPosStrT   unsigned long
#define FAPEX_SYS_FPARTITION   int
#define FAPEX_SYS_FATTR_ARC   0x20
#define FAPEX_SYS_FATTR_DIR   0x10
#define FAPEX_SYS_FATTR_VOLUME   0x08
#define FAPEX_SYS_FATTR_SYSTEM   0x04
#define FAPEX_SYS_FATTR_HIDDEN   0x02
#define FAPEX_SYS_FATTR_READONLY   0x01
#define FAPEX_SYS_FCTIME_SEC_SHIFT   0
#define FAPEX_SYS_FCTIME_SEC_MASK   0x001f
#define FAPEX_SYS_FCTIME_MIN_SHIFT   5
#define FAPEX_SYS_FCTIME_MIN_MASK   0x07e0
#define FAPEX_SYS_FCTIME_HOUR_SHIFT   11
#define FAPEX_SYS_FCTIME_HOUR_MASK   0xf800
#define FAPEX_SYS_FCDATE_DAY_SHIFT   0
#define FAPEX_SYS_FCDATE_DAY_MASK   0x001f
#define FAPEX_SYS_FCDATE_MONTH_SHIFT   5
#define FAPEX_SYS_FCDATE_MONTH_MASK   0x01e0
#define FAPEX_SYS_FCDATE_YEAR_SHIFT   9
#define FAPEX_SYS_FCDATE_YEAR_MASK   0xfe00
#define FAPI_SYS_NO_SUSPEND   0x00000000UL

Advise the system not to suspend the current thread.

#define FAPI_SYS_SUSPEND   0xFFFFFFFFUL

Advise the system to suspend the current thread.

#define FAPI_SYS_SemaphoreT   FAPEX_SYS_SemaphoreT
#define FAPI_SYS_CREATE_SEMAPHORE (   value )    FAPEX_SYS_CreateSemaphore(value)
#define FAPI_SYS_DESTROY_SEMAPHORE (   sem )    FAPEX_SYS_DestroySemaphore(sem)
#define FAPI_SYS_GET_SEMAPHORE (   sem,
  type 
)    FAPEX_SYS_GetSemaphore(sem, type)
#define FAPI_SYS_SET_SEMAPHORE (   sem,
  type 
)    FAPEX_SYS_SetSemaphore(sem, type)
#define FAPI_SYS_PRINT_MSG (   fmt,
  ... 
)    printf(fmt,##__VA_ARGS__)
#define FAPI_SYS_PRINT_DEBUG (   level,
  ... 
)
#define FAPEX_SYS_PRIORITY_LOWEST   1
#define FAPEX_SYS_PRIORITY_LOW   25
#define FAPEX_SYS_PRIORITY_MEDIUM   50
#define FAPEX_SYS_PRIORITY_HIGH   75
#define FAPEX_SYS_PRIORITY_HIGHEST   99
#define FAPI_SYS_PRINT_ERR (   fmt,
  err 
)
Value:
if(err == -1) {             \
                err = -errno;           \
            }                           \
            FAPI_SYS_PRINT_MSG(fmt,err);
#define FAPEX_TIMER_RESOLUTION_1_USEC   1UL

timer resolution 1 usec

#define FAPEX_TIMER_RESOLUTION_10_USEC   10UL

timer resolution 10 usec

#define FAPEX_TIMER_RESOLUTION_100_USEC   100UL

timer resolution 100 usec

#define FAPEX_TIMER_RESOLUTION_1_MSEC   1000UL

timer resolution 1 msec

#define FAPEX_TIMER_RESOLUTION_10_MSEC   10000UL

timer resolution 10 msec

#define FAPEX_TIMER_RESOLUTION_100_MSEC   100000UL

timer resolution 100 msec

#define FAPEX_TIMER_RESOLUTION_1_SEC   1000000UL

timer resolution 1 sec

#define FAPEX_TIMER_RESOLUTION_1_MIN   60000000UL

timer resolution 1 minute

#define FAPEX_TIMER_RESOLUTION_1_HOUR   3600000000UL

timer resolution 1 hour

#define FAPEX_SYS_SUSPEND   FAPI_SYS_SUSPEND

wrapper definitions for RTOS/Linux environment

#define FAPEX_SYS_NO_SUSPEND   FAPI_SYS_NO_SUSPEND
#define FAPEX_SYS_MSG_IS_POINTER   0xFFFFFFFFUL

the message to transport is a generic pointer only

#define FAPEX_SYS_EnterCritical (   status_reg )    status_reg=FAPEX_SYS_EnterCriticalSection()
#define FAPEX_SYS_LeaveCritical (   status_reg )    FAPEX_SYS_LeaveCriticalSection(status_reg)
#define FAPEX_SYS_FSEEK_SET   SEEK_SET
#define FAPEX_SYS_FSEEK_CUR   SEEK_CUR
#define FAPEX_SYS_FSEEK_END   SEEK_END
#define FAPEX_SYS_FFILE   FILE

refer to FILE structure.

#define FAPEX_SYS_FOpen   fopen

refer to fopen().

#define FAPEX_SYS_FClose   fclose

refer to fclose().

#define FAPEX_SYS_FSeek   fseek

refer to fseek().

#define FAPEX_SYS_FTell   ftell

refer to ftell().

#define FAPEX_SYS_FGetc   fgetc

refer to fgetc().

#define FAPEX_SYS_FPutc   fputc

refer to fputc().

#define FAPEX_SYS_FRewind   rewind

refer to rewind().

#define FAPEX_SYS_FEof   feof

refer to feof().

#define FAPEX_SYS_FRead   fread

refer to fread().

#define FAPEX_SYS_FWrite   fwrite

refer to fwrite().


Typedef Documentation

typedef sem_t* FAPEX_SYS_SemaphoreT
typedef void* FAPEX_SYS_HandleT
typedef void* FAPEX_SYS_MailboxT
typedef void(* FAPEX_SYS_ThreadFunctionT)(void *)
typedef void* FAPEX_SYS_ThreadT
typedef void* FAPEX_SYS_MailqueueT
typedef void* FAPEX_SYS_EventT
typedef int32_t FAPEXOPENRET_T
typedef int32_t FAPEXOPENARG1_T
typedef int32_t FAPEXOPENARG2_T
typedef void* FAPEXOPENARG3_T
typedef int32_t FAPEXRELRET_T
typedef int32_t FAPEXRELARG1_T
typedef int32_t FAPEXREADRET_T
typedef int32_t FAPEXREADARG1_T
typedef void* FAPEXREADARG2_T
typedef int32_t FAPEXREADARG3_T
typedef int32_t FAPEXWRTRET_T
typedef int32_t FAPEXWRTARG1_T
typedef const void* FAPEXWRTARG2_T
typedef int32_t FAPEXWRTARG3_T
typedef int32_t FAPEXIOCRET_T
typedef int32_t FAPEXIOCARG1_T
typedef uint32_t FAPEXIOCARG2_T
typedef uint32_t FAPEXIOCARG3_T
typedef void* FAPEXMMPRET_T
typedef int32_t FAPEXMUNMPRET_T
typedef void* FAPEXMMPARG1_T
typedef size_t FAPEXMMPARG2_T
typedef int32_t FAPEXMMPARG3_T
typedef int32_t FAPEXMMPARG4_T
typedef int32_t FAPEXMMPARG5_T
typedef off_t FAPEXMMPARG6_T
typedef fd_set FAPEX_SYS_SLCTSTAT_T
typedef struct timeval FAPEX_SYS_TIMEVAL_T

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   )
uint32_t FAPEX_SYS_InitKernel ( 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


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