FreeRTOS Tetris
|
Group that contains macros & functions for creating queues. More...
Macros | |
#define | xQueueCreate(uxQueueLength, uxItemSize) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) ) |
#define | xQueueCreateStatic(uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) ) |
Functions | |
QueueHandle_t | xQueueGenericCreate (const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType) PRIVILEGED_FUNCTION |
QueueHandle_t | xQueueGenericCreateStatic (const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType) PRIVILEGED_FUNCTION |
Group that contains macros & functions for creating queues.
#define xQueueCreate | ( | uxQueueLength, | |
uxItemSize | |||
) | xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) ) |
#include <queue.h>
Creates a new queue instance, and returns a handle by which the new queue can be referenced.
Internally, within the FreeRTOS implementation, queues use two blocks of memory. The first block is used to hold the queue's data structures. The second block is used to hold items placed into the queue. If a queue is created using xQueueCreate() then both blocks of memory are automatically dynamically allocated inside the xQueueCreate() function. (see http://www.freertos.org/a00111.html). If a queue is created using xQueueCreateStatic() then the application writer must provide the memory that will get used by the queue. xQueueCreateStatic() therefore allows a queue to be created without using any dynamic memory allocation.
http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
uxQueueLength | The maximum number of items that the queue can contain. |
uxItemSize | The number of bytes each item in the queue will require. Items are queued by copy, not by reference, so this is the number of bytes that will be copied for each posted item. Each item on the queue must be the same size. |
Example usage:
#define xQueueCreateStatic | ( | uxQueueLength, | |
uxItemSize, | |||
pucQueueStorage, | |||
pxQueueBuffer | |||
) | xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) ) |
#include <queue.h>
Creates a new queue instance, and returns a handle by which the new queue can be referenced.
Internally, within the FreeRTOS implementation, queues use two blocks of memory. The first block is used to hold the queue's data structures. The second block is used to hold items placed into the queue. If a queue is created using xQueueCreate() then both blocks of memory are automatically dynamically allocated inside the xQueueCreate() function. (see http://www.freertos.org/a00111.html). If a queue is created using xQueueCreateStatic() then the application writer must provide the memory that will get used by the queue. xQueueCreateStatic() therefore allows a queue to be created without using any dynamic memory allocation.
http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
uxQueueLength | The maximum number of items that the queue can contain. |
uxItemSize | The number of bytes each item in the queue will require. Items are queued by copy, not by reference, so this is the number of bytes that will be copied for each posted item. Each item on the queue must be the same size. |
pucQueueStorageBuffer | If uxItemSize is not zero then pucQueueStorageBuffer must point to a uint8_t array that is at least large enough to hold the maximum number of items that can be in the queue at any one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is zero then pucQueueStorageBuffer can be NULL. |
pxQueueBuffer | Must point to a variable of type StaticQueue_t, which will be used to hold the queue's data structure. |
Example usage:
QueueHandle_t xQueueGenericCreate | ( | const UBaseType_t | uxQueueLength, |
const UBaseType_t | uxItemSize, | ||
const uint8_t | ucQueueType | ||
) |
#include <queue.h>
Generic version of the function used to create a queue using dynamic memory allocation. This is called by other functions and macros that create other RTOS objects that use the queue structure as their base.
QueueHandle_t xQueueGenericCreateStatic | ( | const UBaseType_t | uxQueueLength, |
const UBaseType_t | uxItemSize, | ||
uint8_t * | pucQueueStorage, | ||
StaticQueue_t * | pxStaticQueue, | ||
const uint8_t | ucQueueType | ||
) |
#include <queue.h>
Generic version of the function used to creaet a queue using dynamic memory allocation. This is called by other functions and macros that create other RTOS objects that use the queue structure as their base.