<p>Event Flags, Event Sources and Event Listeners. </p>
<h2>Operation mode</h2>
<p>Each thread has a mask of pending event flags inside its <code><aclass="el"href="struct_thread.html"title="Structure representing a thread.">Thread</a></code> structure. Operations defined for event flags:</p>
<ul>
<li><b>Wait</b>, the invoking thread goes to sleep until a certain AND/OR combination of event flags becomes pending.</li>
<li><b>Clear</b>, a mask of event flags is cleared from the pending events mask, the cleared event flags mask is returned (only the flags that were actually pending and then cleared).</li>
<li><b>Signal</b>, an event mask is directly ORed to the mask of the signaled thread.</li>
<li><b>Broadcast</b>, each thread registered on an Event Source is signaled with the event flags specified in its Event Listener.</li>
<li><b>Dispatch</b>, an events mask is scanned and for each bit set to one an associated handler function is invoked. Bit masks are scanned from bit zero upward.</li>
</ul>
<p>An Event Source is a special object that can be "broadcasted" by a thread or an interrupt service routine. Broadcasting an Event Source has the effect that all the threads registered on the Event Source will be signaled with an events mask.<br/>
An unlimited number of Event Sources can exists in a system and each thread can be listening on an unlimited number of them.<br/>
<br/>
In order to use the Events APIs the <code>CH_USE_EVENTS</code> option must be enabled in <code><aclass="el"href="chconf_8h.html"title="Configuration file template.">chconf.h</a></code>. </p>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Data part of a static event source initializer. <ahref="#ga00aa72be61db8d43dbca3a3ba7cecf6b"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">#define </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="group__events.html#gaeb4c660b05db4760eab6093499963314">EVENTSOURCE_DECL</a>(name) <aclass="el"href="struct_event_source.html">EventSource</a> name = _EVENTSOURCE_DATA(name)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers an Event Listener on an Event Source. <ahref="#gad478062f3e09d00e1ad8ebe65a06ec0c"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Initializes an Event Source. <ahref="#gab8d0fdc09be629dfb438c32a0523db42"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Verifies if there is at least one <code><aclass="el"href="struct_event_listener.html"title="Event Listener structure.">EventListener</a></code> registered. <ahref="#ga440eefff93d7c8f741b7572bcc24355f"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers an Event Listener on an Event Source. <ahref="#ga4002600fe552128aaf96a6a1d3ada3ee"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Unregisters an Event Listener from its Event Source. <ahref="#ga68d15e1c7e12e96edd40069a27981d38"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clears the pending events specified in the mask. <ahref="#ga76f41b9668c3f1adafc516a8f92b9cad"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Pends a set of event flags on the current thread, this is <b>much</b> faster than using <code><aclass="el"href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4"title="Signals all the Event Listeners registered on the specified Event Source.">chEvtBroadcast()</a></code> or <code><aclass="el"href="group__events.html#ga75a812ae99ce83a3689f51d797a038de"title="Pends a set of event flags on the specified Thread.">chEvtSignal()</a></code>. <ahref="#ga94f14b6063f42b9be79a7dabde18232d"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Pends a set of event flags on the specified <code><aclass="el"href="struct_thread.html"title="Structure representing a thread.">Thread</a></code>. <ahref="#ga75a812ae99ce83a3689f51d797a038de"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Pends a set of event flags on the specified <code><aclass="el"href="struct_thread.html"title="Structure representing a thread.">Thread</a></code>. <ahref="#ga6c219038c3e618e2142c6e1601997907"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Signals all the Event Listeners registered on the specified Event Source. <ahref="#ga44015af4dd20f74b0f73824ff1c1b2f4"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Signals all the Event Listeners registered on the specified Event Source. <ahref="#gaa24d9bed5b676b577200c4a8ebe3b8a3"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Invokes the event handlers associated to an event flags mask. <ahref="#gaba2061f315848a8a722efcae258edc8c"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for exactly one of the specified events. <ahref="#ga2944a7fc82e7cc15537f5a7c04f457d3"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for any of the specified events. <ahref="#gaf690406ccc833e2c9235e7e2041a6715"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for all the specified events. <ahref="#ga90d702300eecee3d05f83e95b155c3ee"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for exactly one of the specified events. <ahref="#ga77651e22578713ebe355c1213286c2e9"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for any of the specified events. <ahref="#gabd731d3ed2f037b2409e370676575f8d"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Waits for all the specified events. <ahref="#ga8c5c6bf310a08cdc836d23f98a87dbf5"></a><br/></td></tr>
<td> <aclass="el"href="struct_event_source.html">EventSource</a> name = _EVENTSOURCE_DATA(name)</td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Static event source initializer. </p>
<p>Statically initialized event sources require no explicit initialization using <code><aclass="el"href="group__events.html#gab8d0fdc09be629dfb438c32a0523db42"title="Initializes an Event Source.">chEvtInit()</a></code>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>name</em> </td><td>the name of the event source variable </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8h_source.html#l00080">80</a> of file <aclass="el"href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Registers an Event Listener on an Event Source. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>Multiple Event Listeners can use the same event identifier, the listener will share the callback function.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><tdvalign="top"><tt>[out]</tt> </td><tdvalign="top"><em>elp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_listener.html"title="Event Listener structure.">EventListener</a></code> structure </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>eid</em> </td><td>numeric identifier assigned to the Event Listener. The identifier is used as index for the event callback function. The value must range between zero and the size, in bit, of the <code>eventid_t</code> type minus one. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8h_source.html#l00101">101</a> of file <aclass="el"href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#a871e59df8f46225845806ebdec4e832c">chibios_rt::Event::Register()</a>.</p>
<dlclass="note"><dt><b>Note:</b></dt><dd>Can be used with interrupts disabled or enabled.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8h_source.html#l00109">109</a> of file <aclass="el"href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Referenced by <aclass="el"href="group___c_a_n.html#gadf8c892ca4bd2544d03be8a690885aef">canObjectInit()</a>, <aclass="el"href="classchibios__rt_1_1_event.html#a4fad1d076cd31e2add80447f7980d8d2">chibios_rt::Event::Event()</a>, <aclass="el"href="group___m_a_c.html#ga34d60b00ad9794d52da6833e18c9ec70">macObjectInit()</a>, <aclass="el"href="group___m_m_c___s_p_i.html#ga44df4f9091614cab6de8d79c3c6b1a14">mmcObjectInit()</a>, and <aclass="el"href="group___s_e_r_i_a_l.html#gacb9838adcf51106f4e481f41a851cc34">sdObjectInit()</a>.</p>
<p>Verifies if there is at least one <code><aclass="el"href="struct_event_listener.html"title="Event Listener structure.">EventListener</a></code> registered. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>Can be called with interrupts disabled or enabled.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8h_source.html#l00118">118</a> of file <aclass="el"href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Registers an Event Listener on an Event Source. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>Multiple Event Listeners can specify the same bits to be pended.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>elp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_listener.html"title="Event Listener structure.">EventListener</a></code> structure </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>the mask of event flags to be pended to the thread when the event source is broadcasted </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00074">74</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>Unregisters an Event Listener from its Event Source. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>If the event listener is not registered on the specified event source then the function does nothing. </dd>
<dd>
For optimal performance it is better to perform the unregister operations in inverse order of the register operations (elements are found on top of the list).</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>elp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_listener.html"title="Event Listener structure.">EventListener</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00097">97</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <aclass="el"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <aclass="el"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <aclass="el"href="struct_event_listener.html#aa4ac59cdfd75a6fe0dc9e5ab0ba3d77b">EventListener::el_next</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#a177bc72df220068c9d620b8e9f42f2f5">chibios_rt::Event::Unregister()</a>.</p>
<p>Clears the pending events specified in the mask. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>the events to be cleared </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The pending events that were cleared. </dd></dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00120">120</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <aclass="el"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <aclass="el"href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#ae3c7092d78ac9dda43c109b356826f41">chibios_rt::Event::Clear()</a>.</p>
<p>Pends a set of event flags on the current thread, this is <b>much</b> faster than using <code><aclass="el"href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4"title="Signals all the Event Listeners registered on the specified Event Source.">chEvtBroadcast()</a></code> or <code><aclass="el"href="group__events.html#ga75a812ae99ce83a3689f51d797a038de"title="Pends a set of event flags on the specified Thread.">chEvtSignal()</a></code>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>the events to be pended </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The current pending events mask. </dd></dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00139">139</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <aclass="el"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <aclass="el"href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#aca48258fbffb54c6e19bbb9016c4cee1">chibios_rt::Event::Pend()</a>.</p>
<p>Pends a set of event flags on the specified <code><aclass="el"href="struct_thread.html"title="Structure representing a thread.">Thread</a></code>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>tp</em> </td><td>the thread to be signaled </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>the event flags set to be pended </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00155">155</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <aclass="el"href="group__events.html#ga6c219038c3e618e2142c6e1601997907">chEvtSignalI()</a>, <aclass="el"href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20">chSchRescheduleS()</a>, <aclass="el"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <aclass="el"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<areashape="rect"id="node3"href="group__events.html#ga6c219038c3e618e2142c6e1601997907"title="Pends a set of event flags on the specified Thread."alt=""coords="321,5,401,32"/><areashape="rect"id="node7"href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20"title="Performs a reschedule if a higher priority thread is runnable."alt=""coords="133,56,251,83"/><areashape="rect"id="node5"href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298"title="Inserts a thread in the Ready List."alt=""coords="473,31,559,57"/><areashape="rect"id="node9"href="group__scheduler.html#ga0257cf203e72a766a52059750cb97e6e"title="Switches to the first thread on the runnable queue."alt=""coords="299,56,424,83"/></map>
<p>Pends a set of event flags on the specified <code><aclass="el"href="struct_thread.html"title="Structure representing a thread.">Thread</a></code>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>tp</em> </td><td>the thread to be signaled </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>the event flags set to be pended </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00171">171</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>Referenced by <aclass="el"href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3">chEvtBroadcastI()</a>, and <aclass="el"href="group__events.html#ga75a812ae99ce83a3689f51d797a038de">chEvtSignal()</a>.</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298"title="Inserts a thread in the Ready List."alt=""coords="135,5,220,32"/></map>
<p>Signals all the Event Listeners registered on the specified Event Source. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00190">190</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3">chEvtBroadcastI()</a>, <aclass="el"href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20">chSchRescheduleS()</a>, <aclass="el"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <aclass="el"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#a665b23d0d212b06107a27f118021238c">chibios_rt::Event::Broadcast()</a>.</p>
<areashape="rect"id="node3"href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3"title="Signals all the Event Listeners registered on the specified Event Source."alt=""coords="160,5,261,32"/><areashape="rect"id="node7"href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20"title="Performs a reschedule if a higher priority thread is runnable."alt=""coords="152,56,269,83"/><areashape="rect"id="node5"href="group__events.html#ga6c219038c3e618e2142c6e1601997907"title="Pends a set of event flags on the specified Thread."alt=""coords="340,5,420,32"/><areashape="rect"id="node9"href="group__scheduler.html#ga0257cf203e72a766a52059750cb97e6e"title="Switches to the first thread on the runnable queue."alt=""coords="317,56,443,83"/></map>
<p>Signals all the Event Listeners registered on the specified Event Source. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>esp</em> </td><td>pointer to the <code><aclass="el"href="struct_event_source.html"title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00204">204</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <aclass="el"href="group__events.html#ga6c219038c3e618e2142c6e1601997907">chEvtSignalI()</a>, <aclass="el"href="struct_event_listener.html#a965d367958c83624054f5c76c3551a8c">EventListener::el_listener</a>, <aclass="el"href="struct_event_listener.html#aae3b5064b1781d6aae314f0ae57e25c4">EventListener::el_mask</a>, <aclass="el"href="struct_event_listener.html#aa4ac59cdfd75a6fe0dc9e5ab0ba3d77b">EventListener::el_next</a>, and <aclass="el"href="struct_event_source.html#aa081acf7f4043f7f636c0ba3b52b5c71">EventSource::es_next</a>.</p>
<p>Referenced by <aclass="el"href="group___c_a_n.html#ga97caf4f277c09588c225ea2328a74cba">canSleep()</a>, <aclass="el"href="group___c_a_n.html#ga09737d4ae5be724bf791a309e8a28dff">canWakeup()</a>, <aclass="el"href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4">chEvtBroadcast()</a>, <aclass="el"href="group___s_e_r_i_a_l.html#ga6c0462b840ea6364ca266a8d3fcb0945">sdAddFlagsI()</a>, <aclass="el"href="group___s_e_r_i_a_l.html#gac94544bc991e2b85a601459463604346">sdIncomingDataI()</a>, <aclass="el"href="group___s_e_r_i_a_l.html#gafa1753aa30a6b79cc7e6de3e8a156fdc">sdRequestDataI()</a>, and <aclass="el"href="group___m_m_c___s_p_i.html#ga6aae8e8af4ea0c35c677fa472fb36318">tmrfunc()</a>.</p>
<areashape="rect"id="node3"href="group__events.html#ga6c219038c3e618e2142c6e1601997907"title="Pends a set of event flags on the specified Thread."alt=""coords="155,5,235,32"/><areashape="rect"id="node5"href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298"title="Inserts a thread in the Ready List."alt=""coords="284,5,369,32"/></map>
<p>Invokes the event handlers associated to an event flags mask. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the events to be dispatched </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>handlers</em> </td><td>an array of <code>evhandler_t</code>. The array must have size equal to the number of bits in eventmask_t. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00223">223</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <aclass="el"href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <aclass="el"href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, and <aclass="el"href="group__events.html#gaad4eb14b222d2668a8ab6e7f52192f3f">EVENT_MASK</a>.</p>
<p>Referenced by <aclass="el"href="classchibios__rt_1_1_event.html#afde2cfb76dbd552ebb05bc6c6c8b2969">chibios_rt::Event::Dispatch()</a>.</p>
<p>Waits for exactly one of the specified events. </p>
<p>The function waits for one event among those specified in <code>mask</code> to become pending then the event is cleared and returned. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>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.<br/>
This means that Event Listeners with a lower event identifier have an higher priority.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>time</em> </td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b"title="Puts the current thread to sleep into the specified state with timeout specification."alt=""coords="181,56,320,83"/><areashape="rect"id="node5"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="368,5,469,32"/><areashape="rect"id="node7"href="group__time.html#ga680d851a74e594cc965101e79891840f"title="Disables a Virtual Timer."alt=""coords="380,56,457,83"/><areashape="rect"id="node9"href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e"title="Enables a virtual timer."alt=""coords="385,107,452,133"/></map>
<p>The function waits for any event among those specified in <code>mask</code> to become pending then the events are cleared and returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>time</em> </td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b"title="Puts the current thread to sleep into the specified state with timeout specification."alt=""coords="181,56,320,83"/><areashape="rect"id="node5"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="368,5,469,32"/><areashape="rect"id="node7"href="group__time.html#ga680d851a74e594cc965101e79891840f"title="Disables a Virtual Timer."alt=""coords="380,56,457,83"/><areashape="rect"id="node9"href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e"title="Enables a virtual timer."alt=""coords="385,107,452,133"/></map>
<p>The function waits for all the events specified in <code>mask</code> to become pending then the events are cleared and returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the event ids that the function should wait for </td></tr>
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>time</em> </td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b"title="Puts the current thread to sleep into the specified state with timeout specification."alt=""coords="173,56,312,83"/><areashape="rect"id="node5"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="360,5,461,32"/><areashape="rect"id="node7"href="group__time.html#ga680d851a74e594cc965101e79891840f"title="Disables a Virtual Timer."alt=""coords="372,56,449,83"/><areashape="rect"id="node9"href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e"title="Enables a virtual timer."alt=""coords="377,107,444,133"/></map>
<p>Waits for exactly one of the specified events. </p>
<p>The function waits for one event among those specified in <code>mask</code> to become pending then the event is cleared and returned. </p>
<dlclass="note"><dt><b>Note:</b></dt><dd>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.<br/>
This means that Event Listeners with a lower event identifier have an higher priority.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The mask of the lowest id served and cleared event. </dd></dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00256">256</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="144,31,245,57"/><areashape="rect"id="node5"href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7"title="Inserts in the circular debug trace buffer a context switch record."alt=""coords="295,5,375,32"/><areashape="rect"id="node7"href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a"title="Removes the first-out Thread from a queue and returns it."alt=""coords="295,56,375,83"/></map>
<p>The function waits for any event among those specified in <code>mask</code> to become pending then the events are cleared and returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00283">283</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="144,31,245,57"/><areashape="rect"id="node5"href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7"title="Inserts in the circular debug trace buffer a context switch record."alt=""coords="295,5,375,32"/><areashape="rect"id="node7"href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a"title="Removes the first-out Thread from a queue and returns it."alt=""coords="295,56,375,83"/></map>
<p>The function waits for all the events specified in <code>mask</code> to become pending then the events are cleared and returned.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"><tt>[in]</tt> </td><tdvalign="top"><em>mask</em> </td><td>mask of the event ids that the function should wait for </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<p>Definition at line <aclass="el"href="chevents_8c_source.html#l00308">308</a> of file <aclass="el"href="chevents_8c_source.html">chevents.c</a>.</p>
<areashape="rect"id="node3"href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986"title="Puts the current thread to sleep into the specified state."alt=""coords="136,31,237,57"/><areashape="rect"id="node5"href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7"title="Inserts in the circular debug trace buffer a context switch record."alt=""coords="287,5,367,32"/><areashape="rect"id="node7"href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a"title="Removes the first-out Thread from a queue and returns it."alt=""coords="287,56,367,83"/></map>
Generated on Sun Oct 24 2010 09:40:46 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>