Lee Shen / FTHR_USB_serial_qSPI
Embed: (wiki syntax)

« Back to documentation index

Mail< T, queue_sz > Class Template Reference

Mail< T, queue_sz > Class Template Reference
[Rtos]

The Mail class allow to control, send, receive, or wait for mail. More...

#include <Mail.h>

Inherits NonCopyable< Mail< T, queue_sz > >.

Public Member Functions

 Mail ()
 Create and Initialise Mail queue.
T * alloc (uint32_t millisec=0)
 Allocate a memory block of type T.
T * calloc (uint32_t millisec=0)
 Allocate a memory block of type T and set memory block to zero.
osStatus put (T *mptr)
 Put a mail in the queue.
osEvent get (uint32_t millisec=osWaitForever)
 Get a mail from a queue.
osStatus free (T *mptr)
 Free a memory block from a mail.

Detailed Description

template<typename T, uint32_t queue_sz>
class rtos::Mail< T, queue_sz >

The Mail class allow to control, send, receive, or wait for mail.

A mail is a memory block that is send to a thread or interrupt service routine.

Template Parameters:
Tdata type of a single message element.
queue_szmaximum number of messages in queue.
Note:
Memory considerations: The mail data store and control structures will be created on current thread's stack, both for the mbed OS and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).

Definition at line 52 of file Mail.h.


Constructor & Destructor Documentation

Mail (  )

Create and Initialise Mail queue.

Definition at line 55 of file Mail.h.