Ownership-based wrapper for an event bit group.
More...
#include <freertos_event_group.hpp>
Ownership-based wrapper for an event bit group.
Event groups are useful for waiting on one or more flags across tasks. Wait and bit operations are explicit; RAII here refers to handle cleanup.
Typical usage:
constexpr std::uint32_t kReadyBit = 1u << 0;
const std::uint32_t bits = events.
WaitBits(kReadyBit,
true,
true, 100);
if((bits & kReadyBit) != 0U) {
}
Ownership-based wrapper for an event bit group.
Definition freertos_event_group.hpp:36
std::uint32_t WaitBits(std::uint32_t bits_to_wait_for, bool clear_on_exit, bool wait_for_all_bits, std::uint32_t ticks_to_wait)
Wait until required event bits are satisfied.
std::uint32_t SetBits(std::uint32_t bits)
Set bits in the event group.
◆ FreeRtosEventGroup()
| c7222::FreeRtosEventGroup::FreeRtosEventGroup |
( |
| ) |
|
Construct and initialize an event group.
◆ ~FreeRtosEventGroup()
| c7222::FreeRtosEventGroup::~FreeRtosEventGroup |
( |
| ) |
|
Destroy event group resources if initialized.
◆ ClearBits()
| std::uint32_t c7222::FreeRtosEventGroup::ClearBits |
( |
std::uint32_t |
bits | ) |
|
Clear bits in the event group.
- Parameters
-
- Returns
- Event bits value before clearing.
◆ GetBits()
| std::uint32_t c7222::FreeRtosEventGroup::GetBits |
( |
| ) |
const |
- Returns
- Current event bits from task context.
◆ GetBitsFromISR()
| std::uint32_t c7222::FreeRtosEventGroup::GetBitsFromISR |
( |
| ) |
const |
- Returns
- Current event bits from ISR context.
◆ Initialize()
| bool c7222::FreeRtosEventGroup::Initialize |
( |
| ) |
|
Initialize (or re-initialize) the event group.
◆ IsValid()
| bool c7222::FreeRtosEventGroup::IsValid |
( |
| ) |
const |
- Returns
- true if the wrapper owns a valid event group handle.
◆ SetBits()
| std::uint32_t c7222::FreeRtosEventGroup::SetBits |
( |
std::uint32_t |
bits | ) |
|
Set bits in the event group.
- Parameters
-
- Returns
- Event bits value after setting.
◆ SetBitsFromISR()
| bool c7222::FreeRtosEventGroup::SetBitsFromISR |
( |
std::uint32_t |
bits | ) |
|
Set bits from ISR context.
- Parameters
-
- Returns
- true on success.
◆ WaitBits()
| std::uint32_t c7222::FreeRtosEventGroup::WaitBits |
( |
std::uint32_t |
bits_to_wait_for, |
|
|
bool |
clear_on_exit, |
|
|
bool |
wait_for_all_bits, |
|
|
std::uint32_t |
ticks_to_wait |
|
) |
| |
Wait until required event bits are satisfied.
- Parameters
-
| bits_to_wait_for | Target bits. |
| clear_on_exit | If true, clear requested bits before return. |
| wait_for_all_bits | If true, wait for all bits; otherwise any bit. |
| ticks_to_wait | Max ticks to wait. |
- Returns
- Event bits value on wakeup.
The documentation for this class was generated from the following file: