Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Data Structures | |
struct | k_event |
Event Structure. More... | |
Macros | |
#define | K_EVENT_DEFINE(name) |
Statically define and initialize an event object. | |
Functions | |
void | k_event_init (struct k_event *event) |
Initialize an event object. | |
uint32_t | k_event_post (struct k_event *event, uint32_t events) |
Post one or more events to an event object. | |
uint32_t | k_event_set (struct k_event *event, uint32_t events) |
Set the events in an event object. | |
uint32_t | k_event_set_masked (struct k_event *event, uint32_t events, uint32_t events_mask) |
Set or clear the events in an event object. | |
uint32_t | k_event_clear (struct k_event *event, uint32_t events) |
Clear the events in an event object. | |
uint32_t | k_event_wait (struct k_event *event, uint32_t events, bool reset, k_timeout_t timeout) |
Wait for any of the specified events. | |
uint32_t | k_event_wait_all (struct k_event *event, uint32_t events, bool reset, k_timeout_t timeout) |
Wait for all of the specified events. | |
static uint32_t | k_event_test (struct k_event *event, uint32_t events_mask) |
Test the events currently tracked in the event object. | |
#define K_EVENT_DEFINE | ( | name | ) |
#include <zephyr/kernel.h>
Statically define and initialize an event object.
The event can be accessed outside the module where it is defined using:
name | Name of the event object. |
#include <zephyr/kernel.h>
Clear the events in an event object.
This routine clears (resets) the specified events stored in an event object.
event | Address of the event object |
events | Set of events to clear in event |
Previous | value of the events in event |
void k_event_init | ( | struct k_event * | event | ) |
#include <zephyr/kernel.h>
Initialize an event object.
This routine initializes an event object, prior to its first use.
event | Address of the event object. |
#include <zephyr/kernel.h>
Post one or more events to an event object.
This routine posts one or more events to an event object. All tasks waiting on the event object event whose waiting conditions become met by this posting immediately unpend.
Posting differs from setting in that posted events are merged together with the current set of events tracked by the event object.
event | Address of the event object |
events | Set of events to post to event |
Previous | value of the events in event |
#include <zephyr/kernel.h>
Set the events in an event object.
This routine sets the events stored in event object to the specified value. All tasks waiting on the event object event whose waiting conditions become met by this immediately unpend.
Setting differs from posting in that set events replace the current set of events tracked by the event object.
event | Address of the event object |
events | Set of events to set in event |
Previous | value of the events in event |
#include <zephyr/kernel.h>
Set or clear the events in an event object.
This routine sets the events stored in event object to the specified value. All tasks waiting on the event object event whose waiting conditions become met by this immediately unpend. Unlike k_event_set, this routine allows specific event bits to be set and cleared as determined by the mask.
event | Address of the event object |
events | Set of events to set/clear in event |
events_mask | Mask to be applied to events |
Previous | value of the events in events_mask |
#include <zephyr/kernel.h>
Test the events currently tracked in the event object.
event | Address of the event object |
events_mask | Set of desired events to test |
Current | value of events in events_mask |
uint32_t k_event_wait | ( | struct k_event * | event, |
uint32_t | events, | ||
bool | reset, | ||
k_timeout_t | timeout ) |
#include <zephyr/kernel.h>
Wait for any of the specified events.
This routine waits on event object event until any of the specified events have been delivered to the event object, or the maximum wait time timeout has expired. A thread may wait on up to 32 distinctly numbered events that are expressed as bits in a single 32-bit word.
event | Address of the event object |
events | Set of desired events on which to wait |
reset | If true, clear the set of events tracked by the event object before waiting. If false, do not clear the events. |
timeout | Waiting period for the desired set of events or one of the special values K_NO_WAIT and K_FOREVER. |
set | of matching events upon success |
0 | if matching events were not received within the specified time |
uint32_t k_event_wait_all | ( | struct k_event * | event, |
uint32_t | events, | ||
bool | reset, | ||
k_timeout_t | timeout ) |
#include <zephyr/kernel.h>
Wait for all of the specified events.
This routine waits on event object event until all of the specified events have been delivered to the event object, or the maximum wait time timeout has expired. A thread may wait on up to 32 distinctly numbered events that are expressed as bits in a single 32-bit word.
event | Address of the event object |
events | Set of desired events on which to wait |
reset | If true, clear the set of events tracked by the event object before waiting. If false, do not clear the events. |
timeout | Waiting period for the desired set of events or one of the special values K_NO_WAIT and K_FOREVER. |
set | of matching events upon success |
0 | if matching events were not received within the specified time |