5#ifndef ELEC_C7222_UTILS_FREERTOS_SEMAPHORE_HPP
6#define ELEC_C7222_UTILS_FREERTOS_SEMAPHORE_HPP
58 bool Take(std::uint32_t ticks_to_wait = 0);
73 void* handle_{
nullptr};
110 bool Initialize(std::uint32_t max_count, std::uint32_t initial_count);
119 bool Take(std::uint32_t ticks_to_wait = 0);
136 void* handle_{
nullptr};
Ownership-based wrapper for a FreeRTOS-style binary semaphore.
Definition freertos_semaphore.hpp:35
bool Initialize(bool initially_given=false)
Initialize (or re-initialize) the semaphore.
bool Take(std::uint32_t ticks_to_wait=0)
Take the semaphore.
bool Give()
Give the semaphore from task context.
FreeRtosBinarySemaphore(bool initially_given)
Construct and initialize a binary semaphore.
bool GiveFromISR()
Give the semaphore from ISR context.
~FreeRtosBinarySemaphore()
Destroy semaphore resources if initialized.
FreeRtosBinarySemaphore()=default
Construct an uninitialized semaphore wrapper.
Ownership-based wrapper for a FreeRTOS-style counting semaphore.
Definition freertos_semaphore.hpp:94
bool Give()
Return one token to the semaphore from task context.
~FreeRtosCountingSemaphore()
Destroy semaphore resources if initialized.
std::uint32_t GetCount() const
FreeRtosCountingSemaphore(std::uint32_t max_count, std::uint32_t initial_count)
Construct and initialize a counting semaphore.
bool Initialize(std::uint32_t max_count, std::uint32_t initial_count)
Initialize (or re-initialize) a counting semaphore.
bool GiveFromISR()
Return one token to the semaphore from ISR context.
FreeRtosCountingSemaphore()=default
Construct an uninitialized counting semaphore wrapper.
bool Take(std::uint32_t ticks_to_wait=0)
Take one token from the semaphore.
Disable both copy and move operations.
Definition non_copyable.hpp:75
C7222 course abstractions namespace.
Definition ble.hpp:20
Base classes to control copy/move semantics.