The EventFlags class is used to control event flags or wait for event flags other threads control.
More...
#include <EventFlags.h>
|
| EventFlags () |
| Create and initialize an EventFlags object. More...
|
|
| EventFlags (const char *name) |
| Create and initialize an EventFlags object. More...
|
|
uint32_t | set (uint32_t flags) |
| Set the specified event flags. More...
|
|
uint32_t | clear (uint32_t flags=0x7fffffff) |
| Clear the specified event flags. More...
|
|
uint32_t | get () const |
| Get the currently set event flags. More...
|
|
uint32_t | wait_all (uint32_t flags=0, uint32_t millisec=osWaitForever, bool clear=true) |
| Wait for all of the specified event flags to become signaled. More...
|
|
uint32_t | wait_all_for (uint32_t flags, Kernel::Clock::duration_u32 rel_time, bool clear=true) |
| Wait for all of the specified event flags to become signaled. More...
|
|
uint32_t | wait_all_until (uint32_t flags, Kernel::Clock::time_point abs_time, bool clear=true) |
| Wait for all of the specified event flags to become signaled. More...
|
|
uint32_t | wait_any (uint32_t flags=0, uint32_t millisec=osWaitForever, bool clear=true) |
| Wait for any of the specified event flags to become signaled. More...
|
|
uint32_t | wait_any_for (uint32_t flags, Kernel::Clock::duration_u32 rel_time, bool clear=true) |
| Wait for any of the specified event flags to become signaled. More...
|
|
uint32_t | wait_any_until (uint32_t flags, Kernel::Clock::time_point abs_time, bool clear=true) |
| Wait for any of the specified event flags to become signaled. More...
|
|
| ~EventFlags () |
| EventFlags destructor. More...
|
|
The EventFlags class is used to control event flags or wait for event flags other threads control.
- Note
- EventFlags support 31 flags. The MSB flag is ignored. It is used to return an error code (osFlagsError).
-
Memory considerations: The EventFlags control structures will be created on the current thread's stack, both for the Mbed OS and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
Definition at line 53 of file EventFlags.h.
◆ EventFlags() [1/2]
Create and initialize an EventFlags object.
- Note
- You cannot call this function from ISR context.
◆ EventFlags() [2/2]
Create and initialize an EventFlags object.
- Parameters
-
name | name 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.
◆ ~EventFlags()
EventFlags destructor.
- Note
- You cannot call this function from ISR context.
◆ set()
uint32_t set |
( |
uint32_t |
flags | ) |
|
Set the specified event flags.
- Parameters
-
flags | the flags that will be set. |
- Returns
- event flags after setting or error code if highest bit set (see osFlagsError for details).
- Note
- This function may be called from ISR context.
◆ clear()
uint32_t clear |
( |
uint32_t |
flags = 0x7fffffff | ) |
|
Clear the specified event flags.
- Parameters
-
flags | the flags that will be cleared (default: 0x7fffffff – all flags). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- You may call this function from ISR context.
◆ get()
Get the currently set event flags.
- Returns
- current event flags.
- Note
- You may call this function from ISR context.
◆ wait_all()
uint32_t wait_all |
( |
uint32_t |
flags = 0 , |
|
|
uint32_t |
millisec = osWaitForever , |
|
|
bool |
clear = true |
|
) |
| |
Wait for all of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for (default: 0 – no flags). |
millisec | timeout value (default: osWaitForever). |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- You may call this function from ISR context if the millisec parameter is set to 0.
◆ wait_all_for()
uint32_t wait_all_for |
( |
uint32_t |
flags, |
|
|
Kernel::Clock::duration_u32 |
rel_time, |
|
|
bool |
clear = true |
|
) |
| |
Wait for all of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for. |
rel_time | timeout value. Use Kernel::wait_for_u32_forever to wait forever. |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- You may call this function from ISR context if the rel_time parameter is set to 0.
◆ wait_all_until()
uint32_t wait_all_until |
( |
uint32_t |
flags, |
|
|
Kernel::Clock::time_point |
abs_time, |
|
|
bool |
clear = true |
|
) |
| |
Wait for all of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for. |
abs_time | timeout value. |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- You cannot call this function from ISR context.
◆ wait_any()
uint32_t wait_any |
( |
uint32_t |
flags = 0 , |
|
|
uint32_t |
millisec = osWaitForever , |
|
|
bool |
clear = true |
|
) |
| |
Wait for any of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for (default: 0 – no flags). |
millisec | timeout value (default: osWaitForever). |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- This function may be called from ISR context if the millisec parameter is set to 0.
◆ wait_any_for()
uint32_t wait_any_for |
( |
uint32_t |
flags, |
|
|
Kernel::Clock::duration_u32 |
rel_time, |
|
|
bool |
clear = true |
|
) |
| |
Wait for any of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for. |
rel_time | timeout value. Use Kernel::wait_for_u32_forever to wait forever. |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- This function may be called from ISR context if the millisec parameter is set to 0.
◆ wait_any_until()
uint32_t wait_any_until |
( |
uint32_t |
flags, |
|
|
Kernel::Clock::time_point |
abs_time, |
|
|
bool |
clear = true |
|
) |
| |
Wait for any of the specified event flags to become signaled.
- Parameters
-
flags | the flags to wait for. |
abs_time | timeout value. |
clear | clear specified event flags after waiting for them (default: true). |
- Returns
- event flags before clearing or error code if highest bit set (see osFlagsError for details).
- Note
- You cannot call this function from ISR context.