20.2.9. Mail Queue

A mail queue is very similar to a message queue, but the information being transferred consists of memory blocks that need to be allocated before putting data in and need to be freed after taking data out (Figure 20.11). Memory blocks can hold more information, for example, a data structure, whereas a message queue can only transfer a 32-bit value or a pointer.
Mail queue object is defined using “osMailQDef(name, queue_size, type).” When referencing a mail queue using CMSIS-RTOS API, we need to use the “osMailQ(name)” macro. Each mail queue also has an ID value that is needed by some of the mail queue functions. Table 20.11 lists the CMSIS-RTOS functions for mail queue operations.
The following example shows how to use a mail ...

Get The Definitive Guide to ARM® Cortex®-M0 and Cortex-M0+ Processors, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.