Defines | |
#define | MBX_CREATE(name, n, msg_size) |
Create a mailbox. | |
Functions | |
void | MBX_Init (HANDLE *ph) |
Mailbox initialisation function. | |
STATUS | MBX_Post (HANDLE *ph, void *pmsg, uint16 tout) |
Mailbox post function. | |
STATUS | MBX_Pend (HANDLE *ph, void *pmsg, uint16 tout) |
Mailbox pend function. | |
void | MBX_Flush (HANDLE *ph) |
Mailbox flush function. |
|
Create a mailbox. This macro creates and partialy initilises the mailbox control structure. It also allocates the needed message buffers.
|
|
Mailbox flush function. Flush a mailbox and unblock all pending tasks that were waiting for free message containers. SYS_ERROR is passed to the task.
|
|
Mailbox initialisation function. A mailbox must be initialised before its usage. Calling this function initialises the mailbox.
|
|
Mailbox pend function. Only tasks can pend on mailboxes. If a mailbox is not empty the message is returned to the caller and the system call returns with SYS_OK. When there is no message the task is pending and SYS_ERROR is returned. If the caller specifed a timeout value a timer is started and the task is delayed from execution. After the timeout expires (no task or interrupt posted a message) the task is unblocked and SYS_MBX_TOUT is passed to the task's entry parameter. If somebody posted a message the timer is removed and the SYS_MBX values is passed to the task.
|
|
Mailbox post function.
A mailbox can be post from an interrupt ISR or from a task. When posted from a task a timeout value can be specified.
|