EFOS APIs

EFOS API(Application Program Interface) is simple to understand and easy to use. Given below is the API list of standard EFOS modules.

TASK APIs

/* Create a task with specified attributes */
TASK_Handle TASK_create(TASK_Attrs *taskAttrs);

/* Return the pointer to itself */
TASK_Handle TASK_self();

/* Disable the Task Scheduling */
void TASK_disable();

/* Enable the Task Scheduling */
void TASK_enable();

/* yield to the equal priority tasks */
void TASK_yield();

/* Set the priority of the task */
Int TASK_setPriority(TASK_Handle taskHandle, Int priority);

/* Suspend the given task handle */
Int TASK_suspend(TASK_Handle taskHandle);

/* Resume the given task handle */
Int TASK_resume(TASK_Handle taskHandle);

/* Delete the task with specified handle */
Int TASK_delete(TASK_Handle taskHandle);


SEMA APIs

/* Create a Semaphore */
SEMA_Handle SEMA_create ( SEMA_Attrs *semaAttrs );

/* Give a Resource */
Int SEMA_give(SEMA_Handle semaHandle);

/* Give the Resource from ISR */
Int SEMA_iGive(SEMA_Handle semaHandle);

/* Take a Resource */
Int SEMA_take(SEMA_Handle semaHandle, Int timeOut);

/* Get the current count value of semaphore */
Int SEMA_count(SEMA_Handle semaHandle);

/* Delete a Semaphore */
Int SEMA_delete(SEMA_Handle semaHandle);

INT APIs

/* Disable Interrupts */
Int INT_disable();

/* Enable Interrupts */
void INT_enable();

/* Restore the old state */
void INT_restore(Int oldState);

/* Hook a function to the specified interrupt number */
Int INT_intHook(Int intNumber, INT_intFxn fxn, void *intObj);


PIPE APIs

/* Create the Pipe with specified attributes */
PIPE_Handle PIPE_create(PIPE_Attrs *pipeAttrs);

/* Read the data from the Pipe */
UInt PIPE_read(PIPE_Handle pipeHandle, void *ptr, UInt length);

/* Write the data to the Pipe */
UInt PIPE_write(PIPE_Handle pipeHandle, void *ptr, Int length);

/* For controlling the attributes of the PIPE. */
Int PIPE_ctrl(PIPE_Handle pipeHandle, Int cmd, void *arg);

/* Get the size of the free area in bytes(macro) */
PIPE_getFreeBytesCount(pipeHandle)

/* Get the size of the data available in bytes(macro) */
PIPE_getBytesAvailable(pipeHandle)

/* Close the pipe */
Int PIPE_close(PIPE_Handle pipeHandle);


MSG APIs

/* Create a new message object with specified attributes */
MSG_Handle MSG_create(MSG_Attrs *attrs);

/* Check whether any messages are available in the message queue(macro) */
MSG_isMsgAvailable(msgHandle)

/* Check whether the message queue is full (-Or-) not(macro) */
MSG_isMsgFull(msgHandle)

/* Control the attributes of the message queue */
Int MSG_ctrl(MSG_Handle msgHandle, Int cmd, void *arg);

/* Read a message onto the pointer from the message queue */
Int MSG_read(MSG_Handle msgHandle, void *ptr);

/* Write a message from the pointer to the message queue */
Int MSG_write(MSG_Handle msgHandle, void *ptr);

/* Delete the message handle */
Int
MSG_close(MSG_Handle msgHandle);