FreeRTOS-Cpp
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FreeRTOS::StaticEventGroup Class Reference

Class that encapsulates the functionality of a FreeRTOS event group. More...

#include <FreeRTOS/EventGroups.hpp>

Inheritance diagram for FreeRTOS::StaticEventGroup:
Inheritance graph
[legend]
Collaboration diagram for FreeRTOS::StaticEventGroup:
Collaboration graph
[legend]

Public Member Functions

 StaticEventGroup ()
 Construct a new StaticEventGroup object by calling EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )
 
 StaticEventGroup (const StaticEventGroup &)=delete
 
StaticEventGroupoperator= (const StaticEventGroup &)=delete
 
 StaticEventGroup (StaticEventGroup &&) noexcept=default
 
StaticEventGroupoperator= (StaticEventGroup &&) noexcept=default
 
- Public Member Functions inherited from FreeRTOS::EventGroupBase
 EventGroupBase (const EventGroupBase &)=delete
 
EventGroupBaseoperator= (const EventGroupBase &)=delete
 
bool isValid () const
 Function that checks if the underlying event group handle is not NULL. This should be used to ensure an event group has been created correctly.
 
EventBits wait (const EventBits &bitsToWaitFor=0, const bool clearOnExit=false, const bool waitForAllBits=false, const TickType_t ticksToWait=portMAX_DELAY) const
 Function that calls EventBits_t xEventGroupWaitBits( const EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )
 
EventBits set (const EventBits &bitsToSet) const
 Function that calls EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
 
bool setFromISR (bool &higherPriorityTaskWoken, const EventBits &bitsToSet) const
 Function that calls BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken )
 
bool setFromISR (const EventBits &bitsToSet) const
 Function that calls BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken )
 
EventBits clear (const EventBits &bitsToClear) const
 Function that calls EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
 
bool clearFromISR (const EventBits &bitsToClear) const
 Function that calls BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
 
EventBits get () const
 Function that calls EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup )
 
EventBits getFromISR () const
 Function that calls EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
 
EventBits sync (const EventBits &bitsToSet=0, const EventBits &bitsToWaitFor=0, const TickType_t ticksToWait=portMAX_DELAY) const
 Function that calls EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait )
 

Private Attributes

StaticEventGroup_t staticEventGroup
 

Additional Inherited Members

- Public Types inherited from FreeRTOS::EventGroupBase
using EventBits = std::bitset< 8 >
 
using EventBits = std::bitset< 24 >
 
using EventBits = std::bitset< 56 >
 
- Static Public Member Functions inherited from FreeRTOS::EventGroupBase
static void * operator new (size_t)=delete
 
static void * operator new[] (size_t)=delete
 
static void * operator new (size_t, void *ptr)
 
static void * operator new[] (size_t, void *ptr)
 

Detailed Description

Class that encapsulates the functionality of a FreeRTOS event group.

Each event group requires a [very] small amount of RAM that is used to hold the event group's state. If an event group is created using FreeRTOS::EventGroup then the required RAM is automatically allocated from the FreeRTOS heap. If an event group is created using this class then the RAM is provided by the application writer, which requires an additional parameter, but allows the RAM to be statically allocated at compile time. See the Static Vs Dynamic allocation page for more information.

Constructor & Destructor Documentation

◆ StaticEventGroup()

FreeRTOS::StaticEventGroup::StaticEventGroup ( )
inline

Construct a new StaticEventGroup object by calling EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )

EventGroups.hpp

See also
https://www.freertos.org/xEventGroupCreateStatic.html
Warning
This class contains the storage buffer for the event group, so the user should create this object as a global object or with the static storage specifier so that the object instance is not on the stack.

Example Usage

#include <FreeRTOS/EventGroups.hpp>
#include <FreeRTOS/Kernel.hpp>
#include <FreeRTOS/Task.hpp>
class MyTask : public FreeRTOS::Task {
public:
void taskFunction() final;
};
MyTask myTask;
FreeRTOS::StaticEventGroup eventGroup;
void MyTask::taskFunction() {
// Use the event group
}
Class that encapsulates the functionality of a FreeRTOS event group.
Definition EventGroups.hpp:487
Class that encapsulates the functionality of a FreeRTOS task.
Definition Task.hpp:1427

The documentation for this class was generated from the following file: