CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

mbox.c File Reference

mbox.c File Reference

Mailbox management implementation code of CooCox CoOS kernel. More...

Go to the source code of this file.

Functions

OS_EventID CoCreateMbox (U8 sortType)
 Create a mailbox.
StatusType CoDelMbox (OS_EventID id, U8 opt)
 Delete a mailbox.
void * CoAcceptMail (OS_EventID id, StatusType *perr)
 Accept a mailbox.
void * CoPendMail (OS_EventID id, U32 timeout, StatusType *perr)
 Wait for a mailbox.
StatusType CoPostMail (OS_EventID id, void *pmail)
 Post a mailbox.
StatusType isr_PostMail (OS_EventID id, void *pmail)
 Post a mailbox in ISR.

Detailed Description

Mailbox management implementation code of CooCox CoOS kernel.

Version:
V1.1.4
Date:
2011.04.20

INTERNAL FILE,DON'T PUBLIC.

© COPYRIGHT 2009 CooCox

Definition in file mbox.c.


Function Documentation

void* CoAcceptMail ( OS_EventID  id,
StatusType *  perr 
)

Accept a mailbox.

Parameters:
[in]idEvent ID.
[out]perrA pointer to error code.
Return values:
Co_NULL
Apointer to mailbox accepted.
Description

This function is called to accept a mailbox.

Note:

Definition at line 103 of file mbox.c.

OS_EventID CoCreateMbox ( U8  sortType )

Create a mailbox.

Parameters:
[in]sortTypeMail box waiting list sort type.
[out]None
Return values:
E_CREATE_FAILCreate mailbox fail.
othersCreate mailbox successful.
Description

This function is called to create a mailbox.

Note:

Definition at line 36 of file mbox.c.

StatusType CoDelMbox ( OS_EventID  id,
U8  opt 
)

Delete a mailbox.

Parameters:
[in]idEvent ID.
[in]optDelete option.
[out]None
Return values:
E_INVALID_IDInvalid event ID.
E_INVALID_PARAMETERInvalid parameter.
E_TASK_WAITTINGTasks waitting for the event,delete fail.
E_OKEvent deleted successful.
Description

This function is called to delete a mailbox.

Note:

Definition at line 68 of file mbox.c.

void* CoPendMail ( OS_EventID  id,
U32  timeout,
StatusType *  perr 
)

Wait for a mailbox.

Parameters:
[in]idEvent ID.
[in]timeoutThe longest time for writting mail.
[out]perrA pointer to error code.
Return values:
Co_NULL
Apointer to mailbox accept.
Description

This function is called to wait a mailbox.

Note:

Definition at line 157 of file mbox.c.

StatusType CoPostMail ( OS_EventID  id,
void *  pmail 
)

Post a mailbox.

Parameters:
[in]idEvent ID.
[in]pmailPointer to mail that want to send.
[out]None
Return values:
E_INVALID_ID
E_OK
Description

This function is called to post a mail.

Note:

Definition at line 254 of file mbox.c.

StatusType isr_PostMail ( OS_EventID  id,
void *  pmail 
)

Post a mailbox in ISR.

Parameters:
[in]idEvent ID.
[in]pmailPointer to mail that want to send.
[out]None
Return values:
E_INVALID_ID
E_OK
Description

This function is called to post a mail in ISR.

Note:

Definition at line 302 of file mbox.c.