Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventFlags docs update #8514

Merged
merged 2 commits into from Oct 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 24 additions & 22 deletions rtos/EventFlags.h
Expand Up @@ -37,73 +37,75 @@ namespace rtos {
* @{
*/

/** The EventFlags class is used to signal or wait for an arbitrary event or events.
/** The EventFlags class is used to control event flags or wait for event flags other threads control.

@note
EventFlags support 31 flags so the MSB flag is ignored, it is used to return an error code (@a osFlagsError)
EventFlags support 31 flags. The MSB flag is ignored. It is used to return an error code (@a osFlagsError).

@note
Memory considerations: The EventFlags control structures will be created on current thread's stack, both for the mbed OS
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).
*/
class EventFlags : private mbed::NonCopyable<EventFlags> {
public:
/** Create and Initialize an EventFlags object
/** Create and initialize an EventFlags object.
*
* @note You cannot call this function from ISR context.
*/
EventFlags();

/** Create and Initialize a EventFlags object
/** Create and initialize an EventFlags object.

@param 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(const char *name);

/** Set the specified Event Flags.
@param flags specifies the flags that shall be set.
@return event flags after setting or error code if highest bit set (@a osFlagsError).
/** Set the specified event flags.
@param flags the flags that will be set.
@return event flags after setting or error code if highest bit set (see @a osFlagsError for details).

@note This function may be called from ISR context.
*/
uint32_t set(uint32_t flags);

/** Clear the specified Event Flags.
@param flags specifies the flags that shall be cleared. (default: 0x7fffffff - all flags)
@return event flags before clearing or error code if highest bit set (@a osFlagsError).
/** Clear the specified event flags.
@param flags the flags that will be cleared (default: 0x7fffffff -- all flags).
@return event flags before clearing or error code if highest bit set (see @a osFlagsError for details).

@note You may call this function from ISR context.
*/
uint32_t clear(uint32_t flags = 0x7fffffff);

/** Get the currently set Event Flags.
@return set event flags.
/** Get the currently set event flags.
@return current event flags.

@note You may call this function from ISR context.
*/
uint32_t get() const;

/** Wait for all of the specified event flags to become signaled.
@param flags specifies the flags to wait for.
@param timeout timeout value or 0 in case of no time-out. (default: osWaitForever)
@param clear specifies wether to clear the flags after waiting for them. (default: true)
@return event flags before clearing or error code if highest bit set (@a osFlagsError).
@param flags the flags to wait for (default: 0 -- no flags).
@param timeout timeout value or 0 in case of no time-out (default: osWaitForever).
@param clear clear specified event flags after waiting for them (default: true).
@return event flags before clearing or error code if highest bit set (see @a osFlagsError for details).

@note You may call this function from ISR context if the timeout parameter is set to 0.
*/
uint32_t wait_all(uint32_t flags = 0, uint32_t timeout = osWaitForever, bool clear = true);

/** Wait for any of the specified event flags to become signaled.
@param flags specifies the flags to wait for. (default: 0)
@param timeout timeout value or 0 in case of no time-out. (default: osWaitForever)
@param clear specifies wether to clear the flags after waiting for them. (default: true)
@return event flags before clearing or error code if highest bit set (@a osFlagsError).
@param flags the flags to wait for (default: 0 -- no flags).
@param timeout timeout value or 0 in case of no timeout (default: osWaitForever).
@param clear clear specified event flags after waiting for them (default: true).
@return event flags before clearing or error code if highest bit set (see @a osFlagsError for details).

@note This function may be called from ISR context if the timeout parameter is set to 0.
*/
uint32_t wait_any(uint32_t flags = 0, uint32_t timeout = osWaitForever, bool clear = true);

/** Event flags destructor
/** EventFlags destructor.

@note You cannot call this function from ISR context.
*/
Expand Down