firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
queue.c File Reference
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
Include dependency graph for queue.c:

Data Structures

struct  QueuePointers
struct  SemaphoreData
struct  QueueDefinition

Macros

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define queueUNLOCKED   ( ( int8_t ) -1 )
#define queueLOCKED_UNMODIFIED   ( ( int8_t ) 0 )
#define queueINT8_MAX   ( ( int8_t ) 127 )
#define uxQueueType   pcHead
#define queueQUEUE_IS_MUTEX   NULL
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH   ( ( UBaseType_t ) 0 )
#define queueMUTEX_GIVE_BLOCK_TIME   ( ( TickType_t ) 0U )
#define queueYIELD_IF_USING_PREEMPTION()
#define prvLockQueue(pxQueue)
#define prvIncrementQueueTxLock(pxQueue, cTxLock)
#define prvIncrementQueueRxLock(pxQueue, cRxLock)

Typedefs

typedef struct QueuePointers QueuePointers_t
typedef struct SemaphoreData SemaphoreData_t
typedef struct QueueDefinition xQUEUE
typedef xQUEUE Queue_t

Functions

static void prvUnlockQueue (Queue_t *const pxQueue) PRIVILEGED_FUNCTION
static BaseType_t prvIsQueueEmpty (const Queue_t *pxQueue) PRIVILEGED_FUNCTION
static BaseType_t prvIsQueueFull (const Queue_t *pxQueue) PRIVILEGED_FUNCTION
static BaseType_t prvCopyDataToQueue (Queue_t *const pxQueue, const void *pvItemToQueue, const BaseType_t xPosition) PRIVILEGED_FUNCTION
static void prvCopyDataFromQueue (Queue_t *const pxQueue, void *const pvBuffer) PRIVILEGED_FUNCTION
static void prvInitialiseNewQueue (const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, const uint8_t ucQueueType, Queue_t *pxNewQueue) PRIVILEGED_FUNCTION
BaseType_t xQueueGenericReset (QueueHandle_t xQueue, BaseType_t xNewQueue)
BaseType_t xQueueGenericSend (QueueHandle_t xQueue, const void *const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition)
BaseType_t xQueueGenericSendFromISR (QueueHandle_t xQueue, const void *const pvItemToQueue, BaseType_t *const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition)
BaseType_t xQueueGiveFromISR (QueueHandle_t xQueue, BaseType_t *const pxHigherPriorityTaskWoken)
BaseType_t xQueueReceive (QueueHandle_t xQueue, void *const pvBuffer, TickType_t xTicksToWait)
BaseType_t xQueueSemaphoreTake (QueueHandle_t xQueue, TickType_t xTicksToWait)
BaseType_t xQueuePeek (QueueHandle_t xQueue, void *const pvBuffer, TickType_t xTicksToWait)
BaseType_t xQueueReceiveFromISR (QueueHandle_t xQueue, void *const pvBuffer, BaseType_t *const pxHigherPriorityTaskWoken)
BaseType_t xQueuePeekFromISR (QueueHandle_t xQueue, void *const pvBuffer)
UBaseType_t uxQueueMessagesWaiting (const QueueHandle_t xQueue)
UBaseType_t uxQueueSpacesAvailable (const QueueHandle_t xQueue)
UBaseType_t uxQueueMessagesWaitingFromISR (const QueueHandle_t xQueue)
void vQueueDelete (QueueHandle_t xQueue)
UBaseType_t uxQueueGetQueueItemSize (QueueHandle_t xQueue)
UBaseType_t uxQueueGetQueueLength (QueueHandle_t xQueue)
BaseType_t xQueueIsQueueEmptyFromISR (const QueueHandle_t xQueue)
BaseType_t xQueueIsQueueFullFromISR (const QueueHandle_t xQueue)

Macro Definition Documentation

◆ MPU_WRAPPERS_INCLUDED_FROM_API_FILE

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE

◆ prvIncrementQueueRxLock

#define prvIncrementQueueRxLock ( pxQueue,
cRxLock )
Value:
do { \
const UBaseType_t uxNumberOfTasks = uxTaskGetNumberOfTasks(); \
if( ( UBaseType_t ) ( cRxLock ) < uxNumberOfTasks ) \
{ \
configASSERT( ( cRxLock ) != queueINT8_MAX ); \
( pxQueue )->cRxLock = ( int8_t ) ( ( cRxLock ) + ( int8_t ) 1 ); \
} \
} while( 0 )
unsigned long UBaseType_t
Definition portmacro.h:60
#define queueINT8_MAX
Definition queue.c:54
UBaseType_t uxTaskGetNumberOfTasks(void)
Definition tasks.c:4160

◆ prvIncrementQueueTxLock

#define prvIncrementQueueTxLock ( pxQueue,
cTxLock )
Value:
do { \
const UBaseType_t uxNumberOfTasks = uxTaskGetNumberOfTasks(); \
if( ( UBaseType_t ) ( cTxLock ) < uxNumberOfTasks ) \
{ \
configASSERT( ( cTxLock ) != queueINT8_MAX ); \
( pxQueue )->cTxLock = ( int8_t ) ( ( cTxLock ) + ( int8_t ) 1 ); \
} \
} while( 0 )

◆ prvLockQueue

#define prvLockQueue ( pxQueue)
Value:
{ \
if( ( pxQueue )->cRxLock == queueUNLOCKED ) \
{ \
( pxQueue )->cRxLock = queueLOCKED_UNMODIFIED; \
} \
if( ( pxQueue )->cTxLock == queueUNLOCKED ) \
{ \
( pxQueue )->cTxLock = queueLOCKED_UNMODIFIED; \
} \
} \
taskEXIT_CRITICAL()
#define queueLOCKED_UNMODIFIED
Definition queue.c:53
#define queueUNLOCKED
Definition queue.c:52
#define taskENTER_CRITICAL()
Definition task.h:227

◆ queueINT8_MAX

#define queueINT8_MAX   ( ( int8_t ) 127 )

◆ queueLOCKED_UNMODIFIED

#define queueLOCKED_UNMODIFIED   ( ( int8_t ) 0 )

◆ queueMUTEX_GIVE_BLOCK_TIME

#define queueMUTEX_GIVE_BLOCK_TIME   ( ( TickType_t ) 0U )

◆ queueQUEUE_IS_MUTEX

#define queueQUEUE_IS_MUTEX   NULL

◆ queueSEMAPHORE_QUEUE_ITEM_LENGTH

#define queueSEMAPHORE_QUEUE_ITEM_LENGTH   ( ( UBaseType_t ) 0 )

◆ queueUNLOCKED

#define queueUNLOCKED   ( ( int8_t ) -1 )

◆ queueYIELD_IF_USING_PREEMPTION

#define queueYIELD_IF_USING_PREEMPTION ( )

◆ uxQueueType

#define uxQueueType   pcHead

Typedef Documentation

◆ Queue_t

typedef xQUEUE Queue_t

◆ QueuePointers_t

◆ SemaphoreData_t

◆ xQUEUE

typedef struct QueueDefinition xQUEUE

Function Documentation

◆ prvCopyDataFromQueue()

void prvCopyDataFromQueue ( Queue_t *const pxQueue,
void *const pvBuffer )
static
Here is the caller graph for this function:

◆ prvCopyDataToQueue()

BaseType_t prvCopyDataToQueue ( Queue_t *const pxQueue,
const void * pvItemToQueue,
const BaseType_t xPosition )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prvInitialiseNewQueue()

void prvInitialiseNewQueue ( const UBaseType_t uxQueueLength,
const UBaseType_t uxItemSize,
uint8_t * pucQueueStorage,
const uint8_t ucQueueType,
Queue_t * pxNewQueue )
static
Here is the call graph for this function:

◆ prvIsQueueEmpty()

BaseType_t prvIsQueueEmpty ( const Queue_t * pxQueue)
static
Here is the caller graph for this function:

◆ prvIsQueueFull()

BaseType_t prvIsQueueFull ( const Queue_t * pxQueue)
static
Here is the caller graph for this function:

◆ prvUnlockQueue()

void prvUnlockQueue ( Queue_t *const pxQueue)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uxQueueGetQueueItemSize()

UBaseType_t uxQueueGetQueueItemSize ( QueueHandle_t xQueue)

◆ uxQueueGetQueueLength()

UBaseType_t uxQueueGetQueueLength ( QueueHandle_t xQueue)

◆ uxQueueMessagesWaiting()

UBaseType_t uxQueueMessagesWaiting ( const QueueHandle_t xQueue)

◆ uxQueueMessagesWaitingFromISR()

UBaseType_t uxQueueMessagesWaitingFromISR ( const QueueHandle_t xQueue)

◆ uxQueueSpacesAvailable()

UBaseType_t uxQueueSpacesAvailable ( const QueueHandle_t xQueue)

◆ vQueueDelete()

void vQueueDelete ( QueueHandle_t xQueue)
Here is the call graph for this function:

◆ xQueueGenericReset()

BaseType_t xQueueGenericReset ( QueueHandle_t xQueue,
BaseType_t xNewQueue )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xQueueGenericSend()

BaseType_t xQueueGenericSend ( QueueHandle_t xQueue,
const void *const pvItemToQueue,
TickType_t xTicksToWait,
const BaseType_t xCopyPosition )
Here is the call graph for this function:

◆ xQueueGenericSendFromISR()

BaseType_t xQueueGenericSendFromISR ( QueueHandle_t xQueue,
const void *const pvItemToQueue,
BaseType_t *const pxHigherPriorityTaskWoken,
const BaseType_t xCopyPosition )
Here is the call graph for this function:

◆ xQueueGiveFromISR()

BaseType_t xQueueGiveFromISR ( QueueHandle_t xQueue,
BaseType_t *const pxHigherPriorityTaskWoken )
Here is the call graph for this function:

◆ xQueueIsQueueEmptyFromISR()

BaseType_t xQueueIsQueueEmptyFromISR ( const QueueHandle_t xQueue)

◆ xQueueIsQueueFullFromISR()

BaseType_t xQueueIsQueueFullFromISR ( const QueueHandle_t xQueue)

◆ xQueuePeek()

BaseType_t xQueuePeek ( QueueHandle_t xQueue,
void *const pvBuffer,
TickType_t xTicksToWait )
Here is the call graph for this function:

◆ xQueuePeekFromISR()

BaseType_t xQueuePeekFromISR ( QueueHandle_t xQueue,
void *const pvBuffer )
Here is the call graph for this function:

◆ xQueueReceive()

BaseType_t xQueueReceive ( QueueHandle_t xQueue,
void *const pvBuffer,
TickType_t xTicksToWait )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xQueueReceiveFromISR()

BaseType_t xQueueReceiveFromISR ( QueueHandle_t xQueue,
void *const pvBuffer,
BaseType_t *const pxHigherPriorityTaskWoken )
Here is the call graph for this function:

◆ xQueueSemaphoreTake()

BaseType_t xQueueSemaphoreTake ( QueueHandle_t xQueue,
TickType_t xTicksToWait )
Here is the call graph for this function: