Go to the documentation of this file.
34 #if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
92 #define ALL_EVENTS ((eventmask_t)-1)
97 #define EVENT_MASK(eid) ((eventmask_t)1 << (eventmask_t)(eid))
105 #define __EVENTSOURCE_DATA(name) {(event_listener_t *)(&name)}
114 #define EVENTSOURCE_DECL(name) event_source_t name = __EVENTSOURCE_DATA(name)
142 #if (CH_CFG_OPTIMIZE_SPEED == TRUE) || (CH_CFG_USE_EVENTS_TIMEOUT == FALSE)
147 #if CH_CFG_USE_EVENTS_TIMEOUT == TRUE
156 #if (CH_CFG_OPTIMIZE_SPEED == FALSE) && (CH_CFG_USE_EVENTS_TIMEOUT == TRUE)
157 #define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE)
158 #define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE)
159 #define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE)
eventmask_t chEvtGetAndClearEvents(eventmask_t events)
Clears the pending events specified in the events mask.
eventmask_t chEvtAddEvents(eventmask_t events)
Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or c...
void chEvtSignalI(thread_t *tp, eventmask_t events)
Adds a set of event flags directly to the specified thread_t.
void chEvtSignal(thread_t *tp, eventmask_t events)
Adds a set of event flags directly to the specified thread_t.
eventflags_t chEvtGetAndClearFlags(event_listener_t *elp)
Returns the flags associated to an event_listener_t.
void chEvtBroadcastFlags(event_source_t *esp, eventflags_t flags)
Signals all the Event Listeners registered on the specified Event Source.
eventmask_t chEvtWaitAny(eventmask_t events)
Waits for any of the specified events.
eventmask_t chEvtWaitAllTimeout(eventmask_t events, sysinterval_t timeout)
Waits for all the specified events.
eventmask_t chEvtGetAndClearEventsI(eventmask_t events)
Clears the pending events specified in the events mask.
static eventmask_t chEvtGetEventsX(void)
Returns the events mask.
#define __sch_get_currthread()
Current thread pointer get macro.
eventflags_t flags
Flags added to the listener by the event source.
static void chEvtRegisterMask(event_source_t *esp, event_listener_t *elp, eventmask_t events)
Registers an Event Listener on an Event Source.
static void chEvtBroadcastI(event_source_t *esp)
Signals all the Event Listeners registered on the specified Event Source.
thread_t * listener
Thread interested in the event source.
Event Listener structure.
Structure representing a thread.
static void chEvtBroadcast(event_source_t *esp)
Signals all the Event Listeners registered on the specified Event Source.
static eventmask_t chEvtAddEventsI(eventmask_t events)
Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or c...
struct event_source event_source_t
Event Source structure.
void chEvtUnregister(event_source_t *esp, event_listener_t *elp)
Unregisters an Event Listener from its Event Source.
eventmask_t chEvtWaitAnyTimeout(eventmask_t events, sysinterval_t timeout)
Waits for any of the specified events.
eventflags_t wflags
Flags that this listener interested in.
static bool chEvtIsListeningI(event_source_t *esp)
Verifies if there is at least one event_listener_t registered.
eventmask_t chEvtWaitOne(eventmask_t events)
Waits for exactly one of the specified events.
eventmask_t events
Events to be set in the listening thread.
eventmask_t chEvtWaitAll(eventmask_t events)
Waits for all the specified events.
uint64_t sysinterval_t
Type of time interval.
#define EVENT_MASK(eid)
Returns an event mask from an event identifier.
static void chEvtObjectInit(event_source_t *esp)
Initializes an Event Source.
void chEvtRegisterMaskWithFlagsI(event_source_t *esp, event_listener_t *elp, eventmask_t events, eventflags_t wflags)
Registers an Event Listener on an Event Source.
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags)
Signals all the Event Listeners registered on the specified Event Source.
event_listener_t * next
Next Event Listener registered on the event source.
static void chEvtRegister(event_source_t *esp, event_listener_t *elp, eventid_t event)
Registers an Event Listener on an Event Source.
void chEvtRegisterMaskWithFlags(event_source_t *esp, event_listener_t *elp, eventmask_t events, eventflags_t wflags)
Registers an Event Listener on an Event Source.
void(* evhandler_t)(eventid_t id)
Event Handler callback function.
eventflags_t chEvtGetAndClearFlagsI(event_listener_t *elp)
Returns the unmasked flags associated to an event_listener_t.
event_listener_t * next
First Event Listener registered on the Event Source.
void chEvtDispatch(const evhandler_t *handlers, eventmask_t events)
Invokes the event handlers associated to an event flags mask.
eventmask_t chEvtWaitOneTimeout(eventmask_t events, sysinterval_t timeout)
Waits for exactly one of the specified events.