ESOS32
ESOSOn32-bitProcessors
|
Files | |
file | esos_mail.h |
Data Structures | |
struct | __stMAILBOX |
struct | __stMAILMESSAGE |
Macros | |
#define | __MAIL_MSG_MAX_DATA_LEN 16 |
#define | ESOS_MAILMESSAGE_STRING 0x0 |
#define | ESOS_MAILMESSAGE_UINT8 0x1 |
#define | ESOS_MAILMESSAGE_UINT16 0x2 |
#define | ESOS_MAILMESSAGE_UINT32 0x4 |
#define | ESOS_MAILMESSAGE_REQUEST_ACK 0x8 |
#define | __MAIL_MSG_HEADER_LEN (1+2+1+4) |
#define | __MAIL_MSG_MAX_LEN (__MAIL_MSG_HEADER_LEN+__MAIL_MSG_MAX_DATA_LEN) |
#define | MAX_SIZE_TASK_MAILBOX 5*__MAIL_MSG_MAX_LEN |
#define | ESOS_TASK_HAS_MAIL(pstTask) |
#define | ESOS_TASK_IS_WAITING_MAIL_DELIVERY(TaskHandle) |
#define | ESOS_TASK_IVE_GOT_MAIL() |
#define | ESOS_TASK_WAIT_FOR_MAIL() |
#define | ESOS_TASK_WAIT_ON_TASKS_MAILBOX_HAS_AT_LEAST(pstTask, x) |
#define | ESOS_TASK_WAIT_ON_TASKS_MAILBOX_HAS_ROOM_MESSAGE(pstTask, pstMsg) |
#define | ESOS_TASK_MAILBOX_GET_AVAILABLE_LEN(pstTask) |
#define | ESOS_TASK_MAILBOX_GOT_EXACTLY_DATA_BYTES(pstTask, x) |
#define | ESOS_TASK_MAILBOX_GOT_AT_LEAST_DATA_BYTES(pstTask, x) |
#define | ESOS_TASK_FLUSH_TASK_MAILBOX(pstTask) |
#define | ESOS_TASK_SEND_MESSAGE(pst_ToTask, pst_Msg) __esos_SendMailMessage((pst_ToTask),(pst_Msg)) |
#define | ESOS_TASK_SEND_MESSAGE_WAIT_DELIVERY(pst_ToTask, pstMsg) ESOS_TASK_WAIT_ON_DELIVERY((pst_ToTask), (pstMsg)) |
#define | ESOS_TASK_WAIT_ON_DELIVERY(pst_ToTask, pstMsg) |
#define | ESOS_TASK_GET_NEXT_MESSAGE(pst_Msg) __esos_ReadMailMessage(__pstSelf, (pst_Msg)) |
#define | ESOS_TASK_GET_LAST_MESSAGE(pst_Msg) |
#define | ESOS_IS_TASK_SENDER(hTask, stMsg) (hTask->u16_taskID==stMsg.u16_FromTaskID) |
#define | ESOS_SET_MSG_FLAGS(stMsg, flags) stMsg.u8_flags=(flags) |
#define | ESOS_SET_MSG_FROMTASK(stMsg, pstFromTask) stMsg.u16_FromTaskID=pstFromTask->u16_taskID |
#define | ESOS_SET_MSG_DATA_LENGTH(stMsg, len) stMsg.u8_DataLength=(len) |
#define | ESOS_GET_MSG_FLAGS(stMsg) (stMsg.u8_flags) |
#define | ESOS_GET_MSG_FROMTASK(stMsg) (stMsg.u16_FromTaskID) |
#define | ESOS_GET_MSG_DATA_LENGTH(stMsg) (stMsg.u8_DataLength) |
#define | ESOS_GET_MSG_POSTMARK(stMsg) (stMsg.u32_Postmark) |
#define | ESOS_SET_PMSG_FLAGS(pstMsg, flags) pstMsg->u8_flags=(flags) |
#define | ESOS_SET_PMSG_FROMTASK(pstMsg, pstFromTask) pstMsg->u16_FromTaskID=pstFromTask->u16_taskID |
#define | ESOS_SET_PMSG_DATA_LENGTH(pstMsg, len) pstMsg->u8_DataLength=(len) |
#define | ESOS_GET_PMSG_FLAGS(pstMsg) (pstMsg->u8_flags) |
#define | ESOS_GET_PMSG_FROMTASK(pstMsg) (pstMsg->u16_FromTaskID) |
#define | ESOS_GET_PMSG_DATA_LENGTH(pstMsg) (pstMsg->u8_DataLength) |
#define | ESOS_GET_PMSG_POSTMARK(pstMsg) (pstMsg->u32_Postmark) |
#define | ESOS_TASK_MAKE_MSG_EMPTY(stMsg) |
#define | ESOS_TASK_MAKE_MSG_UINT8(stMsg, u8x) |
#define | ESOS_TASK_MAKE_MSG_UINT8_X2(stMsg, u8x0, u8x1) |
#define | ESOS_TASK_MAKE_MSG_UINT8_X3(stMsg, u8x0, u8x1, u8x2) |
#define | ESOS_TASK_MAKE_MSG_UINT8_X4(stMsg, u8x0, u8x1, u8x2, u8x3) |
#define | ESOS_TASK_MAKE_MSG_AUINT8(stMsg, pau8x, len) |
#define | ESOS_TASK_MAKE_MSG_UINT16(stMsg, u16x) |
#define | ESOS_TASK_MAKE_MSG_UINT16_X2(stMsg, u16x0, u16x1) |
#define | ESOS_TASK_MAKE_MSG_UINT16_X3(stMsg, u16x0, u16x1, u16x2) |
#define | ESOS_TASK_MAKE_MSG_UINT16_X4(stMsg, u16x0, u16x1, u16x2, u16x3) |
#define | ESOS_TASK_MAKE_MSG_UINT32(stMsg, u32x) |
#define | ESOS_TASK_MAKE_MSG_UINT32_X2(stMsg, u32x0, u32x1) |
#define | PRINTF_MESSAGE(stMsg) |
#define | __esos_WriteMailboxUINT8(pstMB, u8x) __esos_CB_WriteUINT8((pstMB)->pst_CBuffer, (u8x) ) |
#define | __esos_ReadMailboxUINT8(pstMB, u8x) __esos_CB_ReadUINT8((pstMB)->pst_CBuffer ) |
Typedefs | |
typedef struct __stMAILBOX | MAILBOX |
typedef struct __stMAILMESSAGE | MAILMESSAGE |
Functions | |
void | __esos_InitMailbox (MAILBOX *pst_Mailbox, uint8_t *pau8_ptr) |
void | __esos_SendMailUint8 (struct stTask *pst_Task, MAILBOX *pst_Mailbox, uint8_t *pau8_data, uint8_t u8_len) |
void | __esos_ReadMailMessage (struct stTask *pst_Task, MAILMESSAGE *pst_Message) |
void | __esos_SendMailMessage (struct stTask *pst_RcvrTask, MAILMESSAGE *pst_Msg) |
Variables | |
MAILBOX | __astMailbox [MAX_NUM_USER_TASKS] |
uint8_t | __au8_MBData [MAX_NUM_USER_TASKS][MAX_SIZE_TASK_MAILBOX] |
uint8_t | __u8_esos_mail_routines_dummy_uint8 |
#define __MAIL_MSG_MAX_DATA_LEN 16 |
structure to contain a mail message "envelope" – a set of descriptors about a mail message and the contents within
Definition at line 78 of file esos_mail.h.
#define ESOS_TASK_FLUSH_TASK_MAILBOX | ( | pstTask | ) |
Flushes the specified task's mailbox contents. All unread data in the mailbox will be lost.
pstTask | pointer to task structure (ESOS_TASK_HANDLE) whose mailbox will be flushed |
Definition at line 228 of file esos_mail.h.
#define ESOS_TASK_GET_LAST_MESSAGE | ( | pst_Msg | ) |
Definition at line 244 of file esos_mail.h.
#define ESOS_TASK_HAS_MAIL | ( | pstTask | ) |
Determines if a task has mail ready to be read/consumed.
pstTask | A pointer to the ESOS_TASK_HANDLE of the task being queried |
Definition at line 117 of file esos_mail.h.
#define ESOS_TASK_IS_WAITING_MAIL_DELIVERY | ( | TaskHandle | ) |
Determines if a task is waiting on an acknowledgment from another task reading its mail... a.k.a. "signature confirmation" or "delivery confirmation"
TaskHandle | The ESOS_TASK_HANDLE of the task being queried |
Definition at line 127 of file esos_mail.h.
#define ESOS_TASK_IVE_GOT_MAIL | ( | ) |
Determines if the current task has mail to be read
Returns TRUE if the current task has mail ready to be read. else it returns FALSE.
Definition at line 139 of file esos_mail.h.
#define ESOS_TASK_MAILBOX_GET_AVAILABLE_LEN | ( | pstTask | ) |
Evaluates to the number of bytes available in the mailbox association with an arbitrary task pstTask
pstTask | pointer to task structure |
N | number of bytes available for writing in task's mailbox |
Definition at line 189 of file esos_mail.h.
#define ESOS_TASK_MAILBOX_GOT_AT_LEAST_DATA_BYTES | ( | pstTask, | |
x | |||
) |
Evaluates to the booelan to determine if the specified task's mailbox has at least x bytes available for holding messages
pstTask | pointer to task structure (ESOS_TASK_HANDLE) |
x | number of bytes to check for |
TRUE | if task's mailbox has x bytes or more |
FALSE | otherwise |
Definition at line 214 of file esos_mail.h.
#define ESOS_TASK_MAILBOX_GOT_EXACTLY_DATA_BYTES | ( | pstTask, | |
x | |||
) |
Evaluates to the booelan to determine if the specified task's mailbox has exactly x bytes available for holding messages
pstTask | pointer to task structure (ESOS_TASK_HANDLE) |
x | number of bytes to check for |
TRUE | if task's mailbox has exactly x bytes |
FALSE | otherwise |
Definition at line 201 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_AUINT8 | ( | stMsg, | |
pau8x, | |||
len | |||
) |
Definition at line 317 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_EMPTY | ( | stMsg | ) |
Definition at line 272 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT16 | ( | stMsg, | |
u16x | |||
) |
Definition at line 327 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT16_X2 | ( | stMsg, | |
u16x0, | |||
u16x1 | |||
) |
Definition at line 335 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT16_X3 | ( | stMsg, | |
u16x0, | |||
u16x1, | |||
u16x2 | |||
) |
Definition at line 344 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT16_X4 | ( | stMsg, | |
u16x0, | |||
u16x1, | |||
u16x2, | |||
u16x3 | |||
) |
Definition at line 354 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT32 | ( | stMsg, | |
u32x | |||
) |
Definition at line 365 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT32_X2 | ( | stMsg, | |
u32x0, | |||
u32x1 | |||
) |
Definition at line 373 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT8 | ( | stMsg, | |
u8x | |||
) |
Definition at line 279 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT8_X2 | ( | stMsg, | |
u8x0, | |||
u8x1 | |||
) |
Definition at line 287 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT8_X3 | ( | stMsg, | |
u8x0, | |||
u8x1, | |||
u8x2 | |||
) |
Definition at line 296 of file esos_mail.h.
#define ESOS_TASK_MAKE_MSG_UINT8_X4 | ( | stMsg, | |
u8x0, | |||
u8x1, | |||
u8x2, | |||
u8x3 | |||
) |
Definition at line 306 of file esos_mail.h.
#define ESOS_TASK_WAIT_FOR_MAIL | ( | ) |
Blocks the current task until a mailbox message has arrived
This function blocks and waits until the task has a message in its mailbox.
Definition at line 148 of file esos_mail.h.
#define ESOS_TASK_WAIT_ON_DELIVERY | ( | pst_ToTask, | |
pstMsg | |||
) |
Definition at line 234 of file esos_mail.h.
#define ESOS_TASK_WAIT_ON_TASKS_MAILBOX_HAS_AT_LEAST | ( | pstTask, | |
x | |||
) |
Block current task until the specified task's mailbox has at least x bytes available for holding messages
pstTask | pointer to task structure (ESOS_TASK_HANDLE) |
x | number of bytes to check for |
TRUE | if task's mailbox has x bytes or more |
FALSE | otherwise |
Definition at line 162 of file esos_mail.h.
#define ESOS_TASK_WAIT_ON_TASKS_MAILBOX_HAS_ROOM_MESSAGE | ( | pstTask, | |
pstMsg | |||
) |
Block the current task until the specified recipient task mailbox has room for the specified message
pstTask | pointer to task structure (ESOS_TASK_HANDLE) |
pstMsg | message for which room must be found |
TRUE | if task's mailbox has x bytes or more; |
FALSE | otherwise |
Definition at line 178 of file esos_mail.h.
#define PRINTF_MESSAGE | ( | stMsg | ) |
Definition at line 383 of file esos_mail.h.
typedef struct __stMAILBOX MAILBOX |
structure to contain a set of descriptors about the buffers used to implement ESOS task mailboxes
void __esos_SendMailUint8 | ( | struct stTask * | pst_Task, |
MAILBOX * | pst_Mailbox, | ||
uint8_t * | pau8_data, | ||
uint8_t | u8_len | ||
) |
Writes a mail message into some task's mailbox
pst_Task | handle tretval verNum Version number. Exact value and meaning depends on hardware |
pst_Mailbox | Pointer to struct instance of MAILBOX. |
pau8_data | Pointer to mail data to send. |
u8_len | Local instance of length of message. |