Macros | Typedefs
semphr.h File Reference
#include "queue.h"
Include dependency graph for semphr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define semBINARY_SEMAPHORE_QUEUE_LENGTH   ( ( uint8_t ) 1U )
 
#define semGIVE_BLOCK_TIME   ( ( TickType_t ) 0U )
 
#define semSEMAPHORE_QUEUE_ITEM_LENGTH   ( ( uint8_t ) 0U )
 
#define uxSemaphoreGetCount(xSemaphore)   uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
 
#define vSemaphoreDelete(xSemaphore)   vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )
 
#define xSemaphoreGetMutexHolder(xSemaphore)   xQueueGetMutexHolder( ( xSemaphore ) )
 
#define xSemaphoreGetMutexHolderFromISR(xSemaphore)   xQueueGetMutexHolderFromISR( ( xSemaphore ) )
 
#define xSemaphoreGive(xSemaphore)   xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )
 
#define xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken)   xQueueGiveFromISR( ( QueueHandle_t ) ( xSemaphore ), ( pxHigherPriorityTaskWoken ) )
 
#define xSemaphoreTake(xSemaphore, xBlockTime)   xQueueSemaphoreTake( ( xSemaphore ), ( xBlockTime ) )
 
#define xSemaphoreTakeFromISR(xSemaphore, pxHigherPriorityTaskWoken)   xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )
 

Typedefs

typedef QueueHandle_t SemaphoreHandle_t
 

Macro Definition Documentation

◆ semBINARY_SEMAPHORE_QUEUE_LENGTH

#define semBINARY_SEMAPHORE_QUEUE_LENGTH   ( ( uint8_t ) 1U )

Definition at line 40 of file semphr.h.

◆ semGIVE_BLOCK_TIME

#define semGIVE_BLOCK_TIME   ( ( TickType_t ) 0U )

Definition at line 42 of file semphr.h.

◆ semSEMAPHORE_QUEUE_ITEM_LENGTH

#define semSEMAPHORE_QUEUE_ITEM_LENGTH   ( ( uint8_t ) 0U )

Definition at line 41 of file semphr.h.

◆ uxSemaphoreGetCount

#define uxSemaphoreGetCount (   xSemaphore)    uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )

semphr.h

UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );

If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns its current count value. If the semaphore is a binary semaphore then uxSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the semaphore is not available.

Definition at line 1137 of file semphr.h.

◆ vSemaphoreDelete

#define vSemaphoreDelete (   xSemaphore)    vQueueDelete( ( QueueHandle_t ) ( xSemaphore ) )

Definition at line 1099 of file semphr.h.

◆ xSemaphoreGetMutexHolder

#define xSemaphoreGetMutexHolder (   xSemaphore)    xQueueGetMutexHolder( ( xSemaphore ) )

semphr.h

TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );

If xMutex is indeed a mutex type semaphore, return the current mutex holder. If xMutex is not a mutex type semaphore, or the mutex is available (not held by a task), return NULL.

Note: This is a good way of determining if the calling task is the mutex holder, but not a good way of determining the identity of the mutex holder as the holder may change between the function exiting and the returned value being tested.

Definition at line 1114 of file semphr.h.

◆ xSemaphoreGetMutexHolderFromISR

#define xSemaphoreGetMutexHolderFromISR (   xSemaphore)    xQueueGetMutexHolderFromISR( ( xSemaphore ) )

semphr.h

TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );

If xMutex is indeed a mutex type semaphore, return the current mutex holder. If xMutex is not a mutex type semaphore, or the mutex is available (not held by a task), return NULL.

Definition at line 1125 of file semphr.h.

◆ xSemaphoreGive

#define xSemaphoreGive (   xSemaphore)    xQueueGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )

Definition at line 448 of file semphr.h.

◆ xSemaphoreGiveFromISR

#define xSemaphoreGiveFromISR (   xSemaphore,
  pxHigherPriorityTaskWoken 
)    xQueueGiveFromISR( ( QueueHandle_t ) ( xSemaphore ), ( pxHigherPriorityTaskWoken ) )

Definition at line 625 of file semphr.h.

◆ xSemaphoreTake

#define xSemaphoreTake (   xSemaphore,
  xBlockTime 
)    xQueueSemaphoreTake( ( xSemaphore ), ( xBlockTime ) )

Definition at line 290 of file semphr.h.

◆ xSemaphoreTakeFromISR

#define xSemaphoreTakeFromISR (   xSemaphore,
  pxHigherPriorityTaskWoken 
)    xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )

semphr. h

xSemaphoreTakeFromISR(
                         SemaphoreHandle_t xSemaphore,
                         BaseType_t *pxHigherPriorityTaskWoken
                     )

Macro to take a semaphore from an ISR. The semaphore must have previously been created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting().

Mutex type semaphores (those created using a call to xSemaphoreCreateMutex()) must not be used with this macro.

This macro can be used from an ISR, however taking a semaphore from an ISR is not a common operation. It is likely to only be useful when taking a counting semaphore when an interrupt is obtaining an object from a resource pool (when the semaphore count indicates the number of resources available).

Parameters
xSemaphoreA handle to the semaphore being taken. This is the handle returned when the semaphore was created.
pxHigherPriorityTaskWokenxSemaphoreTakeFromISR() will set *pxHigherPriorityTaskWoken to pdTRUE if taking the semaphore caused a task to unblock, and the unblocked task has a priority higher than the currently running task. If xSemaphoreTakeFromISR() sets this value to pdTRUE then a context switch should be requested before the interrupt is exited.
Returns
pdTRUE if the semaphore was successfully taken, otherwise pdFALSE

Definition at line 659 of file semphr.h.

Typedef Documentation

◆ SemaphoreHandle_t

Definition at line 38 of file semphr.h.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:00