Embedded Artistry Framework
Embedded Systems C++ Framework
Classes | Typedefs | Functions | Variables
FreeRTOSOS

Classes

class  os::freertos::EventFlag
 FreeRTOS Event Flag Implementation. More...
 
class  os::freertos::MessageQueue< TType >
 FreeRTOS Message Queue implementation for OSX. More...
 
class  os::freertos::Mutex
 FreeRTOS Mutex Implementation. More...
 
class  os::freertos::Semaphore
 Create a FreeRTOS semaphore (OSX variant) More...
 
class  os::freertos::Thread
 Create a FreeRTOS thread. More...
 
class  os::freertos::Heap
 
class  os::freertos::freertosOSFactory_impl
 Implementation of the FreeRTOS OS Factory For API documentation, see embvm::embvm::VirtualOSFactory. More...
 

Typedefs

using os::freertos::thread_exit_t = void(*)(void *)
 

Functions

void os::freertos::register_threadexit_func (thread_exit_t atexit) noexcept
 
void os::freertos::startScheduler () noexcept
 Call this function to start the FreeRTOS scheduler. More...
 

Variables

static constexpr size_t os::freertos::FREERTOS_STACK_MIN = (1 * 1024)
 

Detailed Description


Class Documentation

◆ os::freertos::EventFlag

class os::freertos::EventFlag

FreeRTOS Event Flag Implementation.

Inheritance diagram for os::freertos::EventFlag:
Inheritance graph

Public Member Functions

 EventFlag () noexcept
 Create an event flag group. More...
 
 ~EventFlag () noexcept
 Default destructor which cleans up the event flag group. More...
 
embvm::eventflag::flag_t get (embvm::eventflag::flag_t bits_wait, embvm::eventflag::option opt=embvm::eventflag::option::OR, bool clearOnExit=true, const embvm::os_timeout_t &timeout=embvm::OS_WAIT_FOREVER) noexcept final
 Get (or wait for) event flags. More...
 
void set (embvm::eventflag::flag_t bits) noexcept final
 Set event flags. More...
 
void setFromISR (embvm::eventflag::flag_t bits) noexcept final
 Set event flags from an ISR. More...
 
void clear () noexcept final
 Clear all event flag bits. More...
 
embvm::eventflag::handle_t native_handle () const noexcept final
 Get the native handle for the event flags group object. More...
 

Private Attributes

embvm::eventflag::handle_t handle_
 

Constructor & Destructor Documentation

◆ EventFlag()

EventFlag::EventFlag ( )
explicitnoexcept

Create an event flag group.

References assert, buf, handle_, and static_event_pool_.

◆ ~EventFlag()

EventFlag::~EventFlag ( )
noexcept

Default destructor which cleans up the event flag group.

References handle_, and static_event_pool_.

Member Function Documentation

◆ clear()

void EventFlag::clear ( )
finalvirtualnoexcept

Clear all event flag bits.

Postcondition
Event flag group value is reset to '0'.

Implements embvm::VirtualEventFlag.

References handle_.

◆ get()

embvm::eventflag::flag_t EventFlag::get ( embvm::eventflag::flag_t  bits_wait,
embvm::eventflag::option  opt = embvm::eventflag::option::OR,
bool  clearOnExit = true,
const embvm::os_timeout_t timeout = embvm::OS_WAIT_FOREVER 
)
finalvirtualnoexcept

Get (or wait for) event flags.

Get the event flag bits. If the required event flags are not set, this function will block the calling thread until the flags are set or the timeout expires.

To see all bits currently set, set bits_wait to ~0 and timeout_t to the minimal value (timeout_t(1)).

Parameters
bits_waitA bitmask of bits to wait for in the event flags group.
optThe wait option, which is combined with bits_wait to control the behavior of get(). embvm::eventflag::option::OR will return once any of the bits specified in bits_wait are set in the event flag group. embvm::eventflag::option::AND will only return once ALL of the bits specified in bits_wait are set in the event flag group.
clearOnExitIf true, all event flags that were specified in bits_wait and set in the event flag group will be set to 0. If false, event flag bits will not be modified.
timeoutSpecify a timeout for the get operation. If OS_WAIT_FOREVER is supplied, this call will block until the event flags are set. Otherwise, the function will timeout after the elapsed time if flags are not set.
Returns
0 if timeout, or flags that were currently set according to bits_wait

Implements embvm::VirtualEventFlag.

References embvm::eventflag::AND, assert, and os::freertos::frameworkTimeoutToTicks().

◆ native_handle()

embvm::eventflag::handle_t os::freertos::EventFlag::native_handle ( ) const
inlinefinalvirtualnoexcept

Get the native handle for the event flags group object.

Returns
the native handle for this event flags object. The handle will always return the handle_t and it must be cast to the native handle type by the user.

Implements embvm::VirtualEventFlag.

References handle_.

◆ set()

void EventFlag::set ( embvm::eventflag::flag_t  bits)
finalvirtualnoexcept

Set event flags.

Set event flags from a threaded context. Threads waiting on event flags (via get()) will be notified.

Parameters
bitsA bitmask representing the bits to set in the event flag group.

Implements embvm::VirtualEventFlag.

References assert.

◆ setFromISR()

void EventFlag::setFromISR ( embvm::eventflag::flag_t  bits)
finalvirtualnoexcept

Set event flags from an ISR.

Set event flags from an interrupt context. This call must not use a lock. Threads waiting on event flags (via get()) will be notified.

Parameters
bitsA bitmask representing the bits to set in the event flag group.

Implements embvm::VirtualEventFlag.

References assert, portYIELD_FROM_ISR, and r.

Member Data Documentation

◆ handle_

embvm::eventflag::handle_t os::freertos::EventFlag::handle_
private

◆ os::freertos::MessageQueue

class os::freertos::MessageQueue

template<typename TType>
class os::freertos::MessageQueue< TType >

FreeRTOS Message Queue implementation for OSX.

Template Parameters
TTypeThe type of data to be stored in the message queue
Inheritance diagram for os::freertos::MessageQueue< TType >:
Inheritance graph

Public Member Functions

 MessageQueue (size_t queue_length) noexcept
 Construct a message queue. More...
 
 ~MessageQueue () noexcept
 Default destructor, cleans up the message queue. More...
 
bool push (TType val, embvm::os_timeout_t timeout=embvm::OS_WAIT_FOREVER) noexcept final
 Post a message to the queue. More...
 
std::optional< TType > pop (embvm::os_timeout_t timeout=embvm::OS_WAIT_FOREVER) noexcept final
 Retrieve a message from the queue. More...
 
size_t size () const noexcept final
 Get the current size of the message queue. More...
 
void reset () noexcept final
 Reset the message queue to an empty state. More...
 
bool empty () const noexcept final
 Check if the message queue is empty. More...
 
bool full () const noexcept final
 Check if the message queue is full. More...
 
embvm::msgqueue::handle_t native_handle () const noexcept final
 Get the native handle for the message queue object. More...
 

Private Attributes

embvm::msgqueue::handle_t handle_
 
size_t max_length_
 

Constructor & Destructor Documentation

◆ MessageQueue()

template<typename TType >
os::freertos::MessageQueue< TType >::MessageQueue ( size_t  queue_length)
inlineexplicitnoexcept

Construct a message queue.

Parameters
queue_lengthThe maximum size of the message queue.

References assert, os::freertos::details::MessageQueueMediator::create(), and os::freertos::MessageQueue< TType >::handle_.

◆ ~MessageQueue()

template<typename TType >
os::freertos::MessageQueue< TType >::~MessageQueue ( )
inlinenoexcept

Default destructor, cleans up the message queue.

References os::freertos::details::MessageQueueMediator::destroy(), and os::freertos::MessageQueue< TType >::handle_.

Member Function Documentation

◆ empty()

template<typename TType >
bool os::freertos::MessageQueue< TType >::empty ( ) const
inlinefinalvirtualnoexcept

Check if the message queue is empty.

Returns
true if the queue is empty, false otherwise.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::details::MessageQueueMediator::empty(), and os::freertos::MessageQueue< TType >::handle_.

◆ full()

template<typename TType >
bool os::freertos::MessageQueue< TType >::full ( ) const
inlinefinalvirtualnoexcept

Check if the message queue is full.

Returns
true if the queue is full, false otherwise.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::details::MessageQueueMediator::full(), os::freertos::MessageQueue< TType >::handle_, and os::freertos::MessageQueue< TType >::max_length_.

◆ native_handle()

template<typename TType >
embvm::msgqueue::handle_t os::freertos::MessageQueue< TType >::native_handle ( ) const
inlinefinalvirtualnoexcept

Get the native handle for the message queue object.

Returns
the native handle for this message queue object. The handle will always return the handle_t and it must be cast to the native handle type by the user.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::MessageQueue< TType >::handle_.

◆ pop()

template<typename TType >
std::optional<TType> os::freertos::MessageQueue< TType >::pop ( embvm::os_timeout_t  timeout = embvm::OS_WAIT_FOREVER)
inlinefinalvirtualnoexcept

Retrieve a message from the queue.

Retrieve a message from the queue. This function blocks the calling thread until a message is received (if OS_WAIT_FOREVER is specified as a timeout), or until the timeout expires.

Parameters
timeoutThe time to wait for a new message. A value of OS_WAIT_FOREVER indicates that the thread should block until a new message is posted.
Returns
an optional value. Use has_value() member function to determine if the value is valid. A valid value is only returned on success.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::MessageQueue< TType >::handle_, and os::freertos::details::MessageQueueMediator::pop().

◆ push()

template<typename TType >
bool os::freertos::MessageQueue< TType >::push ( TType  val,
embvm::os_timeout_t  timeout = embvm::OS_WAIT_FOREVER 
)
inlinefinalvirtualnoexcept

Post a message to the queue.

Post a message to the queue. This function blocks the calling thread until there is an available slot (if OS_WAIT_FOREVER is specified as a timeout), or until the timeout expires.

Posting a message to the queue will notify all threads waiting on a new message (via pop()).

Parameters
valThe data value to post to the queue.
timeoutThe time to wait for a new message. A value of OS_WAIT_FOREVER indicates that the thread should block until a new message is posted.
Returns
true if the message was successfully posted, false otherwise.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::MessageQueue< TType >::handle_, and os::freertos::details::MessageQueueMediator::push().

◆ reset()

template<typename TType >
void os::freertos::MessageQueue< TType >::reset ( )
inlinefinalvirtualnoexcept

Reset the message queue to an empty state.

Postcondition
The message queue is emptied, with size 0.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::MessageQueue< TType >::handle_, and os::freertos::details::MessageQueueMediator::reset().

◆ size()

template<typename TType >
size_t os::freertos::MessageQueue< TType >::size ( ) const
inlinefinalvirtualnoexcept

Get the current size of the message queue.

Size represents the number of elements stored, rather than the maximum size (aka capacity).

Returns
the current number of elements stored in the message queue.

Implements embvm::VirtualMessageQueue< TType >.

References os::freertos::MessageQueue< TType >::handle_, and os::freertos::details::MessageQueueMediator::size().

Member Data Documentation

◆ handle_

◆ max_length_

template<typename TType >
size_t os::freertos::MessageQueue< TType >::max_length_
private

◆ os::freertos::Mutex

class os::freertos::Mutex

FreeRTOS Mutex Implementation.

Inheritance diagram for os::freertos::Mutex:
Inheritance graph

Public Member Functions

 Mutex (embvm::mutex::type type=embvm::mutex::type::defaultType, embvm::mutex::mode mode=embvm::mutex::mode::defaultMode) noexcept
 Construct a FreeRTOS mutex. More...
 
 ~Mutex () noexcept
 Default destructor. More...
 
void lock () noexcept final
 Lock the mutex. More...
 
void unlock () noexcept final
 Unlock the mutex. More...
 
bool trylock () noexcept final
 Try to lock the mutex. More...
 
embvm::mutex::handle_t native_handle () const noexcept final
 

Private Attributes

embvm::mutex::handle_t handle_
 
embvm::mutex::type type_
 

Constructor & Destructor Documentation

◆ Mutex()

Construct a FreeRTOS mutex.

Parameters
typeThe mutex type to create (normal, recursive)
modeThe mutex poperating mode, which controls priority inheritance behaviors.

References embvm::mutex::normal, embvm::mutex::recursive, and type.

◆ ~Mutex()

Mutex::~Mutex ( )
noexcept

Default destructor.

References handle_, and static_mutex_pool_.

Member Function Documentation

◆ lock()

void Mutex::lock ( )
finalvirtualnoexcept

Lock the mutex.

Attempts to lock the mutex. If successful, the function returns with the calling thread owning the lock. If the lock is already owned, the calling thread will block until the lock is available.

Postcondition
The mutex is locked and owned by the calling thread.

Implements embvm::VirtualMutex.

References assert, handle_, portMAX_DELAY, r, embvm::mutex::recursive, and type_.

◆ native_handle()

embvm::mutex::handle_t os::freertos::Mutex::native_handle ( ) const
inlinefinalvirtualnoexcept

Implements embvm::VirtualMutex.

References handle_.

◆ trylock()

bool Mutex::trylock ( )
finalvirtualnoexcept

Try to lock the mutex.

Try to lock the mutex, but don't block the thread if the mutex is already owned.

Postcondition
If the mutex is unowned, the mutex will be locked and owned by the calling thread.
Returns
true if the mutex is successfully locked, false if another thread owns the mutex.

Implements embvm::VirtualMutex.

References handle_, r, embvm::mutex::recursive, and type_.

◆ unlock()

void Mutex::unlock ( )
finalvirtualnoexcept

Unlock the mutex.

Precondition
The mutex is locked and owned by the calling thread.
Postcondition
The mutex is unlocked.

Implements embvm::VirtualMutex.

References handle_, embvm::mutex::recursive, and type_.

Member Data Documentation

◆ handle_

embvm::mutex::handle_t os::freertos::Mutex::handle_
private

◆ type_

embvm::mutex::type os::freertos::Mutex::type_
private

Referenced by lock(), trylock(), and unlock().

◆ os::freertos::Semaphore

class os::freertos::Semaphore

Create a FreeRTOS semaphore (OSX variant)

Inheritance diagram for os::freertos::Semaphore:
Inheritance graph

Public Member Functions

 Semaphore (embvm::semaphore::mode mode=embvm::semaphore::mode::counting, embvm::semaphore::count_t ceiling=1, embvm::semaphore::count_t initial_count=-1) noexcept
 Create a FreeRTOS sempahore. More...
 
 ~Semaphore () noexcept
 Default destructor, cleans up after semaphore on destruction. More...
 
void give () noexcept final
 Increment count Return a resource to the semaphore, incrementing the count. More...
 
void giveFromISR () noexcept final
 Increment count from an ISR Return a resource to the semaphore, incrementing the count. More...
 
bool take (const embvm::os_timeout_t &timeout=embvm::OS_WAIT_FOREVER) noexcept final
 Decrement count Take a resource from the semaphore, decrementing the count. More...
 
embvm::semaphore::count_t count () const noexcept final
 Check the count of the semaphore. More...
 
embvm::semaphore::handle_t native_handle () const noexcept final
 

Private Attributes

embvm::semaphore::handle_t handle_
 

Constructor & Destructor Documentation

◆ Semaphore()

Semaphore::Semaphore ( embvm::semaphore::mode  mode = embvm::semaphore::mode::counting,
embvm::semaphore::count_t  ceiling = 1,
embvm::semaphore::count_t  initial_count = -1 
)
explicitnoexcept

Create a FreeRTOS sempahore.

Parameters
modeThe semaphore mode (binary, counting).
ceilingThe maximum count of the semaphore
initial_countThe starting count of the semaphore. Can be used to indicate that resources are in use at hte itme of creation.

References assert, embvm::semaphore::binary, embvm::semaphore::counting, and embvm::semaphore::defaultMode.

◆ ~Semaphore()

Semaphore::~Semaphore ( )
noexcept

Default destructor, cleans up after semaphore on destruction.

References handle_, and static_sem_pool_.

Member Function Documentation

◆ count()

embvm::semaphore::count_t Semaphore::count ( ) const
finalvirtualnoexcept

Check the count of the semaphore.

Returns
The current semaphore count.

Implements embvm::VirtualSemaphore.

References handle_.

◆ give()

void Semaphore::give ( )
finalvirtualnoexcept

Increment count Return a resource to the semaphore, incrementing the count.

Implements embvm::VirtualSemaphore.

References assert, handle_, and r.

Referenced by os::freertos::ConditionVariable::broadcast(), and os::freertos::ConditionVariable::signal().

◆ giveFromISR()

void Semaphore::giveFromISR ( )
finalvirtualnoexcept

Increment count from an ISR Return a resource to the semaphore, incrementing the count.

This function variant is safe to call from an interrupt routine. No locking can be used inside this variant.

Implements embvm::VirtualSemaphore.

References handle_, and portYIELD_FROM_ISR.

◆ native_handle()

embvm::semaphore::handle_t os::freertos::Semaphore::native_handle ( ) const
inlinefinalvirtualnoexcept

◆ take()

bool Semaphore::take ( const embvm::os_timeout_t timeout = embvm::OS_WAIT_FOREVER)
finalvirtualnoexcept

Decrement count Take a resource from the semaphore, decrementing the count.

Parameters
timeoutThe time to wait for a semaphore resource. A value of WAIT_FOREVER indicates that the thread should block until the semaphore can be acquired.
Returns
true if take was successful, false if a timeout occurred.

Implements embvm::VirtualSemaphore.

References r.

Referenced by os::freertos::ConditionVariable::broadcast(), and os::freertos::ConditionVariable::signal().

Member Data Documentation

◆ handle_

embvm::semaphore::handle_t os::freertos::Semaphore::handle_
private

◆ os::freertos::Thread

class os::freertos::Thread

Create a FreeRTOS thread.

Your FreeRTOS port must define task priorities for the framework. We recommend that you keep this definition in FreeRTOSConfig.h.

For example, with a max priority of 32:

{
panic = 31,
interrupt = 31,
realtime = 30,
veryHigh = 25,
high = 20,
normal = 10,
low = 3,
lowest = 1,
idle = 0
};
Inheritance diagram for os::freertos::Thread:
Inheritance graph

Public Member Functions

 Thread ()
 
 Thread (std::string_view name, embvm::thread::func_t func, embvm::thread::input_t arg, embvm::thread::priority p=embvm::thread::priority::normal, size_t stack_size=FREERTOS_STACK_MIN, void *stack_ptr=nullptr) noexcept
 Construct a FreeRTOS thread. More...
 
 ~Thread () noexcept
 Default destructor, cleans up thread on deletion. More...
 
void start () noexcept final
 Start the thread, if it is not auto-started. More...
 
void terminate () noexcept final
 Terminate a running thread. More...
 
void join () noexcept final
 Join a running thread. More...
 
std::string_view name () const noexcept final
 View the thread's name. More...
 
embvm::thread::state state () const noexcept final
 Get the thread state. More...
 
embvm::thread::handle_t native_handle () const noexcept final
 Get the native handle for the thread. More...
 

Static Public Member Functions

static void delay_for (uint32_t ticks) noexcept
 

Private Member Functions

void thread_wrapper (embvm::thread::input_t arg) noexcept
 

Private Attributes

embvm::thread::handle_t handle_ = 0
 The FreeRTOS thread handle. More...
 
bool static_ = false
 

Constructor & Destructor Documentation

◆ Thread() [1/2]

os::freertos::Thread::Thread ( )
inline

◆ Thread() [2/2]

Thread::Thread ( std::string_view  name,
embvm::thread::func_t  func,
embvm::thread::input_t  arg,
embvm::thread::priority  p = embvm::thread::priority::normal,
size_t  stack_size = FREERTOS_STACK_MIN,
void *  stack_ptr = nullptr 
)
explicitnoexcept

Construct a FreeRTOS thread.

Parameters
nameThe name associated with the mutex.
Note
A std::string input must remain valid for the lifetime of this object, since std::string_view is used to store the name.
Parameters
funcThe thread function to execute; can be any functor type.
argThe thread's optional input argument. This value is passed to the thread when it is created.
pThe thread priority setting.
stack_sizeThe thread stack size.
stack_ptrThe thread stack pointer. If stack_ptr is nullptr, then memory will be allocated by the pthread library.

References assert, freertos_priority(), p, and r.

◆ ~Thread()

Thread::~Thread ( )
noexcept

Default destructor, cleans up thread on deletion.

References terminate().

Member Function Documentation

◆ delay_for()

void Thread::delay_for ( uint32_t  ticks)
staticnoexcept

◆ join()

void Thread::join ( )
finalvirtualnoexcept

Join a running thread.

Joins a running thread, blocking the calling thread until the joined thread completes.

Precondition
The thread has not exited.
Postcondition
The thread has exited.

Implements embvm::VirtualThread.

References embvm::thread::completed, handle_, state(), and embvm::thread::terminated.

◆ name()

std::string_view Thread::name ( ) const
finalvirtualnoexcept

View the thread's name.

Storage for the thread name is implementation defined. For example, the name may be stored in the RTOS memory, or it may require internal object storage.

Returns
The thread object's name.

Implements embvm::VirtualThread.

References handle_.

◆ native_handle()

embvm::thread::handle_t os::freertos::Thread::native_handle ( ) const
inlinefinalvirtualnoexcept

Get the native handle for the thread.

If custom extensions or behaviors are needed, the thread handle can be retrieved and manipulated directly.

Returns
the native thread object handle as a void*. The user must cast appropriately.

Implements embvm::VirtualThread.

References handle_.

◆ start()

void Thread::start ( )
finalvirtualnoexcept

Start the thread, if it is not auto-started.

Implements embvm::VirtualThread.

◆ state()

embvm::thread::state Thread::state ( ) const
finalvirtualnoexcept

Get the thread state.

Returns
The state of the thread.

Implements embvm::VirtualThread.

References embvm::thread::completed, embvm::thread::executing, handle_, embvm::thread::ready, s, and embvm::thread::suspended.

Referenced by join().

◆ terminate()

void Thread::terminate ( )
finalvirtualnoexcept

Terminate a running thread.

Precondition
The thread is running.
Postcondition
The thread is aborted.

Grab our TLS handle before we destroy the thread

Implements embvm::VirtualThread.

References exit_func_, handle_, NULL, and static_.

Referenced by ~Thread().

◆ thread_wrapper()

void os::freertos::Thread::thread_wrapper ( embvm::thread::input_t  arg)
privatenoexcept

Member Data Documentation

◆ handle_

embvm::thread::handle_t os::freertos::Thread::handle_ = 0
private

The FreeRTOS thread handle.

Referenced by join(), name(), native_handle(), state(), and terminate().

◆ static_

bool os::freertos::Thread::static_ = false
private

Referenced by terminate().

◆ os::freertos::Heap

class os::freertos::Heap

Static Public Member Functions

static void addBlock (void *addr, size_t size) noexcept
 
static void init () noexcept
 
static void * alloc (size_t size) noexcept
 
static void free (void *addr) noexcept
 

Member Function Documentation

◆ addBlock()

void os::freertos::Heap::addBlock ( void *  addr,
size_t  size 
)
staticnoexcept

◆ alloc()

void * os::freertos::Heap::alloc ( size_t  size)
staticnoexcept

◆ free()

void os::freertos::Heap::free ( void *  addr)
staticnoexcept

◆ init()

void os::freertos::Heap::init ( )
staticnoexcept

◆ os::freertos::freertosOSFactory_impl

class os::freertos::freertosOSFactory_impl

Implementation of the FreeRTOS OS Factory For API documentation, see embvm::embvm::VirtualOSFactory.

Public Member Functions

 freertosOSFactory_impl ()=default
 
 ~freertosOSFactory_impl ()=default
 

Static Public Member Functions

static embvm::VirtualConditionVariablecreateConditionVariable_impl () noexcept
 
static embvm::VirtualThreadcreateThread_impl (std::string_view name, embvm::thread::func_t f, embvm::thread::input_t input, embvm::thread::priority p, size_t stack_size, void *stack_ptr) noexcept
 
static embvm::VirtualMutexcreateMutex_impl (embvm::mutex::type type=embvm::mutex::type::defaultType, embvm::mutex::mode mode=embvm::mutex::mode::defaultMode) noexcept
 
static embvm::VirtualSemaphorecreateSemaphore_impl (embvm::semaphore::mode mode, embvm::semaphore::count_t ceiling, embvm::semaphore::count_t initial_count) noexcept
 
template<typename TType >
static embvm::VirtualMessageQueue< TType > * createMessageQueue_impl (size_t queue_length) noexcept
 
static embvm::VirtualEventFlagcreateEventFlag_impl () noexcept
 
static void destroy_impl (embvm::VirtualConditionVariable *item) noexcept
 
static void destroy_impl (embvm::VirtualThread *item) noexcept
 
static void destroy_impl (embvm::VirtualMutex *item) noexcept
 
static void destroy_impl (embvm::VirtualSemaphore *item) noexcept
 
static void destroy_impl (embvm::VirtualEventFlag *item) noexcept
 

Constructor & Destructor Documentation

◆ freertosOSFactory_impl()

os::freertos::freertosOSFactory_impl::freertosOSFactory_impl ( )
default

◆ ~freertosOSFactory_impl()

os::freertos::freertosOSFactory_impl::~freertosOSFactory_impl ( )
default

Member Function Documentation

◆ createConditionVariable_impl()

embvm::VirtualConditionVariable * freertosOSFactory_impl::createConditionVariable_impl ( )
staticnoexcept

◆ createEventFlag_impl()

embvm::VirtualEventFlag * freertosOSFactory_impl::createEventFlag_impl ( )
staticnoexcept

◆ createMessageQueue_impl()

template<typename TType >
static embvm::VirtualMessageQueue<TType>* os::freertos::freertosOSFactory_impl::createMessageQueue_impl ( size_t  queue_length)
inlinestaticnoexcept

◆ createMutex_impl()

embvm::VirtualMutex * freertosOSFactory_impl::createMutex_impl ( embvm::mutex::type  type = embvm::mutex::type::defaultType,
embvm::mutex::mode  mode = embvm::mutex::mode::defaultMode 
)
staticnoexcept

References type.

◆ createSemaphore_impl()

embvm::VirtualSemaphore * freertosOSFactory_impl::createSemaphore_impl ( embvm::semaphore::mode  mode,
embvm::semaphore::count_t  ceiling,
embvm::semaphore::count_t  initial_count 
)
staticnoexcept

◆ createThread_impl()

embvm::VirtualThread * freertosOSFactory_impl::createThread_impl ( std::string_view  name,
embvm::thread::func_t  f,
embvm::thread::input_t  input,
embvm::thread::priority  p,
size_t  stack_size,
void *  stack_ptr 
)
staticnoexcept

References p.

◆ destroy_impl() [1/5]

void freertosOSFactory_impl::destroy_impl ( embvm::VirtualConditionVariable item)
staticnoexcept

References assert.

◆ destroy_impl() [2/5]

void freertosOSFactory_impl::destroy_impl ( embvm::VirtualThread item)
staticnoexcept

References assert.

◆ destroy_impl() [3/5]

void freertosOSFactory_impl::destroy_impl ( embvm::VirtualMutex item)
staticnoexcept

References assert.

◆ destroy_impl() [4/5]

void freertosOSFactory_impl::destroy_impl ( embvm::VirtualSemaphore item)
staticnoexcept

References assert.

◆ destroy_impl() [5/5]

void freertosOSFactory_impl::destroy_impl ( embvm::VirtualEventFlag item)
staticnoexcept

References assert.

Typedef Documentation

◆ thread_exit_t

using os::freertos::thread_exit_t = typedef void (*)(void*)

Function Documentation

◆ register_threadexit_func()

void os::freertos::register_threadexit_func ( thread_exit_t  atexit)
noexcept

References assert, atexit(), and exit_func_.

◆ startScheduler()

void os::freertos::startScheduler ( )
noexcept

Call this function to start the FreeRTOS scheduler.

We recommend placing this in the platform init() function.

Referenced by nRF52DK_FrameworkDemoPlatform::initOS_().

Variable Documentation

◆ FREERTOS_STACK_MIN

constexpr size_t os::freertos::FREERTOS_STACK_MIN = (1 * 1024)
inlinestatic