41#include "event_groups.h"
54#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
56 #define EVENT_MASK 0x00FFU
57#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
59 #define EVENT_MASK 0x00FFFFFFUL
60#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
62 #define EVENT_MASK 0x00FFFFFFFFFFFFFFULL
65#if FREERTOSCPP_USE_NAMESPACE
72#if( configSUPPORT_STATIC_ALLOCATION == 1 )
73 eventHandle = xEventGroupCreateStatic(&eventBuffer);
75 eventHandle = xEventGroupCreate();
80#if( configSUPPORT_STATIC_ALLOCATION == 1 )
82 vEventGroupDelete(eventHandle);
91 return xEventGroupGetBits(eventHandle);
95 return xEventGroupGetBitsFromISR(eventHandle);
105 EventBits_t
set(EventBits_t bits) {
106 return xEventGroupSetBits(eventHandle, bits);
109 EventBits_t
set_ISR(EventBits_t bits, portBASE_TYPE& waswoken) {
110 return xEventGroupSetBitsFromISR(eventHandle, bits, &waswoken);
118 EventBits_t
clear(EventBits_t bits) {
119 return xEventGroupClearBits(eventHandle, bits);
123 return xEventGroupClearBitsFromISR(eventHandle, bits);
133 EventBits_t
sync(EventBits_t set, EventBits_t wait, TickType_t ticks = portMAX_DELAY){
134 return xEventGroupSync(eventHandle, set, wait, ticks);
137#if FREERTOSCPP_USE_CHRONO
145 EventBits_t sync(EventBits_t set, EventBits_t wait, Time_ms ms){
146 return xEventGroupSync(eventHandle, set, wait, ms2ticks(ms));
159 EventBits_t
wait(EventBits_t waitBits,
bool clear =
true,
bool all =
false, TickType_t ticks = portMAX_DELAY) {
160 return xEventGroupWaitBits(eventHandle, waitBits, clear, all, ticks);
162#if FREERTOSCPP_USE_CHRONO
172 EventBits_t wait(EventBits_t waitBits,
bool clear,
bool all, Time_ms ms) {
173 return xEventGroupWaitBits(eventHandle, waitBits, clear, all, ms2ticks(ms));
179#if( configSUPPORT_STATIC_ALLOCATION == 1 )
180 StaticEventGroup_t eventBuffer;
185#if FREERTOSCPP_USE_NAMESPACE
EventBits_t clear_ISR(EventBits_t bits)
Definition EventCPP.h:122
EventBits_t get_ISR()
Definition EventCPP.h:94
EventGroupHandle_t eventHandle
Definition EventCPP.h:178
EventBits_t clear(EventBits_t bits)
Clear Event Bits.
Definition EventCPP.h:118
EventBits_t get()
Get Event Bits.
Definition EventCPP.h:90
EventBits_t wait(EventBits_t waitBits, bool clear=true, bool all=false, TickType_t ticks=portMAX_DELAY)
Wait for Event.
Definition EventCPP.h:159
EventGroup()
Definition EventCPP.h:71
EventBits_t set(EventBits_t bits)
Set Event Bits.
Definition EventCPP.h:105
EventBits_t set_ISR(EventBits_t bits, portBASE_TYPE &waswoken)
Definition EventCPP.h:109
EventBits_t sync(EventBits_t set, EventBits_t wait, TickType_t ticks=portMAX_DELAY)
Event Group Sync.
Definition EventCPP.h:133
~EventGroup()
Definition EventCPP.h:79
Definition FreeRTOScpp.h:74