ChibiOS/RT Logo ChibiOS/RT

Architecture - Reference Manual - Guides

chibios_rt::Event Class Reference

Class encapsulating an event source. More...

#include <ch.hpp>

Public Member Functions

 Event (void)
 Event constructor.
void Register (EventListener *elp, eventid_t eid)
 Registers a listener on the event source.
void RegisterMask (EventListener *elp, eventmask_t emask)
 Registers an Event Listener on an Event Source.
void Unregister (EventListener *elp)
 Unregisters a listener.
void Broadcast (void)
 Broadcasts an event.

Static Public Member Functions

static eventmask_t Clear (eventmask_t mask)
 Clears specified events from the pending events mask.
static eventmask_t Pend (eventmask_t mask)
 Makes an events mask pending in the current thread.
static void Dispatch (const evhandler_t handlers[], eventmask_t mask)
 Invokes the event handlers associated with a mask.
static eventmask_t WaitOne (eventmask_t ewmask)
 Waits for a single event.
static eventmask_t WaitAny (eventmask_t ewmask)
 Waits for any of the specified events.
static eventmask_t WaitAll (eventmask_t ewmask)
 Waits for all the specified event flags then clears them.
static eventmask_t WaitOneTimeout (eventmask_t ewmask, systime_t time)
 Waits for a single event.
static eventmask_t WaitAnyTimeout (eventmask_t ewmask, systime_t time)
 Waits for any of the specified events.
static eventmask_t WaitAllTimeout (eventmask_t ewmask, systime_t time)
 Waits for all the specified event flags then clears them.

Data Fields

struct::EventSource event
 Embedded EventSource structure.

Detailed Description

Class encapsulating an event source.

Definition at line 465 of file ch.hpp.


Constructor & Destructor Documentation

chibios_rt::Event::Event ( void   ) 

Event constructor.

The embedded EventSource structure is initialized.

Definition at line 267 of file ch.cpp.

References chEvtInit, and event.


Member Function Documentation

void chibios_rt::Event::Register ( EventListener elp,
eventid_t  eid 
)

Registers a listener on the event source.

Parameters:
elp pointer to the EventListener structure
eid numeric identifier assigned to the Event Listener

Definition at line 272 of file ch.cpp.

References chEvtRegister, and event.

void chibios_rt::Event::RegisterMask ( EventListener elp,
eventmask_t  emask 
)

Registers an Event Listener on an Event Source.

Parameters:
elp pointer to the EventListener structure
emask the mask of event flags to be pended to the thread when the event source is broadcasted
Note:
Multiple Event Listeners can specify the same bits to be pended.

Definition at line 277 of file ch.cpp.

References chEvtRegisterMask(), and event.

Here is the call graph for this function:

void chibios_rt::Event::Unregister ( EventListener elp  ) 

Unregisters a listener.

The specified listeners is no more signaled by the event source.

Parameters:
elp the listener to be unregistered

Definition at line 282 of file ch.cpp.

References chEvtUnregister(), and event.

Here is the call graph for this function:

void chibios_rt::Event::Broadcast ( void   ) 

Broadcasts an event.

All the listeners registered on the event source are signaled.

Definition at line 287 of file ch.cpp.

References chEvtBroadcast(), and event.

Here is the call graph for this function:

eventmask_t chibios_rt::Event::Clear ( eventmask_t  mask  )  [static]

Clears specified events from the pending events mask.

Parameters:
mask the events to be cleared
Returns:
The pending events that were cleared.

Definition at line 292 of file ch.cpp.

References chEvtClear().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::Pend ( eventmask_t  mask  )  [static]

Makes an events mask pending in the current thread.

This functon is much faster than using Broadcast().

Parameters:
mask the events to be pended
Returns:
The current pending events mask.

Definition at line 297 of file ch.cpp.

References chEvtPend().

Here is the call graph for this function:

void chibios_rt::Event::Dispatch ( const evhandler_t  handlers[],
eventmask_t  mask 
) [static]

Invokes the event handlers associated with a mask.

Parameters:
mask mask of the events to be dispatched
handlers an array of evhandler_t. The array must be have indexes from zero up the higher registered event identifier.

Definition at line 302 of file ch.cpp.

References chEvtDispatch().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitOne ( eventmask_t  ewmask  )  [static]

Waits for a single event.

A pending event among those specified in ewmask is selected, cleared and its mask returned.

Parameters:
ewmask mask of the events that the function should wait for, ALL_EVENTS enables all the events
Returns:
The mask of the lowest id served and cleared event.
Note:
One and only one event is served in the function, the one with the lowest event id. The function is meant to be invoked into a loop in order to serve all the pending events.
This means that Event Listeners with a lower event identifier have an higher priority.

Definition at line 307 of file ch.cpp.

References chEvtWaitOne().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitAny ( eventmask_t  ewmask  )  [static]

Waits for any of the specified events.

The function waits for any event among those specified in ewmask to become pending then the events are cleared and returned.

Parameters:
ewmask mask of the events that the function should wait for, ALL_EVENTS enables all the events
Returns:
The mask of the served and cleared events.

Definition at line 312 of file ch.cpp.

References chEvtWaitAny().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitAll ( eventmask_t  ewmask  )  [static]

Waits for all the specified event flags then clears them.

The function waits for all the events specified in ewmask to become pending then the events are cleared and returned.

Parameters:
ewmask mask of the event ids that the function should wait for
Returns:
The mask of the served and cleared events.

Definition at line 317 of file ch.cpp.

References chEvtWaitAll().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitOneTimeout ( eventmask_t  ewmask,
systime_t  time 
) [static]

Waits for a single event.

A pending event among those specified in ewmask is selected, cleared and its mask returned.

Parameters:
ewmask mask of the events that the function should wait for, ALL_EVENTS enables all the events
time the number of ticks before the operation timouts
Returns:
The mask of the lowest id served and cleared event.
Return values:
0 if the specified timeout expired.
Note:
One and only one event is served in the function, the one with the lowest event id. The function is meant to be invoked into a loop in order to serve all the pending events.
This means that Event Listeners with a lower event identifier have an higher priority.

Definition at line 323 of file ch.cpp.

References chEvtWaitOneTimeout().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitAnyTimeout ( eventmask_t  ewmask,
systime_t  time 
) [static]

Waits for any of the specified events.

The function waits for any event among those specified in ewmask to become pending then the events are cleared and returned.

Parameters:
ewmask mask of the events that the function should wait for, ALL_EVENTS enables all the events
time the number of ticks before the operation timouts
Returns:
The mask of the served and cleared events.
Return values:
0 if the specified timeout expired.

Definition at line 328 of file ch.cpp.

References chEvtWaitAnyTimeout().

Here is the call graph for this function:

eventmask_t chibios_rt::Event::WaitAllTimeout ( eventmask_t  ewmask,
systime_t  time 
) [static]

Waits for all the specified event flags then clears them.

The function waits for all the events specified in ewmask to become pending then the events are cleared and returned.

Parameters:
ewmask mask of the event ids that the function should wait for
time the number of ticks before the operation timouts
Returns:
The mask of the served and cleared events.
Return values:
0 if the specified timeout expired.

Definition at line 333 of file ch.cpp.

References chEvtWaitAllTimeout().

Here is the call graph for this function:


Field Documentation

Embedded EventSource structure.

Definition at line 470 of file ch.hpp.

Referenced by Broadcast(), Event(), Register(), RegisterMask(), and Unregister().


Generated on Sun Jul 11 13:13:43 2010 for ChibiOS/RT by doxygen 1.6.3