O'Reilly logo

The Definitive Guide to ARM® Cortex®-M0 and Cortex-M0+ Processors, 2nd Edition by Joseph Yiu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required