event_groups.h
Go to the documentation of this file.
/*
* FreeRTOS Kernel V10.0.0
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. If you wish to use our Amazon
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* http://www.FreeRTOS.org
* http://aws.amazon.com/freertos
*
* 1 tab == 4 spaces!
*/
#ifndef EVENT_GROUPS_H
#define EVENT_GROUPS_H
#ifndef INC_FREERTOS_H
#error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
#endif
/* FreeRTOS includes. */
#include "timers.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void * EventGroupHandle_t;
/*
* The type that holds event bits always matches TickType_t - therefore the
* number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
* 32 bits if set to 0.
*
* \defgroup EventBits_t EventBits_t
* \ingroup EventGroup
*/
typedef TickType_t EventBits_t;
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
#endif
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
#endif
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
#if( configUSE_TRACE_FACILITY == 1 )
BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
#else
#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
#endif
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
#if( configUSE_TRACE_FACILITY == 1 )
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
#else
#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
#endif
EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
/* For internal use only. */
void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
#if (configUSE_TRACE_FACILITY == 1)
UBaseType_t uxEventGroupGetNumber( void* xEventGroup ) PRIVILEGED_FUNCTION;
void vEventGroupSetNumber( void* xEventGroup, UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
#endif
#ifdef __cplusplus
}
#endif
#endif /* EVENT_GROUPS_H */
uxTaskResetEventItemValue
TickType_t uxTaskResetEventItemValue(void) PRIVILEGED_FUNCTION
Definition: tasks.c:4382
traceEVENT_GROUP_WAIT_BITS_BLOCK
#define traceEVENT_GROUP_WAIT_BITS_BLOCK(xEventGroup, uxBitsToWaitFor)
Definition: FreeRTOS.h:573
task.h
traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
#define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR(xEventGroup, uxBitsToClear)
Definition: FreeRTOS.h:585
xEventGroupDefinition
Definition: event_groups.c:65
xLIST
Definition: list.h:165
event_groups.h
xEventGroupWaitBits
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait)
Definition: event_groups.c:297
vPortFree
void vPortFree(void *pv)
Definition: heap_1.c:123
traceEVENT_GROUP_SYNC_END
#define traceEVENT_GROUP_SYNC_END(xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred)
Definition: FreeRTOS.h:569
vListInitialise
void vListInitialise(List_t *const pxList)
Definition: list.c:38
xEventGroupSetBitsFromISR
#define xEventGroupSetBitsFromISR(xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken)
Definition: event_groups.h:562
xLIST_ITEM
Definition: list.h:141
listCURRENT_LIST_LENGTH
#define listCURRENT_LIST_LENGTH(pxList)
Definition: list.h:255
eventWAIT_FOR_ALL_BITS
#define eventWAIT_FOR_ALL_BITS
Definition: event_groups.c:60
eventCLEAR_EVENTS_ON_EXIT_BIT
#define eventCLEAR_EVENTS_ON_EXIT_BIT
Definition: event_groups.c:58
traceEVENT_GROUP_CREATE
#define traceEVENT_GROUP_CREATE(xEventGroup)
Definition: FreeRTOS.h:557
vEventGroupSetBitsCallback
void vEventGroupSetBitsCallback(void *pvEventGroup, const uint32_t ulBitsToSet) PRIVILEGED_FUNCTION
Definition: event_groups.c:643
eventEVENT_BITS_CONTROL_BYTES
#define eventEVENT_BITS_CONTROL_BYTES
Definition: event_groups.c:61
traceEVENT_GROUP_WAIT_BITS_END
#define traceEVENT_GROUP_WAIT_BITS_END(xEventGroup, uxBitsToWaitFor, xTimeoutOccurred)
Definition: FreeRTOS.h:577
vTaskSuspendAll
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2031
vTaskRemoveFromUnorderedEventList
void vTaskRemoveFromUnorderedEventList(ListItem_t *pxEventListItem, const TickType_t xItemValue) PRIVILEGED_FUNCTION
Definition: tasks.c:3051
EventBits_t
TickType_t EventBits_t
Definition: event_groups.h:92
xEventGroupSetBits
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet)
Definition: event_groups.c:505
traceEVENT_GROUP_DELETE
#define traceEVENT_GROUP_DELETE(xEventGroup)
Definition: FreeRTOS.h:597
xMINI_LIST_ITEM::pxNext
struct xLIST_ITEM *configLIST_VOLATILE pxNext
Definition: list.h:156
EventGroupHandle_t
void * EventGroupHandle_t
Definition: event_groups.h:82
PRIVILEGED_FUNCTION
#define PRIVILEGED_FUNCTION
Definition: mpu_wrappers.h:174
traceEVENT_GROUP_CREATE_FAILED
#define traceEVENT_GROUP_CREATE_FAILED()
Definition: FreeRTOS.h:561
TickType_t
uint32_t TickType_t
Definition: portmacro.h:64
traceEVENT_GROUP_CLEAR_BITS
#define traceEVENT_GROUP_CLEAR_BITS(xEventGroup, uxBitsToClear)
Definition: FreeRTOS.h:581
xEventGroupSync
EventBits_t xEventGroupSync(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: event_groups.c:177
listGET_LIST_ITEM_VALUE
#define listGET_LIST_ITEM_VALUE(pxListItem)
Definition: list.h:208
vEventGroupClearBitsCallback
void vEventGroupClearBitsCallback(void *pvEventGroup, const uint32_t ulBitsToClear)
Definition: event_groups.c:651
taskENTER_CRITICAL
#define taskENTER_CRITICAL()
Definition: task.h:179
xEventGroupWaitBits
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: event_groups.c:297
pdFALSE
#define pdFALSE
Definition: projdefs.h:45
vTaskPlaceOnUnorderedEventList
void vTaskPlaceOnUnorderedEventList(List_t *pxEventList, const TickType_t xItemValue, const TickType_t xTicksToWait) PRIVILEGED_FUNCTION
Definition: tasks.c:2926
xEventGroupClearBitsFromISR
#define xEventGroupClearBitsFromISR(xEventGroup, uxBitsToClear)
Definition: event_groups.h:410
UBaseType_t
unsigned long UBaseType_t
Definition: portmacro.h:58
xEventGroupClearBits
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear)
Definition: event_groups.c:447
traceEVENT_GROUP_SET_BITS_FROM_ISR
#define traceEVENT_GROUP_SET_BITS_FROM_ISR(xEventGroup, uxBitsToSet)
Definition: FreeRTOS.h:593
traceEVENT_GROUP_SET_BITS
#define traceEVENT_GROUP_SET_BITS(xEventGroup, uxBitsToSet)
Definition: FreeRTOS.h:589
traceEVENT_GROUP_SYNC_BLOCK
#define traceEVENT_GROUP_SYNC_BLOCK(xEventGroup, uxBitsToSet, uxBitsToWaitFor)
Definition: FreeRTOS.h:565
xSTATIC_EVENT_GROUP
Definition: FreeRTOS.h:1092
vEventGroupDelete
void vEventGroupDelete(EventGroupHandle_t xEventGroup) PRIVILEGED_FUNCTION
Definition: event_groups.c:599
taskSCHEDULER_SUSPENDED
#define taskSCHEDULER_SUSPENDED
Definition: task.h:219
FreeRTOS.h
EventGroup_t
struct xEventGroupDefinition EventGroup_t
xEventGroupSync
EventBits_t xEventGroupSync(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait)
Definition: event_groups.c:177
xEventGroupGetBitsFromISR
EventBits_t xEventGroupGetBitsFromISR(EventGroupHandle_t xEventGroup) PRIVILEGED_FUNCTION
Definition: event_groups.c:489
timers.h
prvTestWaitCondition
static BaseType_t prvTestWaitCondition(const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits) PRIVILEGED_FUNCTION
Definition: event_groups.c:657
portCLEAR_INTERRUPT_MASK_FROM_ISR
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)
Definition: portmacro.h:110
xEventGroupDefinition::uxEventBits
EventBits_t uxEventBits
Definition: event_groups.c:66
xEventGroupSetBits
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet) PRIVILEGED_FUNCTION
Definition: event_groups.c:505
vEventGroupDelete
void vEventGroupDelete(EventGroupHandle_t xEventGroup)
Definition: event_groups.c:599
portYIELD_WITHIN_API
#define portYIELD_WITHIN_API
Definition: FreeRTOS.h:723
BaseType_t
long BaseType_t
Definition: portmacro.h:57
pdTRUE
#define pdTRUE
Definition: projdefs.h:46
listGET_NEXT
#define listGET_NEXT(pxListItem)
Definition: list.h:233
xLIST::xListEnd
MiniListItem_t xListEnd
Definition: list.h:169
vEventGroupClearBitsCallback
void vEventGroupClearBitsCallback(void *pvEventGroup, const uint32_t ulBitsToClear) PRIVILEGED_FUNCTION
Definition: event_groups.c:651
xEventGroupCreate
EventGroupHandle_t xEventGroupCreate(void)
Definition: event_groups.c:143
xEventGroupGetBitsFromISR
EventBits_t xEventGroupGetBitsFromISR(EventGroupHandle_t xEventGroup)
Definition: event_groups.c:489
taskEXIT_CRITICAL
#define taskEXIT_CRITICAL()
Definition: task.h:194
xTimerPendFunctionCallFromISR
BaseType_t xTimerPendFunctionCallFromISR(PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
xTaskResumeAll
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
Definition: tasks.c:2104
xTaskGetSchedulerState
BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION
configASSERT
#define configASSERT(x)
Definition: FreeRTOS.h:235
vEventGroupSetBitsCallback
void vEventGroupSetBitsCallback(void *pvEventGroup, const uint32_t ulBitsToSet)
Definition: event_groups.c:643
StaticEventGroup_t
struct xSTATIC_EVENT_GROUP StaticEventGroup_t
xEventGroupDefinition::xTasksWaitingForBits
List_t xTasksWaitingForBits
Definition: event_groups.c:67
eventUNBLOCKED_DUE_TO_BIT_SET
#define eventUNBLOCKED_DUE_TO_BIT_SET
Definition: event_groups.c:59
listGET_HEAD_ENTRY
#define listGET_HEAD_ENTRY(pxList)
Definition: list.h:225
portSET_INTERRUPT_MASK_FROM_ISR
#define portSET_INTERRUPT_MASK_FROM_ISR()
Definition: portmacro.h:109
xEventGroupClearBits
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear) PRIVILEGED_FUNCTION
Definition: event_groups.c:447
mtCOVERAGE_TEST_MARKER
#define mtCOVERAGE_TEST_MARKER()
Definition: FreeRTOS.h:787
listGET_END_MARKER
#define listGET_END_MARKER(pxList)
Definition: list.h:241
pvPortMalloc
void * pvPortMalloc(size_t xWantedSize)
Definition: heap_1.c:71