Events
SPDX-License-Identifier: Apache-2.0
1. Event Object Definition
The Zephyr RTOS shall provide a mechanism to define and initialize an event object at compile time.
The Zephyr RTOS shall provide a mechanism to initialize an event object at run time.
The Zephyr RTOS shall provide an event object capable of tracking up to 32 distinct events.
2. Delivering Events
The Zephyr RTOS shall provide a mechanism to post one or more events to an event object, merging them with the events currently tracked by the event object.
The Zephyr RTOS shall provide a mechanism to set the events tracked by an event object to a specified value, replacing the events currently tracked by the event object.
The Zephyr RTOS shall provide a mechanism to set the events selected by a mask to specified values, leaving the events tracked by the event object that are not selected by the mask unchanged.
The Zephyr RTOS shall provide a mechanism to clear specified events tracked by an event object.
When the events tracked by an event object are modified, the Zephyr RTOS shall report the value that the modified events had before the operation.
When a modification of the events tracked by an event object satisfies the waiting condition of a thread waiting on that event object, the Zephyr RTOS shall unpend that thread.
3. Waiting for Events
The Zephyr RTOS shall provide a mechanism for a thread to wait until any of a specified set of events is tracked by an event object.
The Zephyr RTOS shall provide a mechanism for a thread to wait until all of a specified set of events are tracked by an event object.
When a thread waits on an event object, the Zephyr RTOS shall accept a timeout that specifies the maximum time to wait for the desired set of events.
When the timeout of a thread waiting on an event object elapses before the desired set of events is satisfied, the Zephyr RTOS shall report that no matching events were delivered.
When a thread waiting on an event object completes its wait successfully, the Zephyr RTOS shall report the set of events that matched the waiting condition.
When a thread waits on an event object, the Zephyr RTOS shall accept an option to clear the events tracked by the event object before the wait begins.