ChibiOS  21.6.0
chevt.h File Reference

Nil RTOS events header file. More...

Go to the source code of this file.

Data Structures

struct  event_listener
 Event Listener structure. More...
 
struct  event_source
 Event Source structure. More...
 

Macros

#define ALL_EVENTS   ((eventmask_t)-1)
 All events allowed mask. More...
 
#define EVENT_MASK(eid)   ((eventmask_t)1 << (eventmask_t)(eid))
 Returns an event mask from an event identifier. More...
 
#define _EVENTSOURCE_DATA(name)   {(event_listener_t *)(&name)}
 Data part of a static event source initializer. More...
 
#define EVENTSOURCE_DECL(name)   event_source_t name = _EVENTSOURCE_DATA(name)
 Static event source initializer. More...
 
Macro Functions
#define chEvtObjectInit(esp)
 Initializes an Event Source. More...
 
#define chEvtRegisterMask(esp, elp, events)   chEvtRegisterMaskWithFlags(esp, elp, events, (eventflags_t)-1)
 Registers an Event Listener on an Event Source. More...
 
#define chEvtRegister(esp, elp, event)   chEvtRegisterMask(esp, elp, EVENT_MASK(event))
 Registers an Event Listener on an Event Source. More...
 
#define chEvtIsListeningI(esp)   (bool)((esp) != (event_source_t *)(esp)->next)
 Verifies if there is at least one event_listener_t registered. More...
 
#define chEvtBroadcast(esp)   chEvtBroadcastFlags(esp, (eventflags_t)0)
 Signals all the Event Listeners registered on the specified Event Source. More...
 
#define chEvtBroadcastI(esp)   chEvtBroadcastFlagsI(esp, (eventflags_t)0)
 Signals all the Event Listeners registered on the specified Event Source. More...
 
#define chEvtAddEventsI(events)   (nil.current->epmask |= events)
 Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or chEvtSignal(). More...
 
#define chEvtGetEventsX(void)   (nil.current->epmask)
 Returns the events mask. More...
 
#define chEvtWaitOne(events)   chEvtWaitOneTimeout(events, TIME_INFINITE)
 Waits for exactly one of the specified events. More...
 
#define chEvtWaitAny(events)   chEvtWaitAnyTimeout(events, TIME_INFINITE)
 Waits for any of the specified events. More...
 
#define chEvtWaitAll(events)   chEvtWaitAllTimeout(events, TIME_INFINITE)
 Waits for all the specified events. More...
 

Typedefs

typedef struct event_source event_source_t
 Event Source structure. More...
 
typedef void(* evhandler_t) (eventid_t id)
 Event Handler callback function. More...
 

Functions

void chEvtRegisterMaskWithFlags (event_source_t *esp, event_listener_t *elp, eventmask_t events, eventflags_t wflags)
 Registers an Event Listener on an Event Source. More...
 
void chEvtUnregister (event_source_t *esp, event_listener_t *elp)
 Unregisters an Event Listener from its Event Source. More...
 
eventmask_t chEvtGetAndClearEventsI (eventmask_t events)
 Clears the pending events specified in the events mask. More...
 
eventmask_t chEvtGetAndClearEvents (eventmask_t events)
 Clears the pending events specified in the events mask. More...
 
eventmask_t chEvtAddEvents (eventmask_t events)
 Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or chEvtSignal(). More...
 
eventflags_t chEvtGetAndClearFlags (event_listener_t *elp)
 Returns the flags associated to an event_listener_t. More...
 
eventflags_t chEvtGetAndClearFlagsI (event_listener_t *elp)
 Returns the unmasked flags associated to an event_listener_t. More...
 
void chEvtSignal (thread_t *tp, eventmask_t events)
 Adds a set of event flags directly to the specified thread_t. More...
 
void chEvtSignalI (thread_t *tp, eventmask_t events)
 Adds a set of event flags directly to the specified thread_t. More...
 
void chEvtBroadcastFlags (event_source_t *esp, eventflags_t flags)
 Signals all the Event Listeners registered on the specified Event Source. More...
 
void chEvtBroadcastFlagsI (event_source_t *esp, eventflags_t flags)
 Signals all the Event Listeners registered on the specified Event Source. More...
 
void chEvtDispatch (const evhandler_t *handlers, eventmask_t events)
 Invokes the event handlers associated to an event flags mask. More...
 
eventmask_t chEvtWaitOneTimeout (eventmask_t events, sysinterval_t timeout)
 Waits for exactly one of the specified events. More...
 
eventmask_t chEvtWaitAnyTimeout (eventmask_t mask, sysinterval_t timeout)
 Waits for any of the specified events. More...
 
eventmask_t chEvtWaitAllTimeout (eventmask_t mask, sysinterval_t timeout)
 Waits for all the specified events. More...
 

Detailed Description

Nil RTOS events header file.

Definition in file chevt.h.