Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
rtos::EventFlags Class Reference

#include <EventFlags.h>

Inheritance diagram for rtos::EventFlags:
mbed::NonCopyable< EventFlags >

Public Member Functions

 EventFlags ()
 
 EventFlags (const char *name)
 
uint32_t set (uint32_t flags)
 
uint32_t clear (uint32_t flags=0x7fffffff)
 
uint32_t get () const
 
uint32_t wait_all (uint32_t flags=0, uint32_t timeout=osWaitForever, bool clear=true)
 
uint32_t wait_any (uint32_t flags=0, uint32_t timeout=osWaitForever, bool clear=true)
 
 ~EventFlags ()
 

Detailed Description

The EventFlags class is used to signal or wait for an arbitrary event or events.

Note
EventFlags support 31 flags so the MSB flag is ignored, it is used to return an error code (osFlagsError)
Memory considerations: The EventFlags control structures will be created on current thread's stack, both for the mbed OS and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).

Constructor & Destructor Documentation

rtos::EventFlags::EventFlags ( )

Create and Initialize an EventFlags object

Note
You cannot call this function from ISR context.
rtos::EventFlags::EventFlags ( const char *  name)

Create and Initialize a EventFlags object

Parameters
namename to be used for this EventFlags. It has to stay allocated for the lifetime of the thread.
Note
You cannot call this function from ISR context.
rtos::EventFlags::~EventFlags ( )

Event flags destructor

Note
You cannot call this function from ISR context.

Member Function Documentation

uint32_t rtos::EventFlags::clear ( uint32_t  flags = 0x7fffffff)

Clear the specified Event Flags.

Parameters
flagsspecifies the flags that shall be cleared. (default: 0x7fffffff - all flags)
Returns
event flags before clearing or error code if highest bit set (osFlagsError).
Note
You may call this function from ISR context.
uint32_t rtos::EventFlags::get ( ) const

Get the currently set Event Flags.

Returns
set event flags.
Note
You may call this function from ISR context.
uint32_t rtos::EventFlags::set ( uint32_t  flags)

Set the specified Event Flags.

Parameters
flagsspecifies the flags that shall be set.
Returns
event flags after setting or error code if highest bit set (osFlagsError).
Note
This function may be called from ISR context.
uint32_t rtos::EventFlags::wait_all ( uint32_t  flags = 0,
uint32_t  timeout = osWaitForever,
bool  clear = true 
)

Wait for all of the specified event flags to become signaled.

Parameters
flagsspecifies the flags to wait for.
timeouttimeout value or 0 in case of no time-out. (default: osWaitForever)
clearspecifies wether to clear the flags after waiting for them. (default: true)
Returns
event flags before clearing or error code if highest bit set (osFlagsError).
Note
You may call this function from ISR context if the timeout parameter is set to 0.
uint32_t rtos::EventFlags::wait_any ( uint32_t  flags = 0,
uint32_t  timeout = osWaitForever,
bool  clear = true 
)

Wait for any of the specified event flags to become signaled.

Parameters
flagsspecifies the flags to wait for. (default: 0)
timeouttimeout value or 0 in case of no time-out. (default: osWaitForever)
clearspecifies wether to clear the flags after waiting for them. (default: true)
Returns
event flags before clearing or error code if highest bit set (osFlagsError).
Note
This function may be called from ISR context if the timeout parameter is set to 0.

The documentation for this class was generated from the following files:
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.