gnuk/ChibiOS_2.0.6/docs/html/group__events.html

1082 lines
77 KiB
HTML
Raw Normal View History

2010-08-10 03:11:02 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: Event Flags</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
2010-11-22 05:53:37 +00:00
<!-- Generated by Doxygen 1.7.1 -->
2010-08-10 03:11:02 +00:00
<div class="navigation" id="top">
<div class="tabs">
2010-11-22 05:53:37 +00:00
<ul class="tablist">
2010-08-10 03:11:02 +00:00
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
2010-11-22 05:53:37 +00:00
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
2010-08-10 03:11:02 +00:00
<h1>Event Flags<br/>
<small>
[<a class="el" href="group__synchronization.html">Synchronization</a>]</small>
2010-11-22 05:53:37 +00:00
</h1> </div>
</div>
<div class="contents">
2010-08-10 03:11:02 +00:00
<p><div class="dynheader">
Collaboration diagram for Event Flags:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<center><table><tr><td><img src="group__events.png" border="0" alt="" usemap="#group____events"/>
<map name="group____events" id="group____events">
<area shape="rect" id="node1" href="group__synchronization.html" title="Synchronization" alt="" coords="7,5,105,32"/> </map>
</td></tr></table></center>
2010-08-10 03:11:02 +00:00
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<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><a class="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><a class="el" href="chconf_8h.html" title="Configuration file template.">chconf.h</a></code>. </p>
2010-11-22 05:53:37 +00:00
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_event_listener.html">EventListener</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Event Listener structure. <a href="struct_event_listener.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_event_source.html">EventSource</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Event Source structure. <a href="struct_event_source.html#_details">More...</a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga00aa72be61db8d43dbca3a3ba7cecf6b">_EVENTSOURCE_DATA</a>(name)&nbsp;&nbsp;&nbsp;{(void *)(&amp;name)}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data part of a static event source initializer. <a href="#ga00aa72be61db8d43dbca3a3ba7cecf6b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaeb4c660b05db4760eab6093499963314">EVENTSOURCE_DECL</a>(name)&nbsp;&nbsp;&nbsp;<a class="el" href="struct_event_source.html">EventSource</a> name = _EVENTSOURCE_DATA(name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static event source initializer. <a href="#gaeb4c660b05db4760eab6093499963314"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaed91c5e7fac293ba4fd2181dca73a59e">ALL_EVENTS</a>&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>)-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaad4eb14b222d2668a8ab6e7f52192f3f">EVENT_MASK</a>(eid)&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>)(1 &lt;&lt; (eid)))</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gad478062f3e09d00e1ad8ebe65a06ec0c">chEvtRegister</a>(esp, elp, eid)&nbsp;&nbsp;&nbsp;chEvtRegisterMask(esp, elp, EVENT_MASK(eid))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Registers an Event Listener on an Event Source. <a href="#gad478062f3e09d00e1ad8ebe65a06ec0c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gab8d0fdc09be629dfb438c32a0523db42">chEvtInit</a>(esp)&nbsp;&nbsp;&nbsp;((esp)-&gt;es_next = (<a class="el" href="struct_event_listener.html">EventListener</a> *)(void *)(esp))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes an Event Source. <a href="#gab8d0fdc09be629dfb438c32a0523db42"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga440eefff93d7c8f741b7572bcc24355f">chEvtIsListening</a>(esp)&nbsp;&nbsp;&nbsp;((void *)(esp) != (void *)(esp)-&gt;es_next)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Verifies if there is at least one <code><a class="el" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a></code> registered. <a href="#ga440eefff93d7c8f741b7572bcc24355f"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_event_source.html">EventSource</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga19ef0b2769d1df4d22250135a6de57b8">EventSource</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Event Source structure. <a href="#ga19ef0b2769d1df4d22250135a6de57b8"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga1a153010620569dd0cac24da8952269f">evhandler_t</a> )(<a class="el" href="group__types.html#gada5ed33935b8347e213aeb76582642e7">eventid_t</a>)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Event Handler callback function. <a href="#ga1a153010620569dd0cac24da8952269f"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga4002600fe552128aaf96a6a1d3ada3ee">chEvtRegisterMask</a> (<a class="el" href="struct_event_source.html">EventSource</a> *esp, <a class="el" href="struct_event_listener.html">EventListener</a> *elp, <a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Registers an Event Listener on an Event Source. <a href="#ga4002600fe552128aaf96a6a1d3ada3ee"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga68d15e1c7e12e96edd40069a27981d38">chEvtUnregister</a> (<a class="el" href="struct_event_source.html">EventSource</a> *esp, <a class="el" href="struct_event_listener.html">EventListener</a> *elp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregisters an Event Listener from its Event Source. <a href="#ga68d15e1c7e12e96edd40069a27981d38"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga76f41b9668c3f1adafc516a8f92b9cad">chEvtClear</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clears the pending events specified in the mask. <a href="#ga76f41b9668c3f1adafc516a8f92b9cad"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga94f14b6063f42b9be79a7dabde18232d">chEvtPend</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pends a set of event flags on the current thread, this is <b>much</b> faster than using <code><a class="el" href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4" title="Signals all the Event Listeners registered on the specified Event Source.">chEvtBroadcast()</a></code> or <code><a class="el" href="group__events.html#ga75a812ae99ce83a3689f51d797a038de" title="Pends a set of event flags on the specified Thread.">chEvtSignal()</a></code>. <a href="#ga94f14b6063f42b9be79a7dabde18232d"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga75a812ae99ce83a3689f51d797a038de">chEvtSignal</a> (<a class="el" href="struct_thread.html">Thread</a> *tp, <a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pends a set of event flags on the specified <code><a class="el" href="struct_thread.html" title="Structure representing a thread.">Thread</a></code>. <a href="#ga75a812ae99ce83a3689f51d797a038de"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga6c219038c3e618e2142c6e1601997907">chEvtSignalI</a> (<a class="el" href="struct_thread.html">Thread</a> *tp, <a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pends a set of event flags on the specified <code><a class="el" href="struct_thread.html" title="Structure representing a thread.">Thread</a></code>. <a href="#ga6c219038c3e618e2142c6e1601997907"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4">chEvtBroadcast</a> (<a class="el" href="struct_event_source.html">EventSource</a> *esp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals all the Event Listeners registered on the specified Event Source. <a href="#ga44015af4dd20f74b0f73824ff1c1b2f4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3">chEvtBroadcastI</a> (<a class="el" href="struct_event_source.html">EventSource</a> *esp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Signals all the Event Listeners registered on the specified Event Source. <a href="#gaa24d9bed5b676b577200c4a8ebe3b8a3"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaba2061f315848a8a722efcae258edc8c">chEvtDispatch</a> (const <a class="el" href="group__events.html#ga1a153010620569dd0cac24da8952269f">evhandler_t</a> *handlers, <a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invokes the event handlers associated to an event flags mask. <a href="#gaba2061f315848a8a722efcae258edc8c"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga2944a7fc82e7cc15537f5a7c04f457d3">chEvtWaitOneTimeout</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask, <a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for exactly one of the specified events. <a href="#ga2944a7fc82e7cc15537f5a7c04f457d3"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gaf690406ccc833e2c9235e7e2041a6715">chEvtWaitAnyTimeout</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask, <a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for any of the specified events. <a href="#gaf690406ccc833e2c9235e7e2041a6715"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga90d702300eecee3d05f83e95b155c3ee">chEvtWaitAllTimeout</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask, <a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for all the specified events. <a href="#ga90d702300eecee3d05f83e95b155c3ee"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga77651e22578713ebe355c1213286c2e9">chEvtWaitOne</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for exactly one of the specified events. <a href="#ga77651e22578713ebe355c1213286c2e9"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#gabd731d3ed2f037b2409e370676575f8d">chEvtWaitAny</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for any of the specified events. <a href="#gabd731d3ed2f037b2409e370676575f8d"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__events.html#ga8c5c6bf310a08cdc836d23f98a87dbf5">chEvtWaitAll</a> (<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> mask)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Waits for all the specified events. <a href="#ga8c5c6bf310a08cdc836d23f98a87dbf5"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga00aa72be61db8d43dbca3a3ba7cecf6b"></a><!-- doxytag: member="chevents.h::_EVENTSOURCE_DATA" ref="ga00aa72be61db8d43dbca3a3ba7cecf6b" args="(name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _EVENTSOURCE_DATA</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;{(void *)(&amp;name)}</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Data part of a static event source initializer. </p>
<p>This macro should be used when statically initializing an event source that is part of a bigger structure. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the event source variable </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00071">71</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaeb4c660b05db4760eab6093499963314"></a><!-- doxytag: member="chevents.h::EVENTSOURCE_DECL" ref="gaeb4c660b05db4760eab6093499963314" args="(name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVENTSOURCE_DECL</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a class="el" href="struct_event_source.html">EventSource</a> name = _EVENTSOURCE_DATA(name)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Static event source initializer. </p>
<p>Statically initialized event sources require no explicit initialization using <code><a class="el" href="group__events.html#gab8d0fdc09be629dfb438c32a0523db42" title="Initializes an Event Source.">chEvtInit()</a></code>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the event source variable </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00080">80</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaed91c5e7fac293ba4fd2181dca73a59e"></a><!-- doxytag: member="chevents.h::ALL_EVENTS" ref="gaed91c5e7fac293ba4fd2181dca73a59e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname">#define ALL_EVENTS&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>)-1)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>All events allowed mask. </p>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00083">83</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaad4eb14b222d2668a8ab6e7f52192f3f"></a><!-- doxytag: member="chevents.h::EVENT_MASK" ref="gaad4eb14b222d2668a8ab6e7f52192f3f" args="(eid)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EVENT_MASK</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">eid</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
2010-11-22 05:53:37 +00:00
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>)(1 &lt;&lt; (eid)))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the event mask from the event identifier. </p>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00086">86</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Referenced by <a class="el" href="group__events.html#gaba2061f315848a8a722efcae258edc8c">chEvtDispatch()</a>.</p>
</div>
</div>
<a class="anchor" id="gad478062f3e09d00e1ad8ebe65a06ec0c"></a><!-- doxytag: member="chevents.h::chEvtRegister" ref="gad478062f3e09d00e1ad8ebe65a06ec0c" args="(esp, elp, eid)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chEvtRegister</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">esp, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">elp, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">eid</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;chEvtRegisterMask(esp, elp, EVENT_MASK(eid))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Registers an Event Listener on an Event Source. </p>
<dl class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>elp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>eid</em>&nbsp;</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 <a class="el" href="chevents_8h_source.html#l00101">101</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a871e59df8f46225845806ebdec4e832c">chibios_rt::Event::Register()</a>.</p>
</div>
</div>
<a class="anchor" id="gab8d0fdc09be629dfb438c32a0523db42"></a><!-- doxytag: member="chevents.h::chEvtInit" ref="gab8d0fdc09be629dfb438c32a0523db42" args="(esp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chEvtInit</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">esp</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((esp)-&gt;es_next = (<a class="el" href="struct_event_listener.html">EventListener</a> *)(void *)(esp))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes an Event Source. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Can be used with interrupts disabled or enabled.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00109">109</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
<p>Referenced by <a class="el" href="group___c_a_n.html#gadf8c892ca4bd2544d03be8a690885aef">canObjectInit()</a>, <a class="el" href="classchibios__rt_1_1_event.html#a4fad1d076cd31e2add80447f7980d8d2">chibios_rt::Event::Event()</a>, <a class="el" href="group___m_a_c.html#ga34d60b00ad9794d52da6833e18c9ec70">macObjectInit()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga44df4f9091614cab6de8d79c3c6b1a14">mmcObjectInit()</a>, and <a class="el" href="group___s_e_r_i_a_l.html#gacb9838adcf51106f4e481f41a851cc34">sdObjectInit()</a>.</p>
</div>
</div>
<a class="anchor" id="ga440eefff93d7c8f741b7572bcc24355f"></a><!-- doxytag: member="chevents.h::chEvtIsListening" ref="ga440eefff93d7c8f741b7572bcc24355f" args="(esp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chEvtIsListening</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">esp</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((void *)(esp) != (void *)(esp)-&gt;es_next)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Verifies if there is at least one <code><a class="el" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a></code> registered. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Can be called with interrupts disabled or enabled.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00118">118</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga19ef0b2769d1df4d22250135a6de57b8"></a><!-- doxytag: member="chevents.h::EventSource" ref="ga19ef0b2769d1df4d22250135a6de57b8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="struct_event_source.html">EventSource</a> <a class="el" href="struct_event_source.html">EventSource</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Event Source structure. </p>
</div>
</div>
<a class="anchor" id="ga1a153010620569dd0cac24da8952269f"></a><!-- doxytag: member="chevents.h::evhandler_t" ref="ga1a153010620569dd0cac24da8952269f" args=")(eventid_t)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname">typedef void(* <a class="el" href="group__events.html#ga1a153010620569dd0cac24da8952269f">evhandler_t</a>)(<a class="el" href="group__types.html#gada5ed33935b8347e213aeb76582642e7">eventid_t</a>)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Event Handler callback function. </p>
<p>Definition at line <a class="el" href="chevents_8h_source.html#l00124">124</a> of file <a class="el" href="chevents_8h_source.html">chevents.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga4002600fe552128aaf96a6a1d3ada3ee"></a><!-- doxytag: member="chevents.h::chEvtRegisterMask" ref="ga4002600fe552128aaf96a6a1d3ada3ee" args="(EventSource *esp, EventListener *elp, eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtRegisterMask </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_event_source.html">EventSource</a> *&nbsp;</td>
<td class="paramname"> <em>esp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_event_listener.html">EventListener</a> *&nbsp;</td>
<td class="paramname"> <em>elp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Registers an Event Listener on an Event Source. </p>
<dl class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>elp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</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 <a class="el" href="chevents_8c_source.html#l00074">74</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_event_listener.html#a965d367958c83624054f5c76c3551a8c">EventListener::el_listener</a>, <a class="el" href="struct_event_listener.html#aae3b5064b1781d6aae314f0ae57e25c4">EventListener::el_mask</a>, <a class="el" href="struct_event_listener.html#aa4ac59cdfd75a6fe0dc9e5ab0ba3d77b">EventListener::el_next</a>, and <a class="el" href="struct_event_source.html#aa081acf7f4043f7f636c0ba3b52b5c71">EventSource::es_next</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a39acaf2436f139a798973308c1929031">chibios_rt::Event::RegisterMask()</a>.</p>
</div>
</div>
<a class="anchor" id="ga68d15e1c7e12e96edd40069a27981d38"></a><!-- doxytag: member="chevents.h::chEvtUnregister" ref="ga68d15e1c7e12e96edd40069a27981d38" args="(EventSource *esp, EventListener *elp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtUnregister </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_event_source.html">EventSource</a> *&nbsp;</td>
<td class="paramname"> <em>esp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_event_listener.html">EventListener</a> *&nbsp;</td>
<td class="paramname"> <em>elp</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unregisters an Event Listener from its Event Source. </p>
<dl class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>elp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_listener.html" title="Event Listener structure.">EventListener</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00097">97</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <a class="el" href="struct_event_listener.html#aa4ac59cdfd75a6fe0dc9e5ab0ba3d77b">EventListener::el_next</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a177bc72df220068c9d620b8e9f42f2f5">chibios_rt::Event::Unregister()</a>.</p>
</div>
</div>
<a class="anchor" id="ga76f41b9668c3f1adafc516a8f92b9cad"></a><!-- doxytag: member="chevents.h::chEvtClear" ref="ga76f41b9668c3f1adafc516a8f92b9cad" args="(eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtClear </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clears the pending events specified in the mask. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>the events to be cleared </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The pending events that were cleared. </dd></dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00120">120</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <a class="el" href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#ae3c7092d78ac9dda43c109b356826f41">chibios_rt::Event::Clear()</a>.</p>
</div>
</div>
<a class="anchor" id="ga94f14b6063f42b9be79a7dabde18232d"></a><!-- doxytag: member="chevents.h::chEvtPend" ref="ga94f14b6063f42b9be79a7dabde18232d" args="(eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtPend </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pends a set of event flags on the current thread, this is <b>much</b> faster than using <code><a class="el" href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4" title="Signals all the Event Listeners registered on the specified Event Source.">chEvtBroadcast()</a></code> or <code><a class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>the events to be pended </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current pending events mask. </dd></dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00139">139</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, and <a class="el" href="group__scheduler.html#ga1a5fddde56420e8accd0c09c1abb32a7">currp</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#aca48258fbffb54c6e19bbb9016c4cee1">chibios_rt::Event::Pend()</a>.</p>
</div>
</div>
<a class="anchor" id="ga75a812ae99ce83a3689f51d797a038de"></a><!-- doxytag: member="chevents.h::chEvtSignal" ref="ga75a812ae99ce83a3689f51d797a038de" args="(Thread *tp, eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtSignal </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_thread.html">Thread</a> *&nbsp;</td>
<td class="paramname"> <em>tp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pends a set of event flags on the specified <code><a class="el" href="struct_thread.html" title="Structure representing a thread.">Thread</a></code>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>tp</em>&nbsp;</td><td>the thread to be signaled </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>the event flags set to be pended </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00155">155</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__events.html#ga6c219038c3e618e2142c6e1601997907">chEvtSignalI()</a>, <a class="el" href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20">chSchRescheduleS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga75a812ae99ce83a3689f51d797a038de_cgraph.png" border="0" usemap="#group__events_ga75a812ae99ce83a3689f51d797a038de_cgraph" alt=""/></div>
<map name="group__events_ga75a812ae99ce83a3689f51d797a038de_cgraph" id="group__events_ga75a812ae99ce83a3689f51d797a038de_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node5" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="473,31,559,57"/> <area shape="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>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ga6c219038c3e618e2142c6e1601997907"></a><!-- doxytag: member="chevents.h::chEvtSignalI" ref="ga6c219038c3e618e2142c6e1601997907" args="(Thread *tp, eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtSignalI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_thread.html">Thread</a> *&nbsp;</td>
<td class="paramname"> <em>tp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pends a set of event flags on the specified <code><a class="el" href="struct_thread.html" title="Structure representing a thread.">Thread</a></code>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>tp</em>&nbsp;</td><td>the thread to be signaled </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>the event flags set to be pended </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00171">171</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298">chSchReadyI()</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a3c3e9d6abccb62c3a5fab6ef043a391f">Thread::p_state</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">Thread::rdymsg</a>, <a class="el" href="group__threads.html#ga1227eb701b7ecaa8e8cd03edeeb79a92">THD_STATE_WTANDEVT</a>, and <a class="el" href="group__threads.html#gacd5f28475be26c300aa3444b9bad8feb">THD_STATE_WTOREVT</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3">chEvtBroadcastI()</a>, and <a class="el" href="group__events.html#ga75a812ae99ce83a3689f51d797a038de">chEvtSignal()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga6c219038c3e618e2142c6e1601997907_cgraph.png" border="0" usemap="#group__events_ga6c219038c3e618e2142c6e1601997907_cgraph" alt=""/></div>
<map name="group__events_ga6c219038c3e618e2142c6e1601997907_cgraph" id="group__events_ga6c219038c3e618e2142c6e1601997907_cgraph">
<area shape="rect" id="node3" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="135,5,220,32"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ga44015af4dd20f74b0f73824ff1c1b2f4"></a><!-- doxytag: member="chevents.h::chEvtBroadcast" ref="ga44015af4dd20f74b0f73824ff1c1b2f4" args="(EventSource *esp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtBroadcast </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_event_source.html">EventSource</a> *&nbsp;</td>
<td class="paramname"> <em>esp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals all the Event Listeners registered on the specified Event Source. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00190">190</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__events.html#gaa24d9bed5b676b577200c4a8ebe3b8a3">chEvtBroadcastI()</a>, <a class="el" href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20">chSchRescheduleS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, and <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a665b23d0d212b06107a27f118021238c">chibios_rt::Event::Broadcast()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga44015af4dd20f74b0f73824ff1c1b2f4_cgraph.png" border="0" usemap="#group__events_ga44015af4dd20f74b0f73824ff1c1b2f4_cgraph" alt=""/></div>
<map name="group__events_ga44015af4dd20f74b0f73824ff1c1b2f4_cgraph" id="group__events_ga44015af4dd20f74b0f73824ff1c1b2f4_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="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"/> <area shape="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>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="gaa24d9bed5b676b577200c4a8ebe3b8a3"></a><!-- doxytag: member="chevents.h::chEvtBroadcastI" ref="gaa24d9bed5b676b577200c4a8ebe3b8a3" args="(EventSource *esp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtBroadcastI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_event_source.html">EventSource</a> *&nbsp;</td>
<td class="paramname"> <em>esp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Signals all the Event Listeners registered on the specified Event Source. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>esp</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_event_source.html" title="Event Source structure.">EventSource</a></code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00204">204</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__events.html#ga6c219038c3e618e2142c6e1601997907">chEvtSignalI()</a>, <a class="el" href="struct_event_listener.html#a965d367958c83624054f5c76c3551a8c">EventListener::el_listener</a>, <a class="el" href="struct_event_listener.html#aae3b5064b1781d6aae314f0ae57e25c4">EventListener::el_mask</a>, <a class="el" href="struct_event_listener.html#aa4ac59cdfd75a6fe0dc9e5ab0ba3d77b">EventListener::el_next</a>, and <a class="el" href="struct_event_source.html#aa081acf7f4043f7f636c0ba3b52b5c71">EventSource::es_next</a>.</p>
<p>Referenced by <a class="el" href="group___c_a_n.html#ga97caf4f277c09588c225ea2328a74cba">canSleep()</a>, <a class="el" href="group___c_a_n.html#ga09737d4ae5be724bf791a309e8a28dff">canWakeup()</a>, <a class="el" href="group__events.html#ga44015af4dd20f74b0f73824ff1c1b2f4">chEvtBroadcast()</a>, <a class="el" href="group___s_e_r_i_a_l.html#ga6c0462b840ea6364ca266a8d3fcb0945">sdAddFlagsI()</a>, <a class="el" href="group___s_e_r_i_a_l.html#gac94544bc991e2b85a601459463604346">sdIncomingDataI()</a>, <a class="el" href="group___s_e_r_i_a_l.html#gafa1753aa30a6b79cc7e6de3e8a156fdc">sdRequestDataI()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga6aae8e8af4ea0c35c677fa472fb36318">tmrfunc()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_gaa24d9bed5b676b577200c4a8ebe3b8a3_cgraph.png" border="0" usemap="#group__events_gaa24d9bed5b676b577200c4a8ebe3b8a3_cgraph" alt=""/></div>
<map name="group__events_gaa24d9bed5b676b577200c4a8ebe3b8a3_cgraph" id="group__events_gaa24d9bed5b676b577200c4a8ebe3b8a3_cgraph">
<area shape="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"/> <area shape="rect" id="node5" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="284,5,369,32"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="gaba2061f315848a8a722efcae258edc8c"></a><!-- doxytag: member="chevents.h::chEvtDispatch" ref="gaba2061f315848a8a722efcae258edc8c" args="(const evhandler_t *handlers, eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chEvtDispatch </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__events.html#ga1a153010620569dd0cac24da8952269f">evhandler_t</a> *&nbsp;</td>
<td class="paramname"> <em>handlers</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Invokes the event handlers associated to an event flags mask. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>mask of the events to be dispatched </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>handlers</em>&nbsp;</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 <a class="el" href="chevents_8c_source.html#l00223">223</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, and <a class="el" href="group__events.html#gaad4eb14b222d2668a8ab6e7f52192f3f">EVENT_MASK</a>.</p>
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#afde2cfb76dbd552ebb05bc6c6c8b2969">chibios_rt::Event::Dispatch()</a>.</p>
</div>
</div>
<a class="anchor" id="ga2944a7fc82e7cc15537f5a7c04f457d3"></a><!-- doxytag: member="chevents.h::chEvtWaitOneTimeout" ref="ga2944a7fc82e7cc15537f5a7c04f457d3" args="(eventmask_t mask, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitOneTimeout </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>time</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<ul>
<li><em>TIME_IMMEDIATE</em> immediate timeout.</li>
<li><em>TIME_INFINITE</em> no timeout.</li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the lowest id served and cleared event. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>if the specified timeout expired. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00345">345</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>, <a class="el" href="group__threads.html#gacd5f28475be26c300aa3444b9bad8feb">THD_STATE_WTOREVT</a>, and <a class="el" href="group__scheduler.html#gad1ac15e9e5fc17810a94a779257f3d29">TIME_IMMEDIATE</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#ab8fc502561437fec0194653052202b82">chibios_rt::Event::WaitOneTimeout()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga2944a7fc82e7cc15537f5a7c04f457d3_cgraph.png" border="0" usemap="#group__events_ga2944a7fc82e7cc15537f5a7c04f457d3_cgraph" alt=""/></div>
<map name="group__events_ga2944a7fc82e7cc15537f5a7c04f457d3_cgraph" id="group__events_ga2944a7fc82e7cc15537f5a7c04f457d3_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer." alt="" coords="380,56,457,83"/> <area shape="rect" id="node9" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer." alt="" coords="385,107,452,133"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="gaf690406ccc833e2c9235e7e2041a6715"></a><!-- doxytag: member="chevents.h::chEvtWaitAnyTimeout" ref="gaf690406ccc833e2c9235e7e2041a6715" args="(eventmask_t mask, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitAnyTimeout </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>time</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits for any of the specified events. </p>
<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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>mask of the events that the function should wait for, <code>ALL_EVENTS</code> enables all the events </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<ul>
<li><em>TIME_IMMEDIATE</em> immediate timeout.</li>
<li><em>TIME_INFINITE</em> no timeout.</li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>if the specified timeout expired. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00382">382</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>, <a class="el" href="group__threads.html#gacd5f28475be26c300aa3444b9bad8feb">THD_STATE_WTOREVT</a>, and <a class="el" href="group__scheduler.html#gad1ac15e9e5fc17810a94a779257f3d29">TIME_IMMEDIATE</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a4870dfce1f2ace0ab434718b0960b960">chibios_rt::Event::WaitAnyTimeout()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_gaf690406ccc833e2c9235e7e2041a6715_cgraph.png" border="0" usemap="#group__events_gaf690406ccc833e2c9235e7e2041a6715_cgraph" alt=""/></div>
<map name="group__events_gaf690406ccc833e2c9235e7e2041a6715_cgraph" id="group__events_gaf690406ccc833e2c9235e7e2041a6715_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer." alt="" coords="380,56,457,83"/> <area shape="rect" id="node9" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer." alt="" coords="385,107,452,133"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ga90d702300eecee3d05f83e95b155c3ee"></a><!-- doxytag: member="chevents.h::chEvtWaitAllTimeout" ref="ga90d702300eecee3d05f83e95b155c3ee" args="(eventmask_t mask, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitAllTimeout </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>time</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits for all the specified events. </p>
<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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>mask of the event ids that the function should wait for </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of ticks before the operation timeouts, the following special values are allowed:</p>
<ul>
<li><em>TIME_IMMEDIATE</em> immediate timeout.</li>
<li><em>TIME_INFINITE</em> no timeout.</li>
</ul>
</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>if the specified timeout expired. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00416">416</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>, <a class="el" href="group__threads.html#ga1227eb701b7ecaa8e8cd03edeeb79a92">THD_STATE_WTANDEVT</a>, and <a class="el" href="group__scheduler.html#gad1ac15e9e5fc17810a94a779257f3d29">TIME_IMMEDIATE</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#ab8c805f6b615e47050a75b16fd94492d">chibios_rt::Event::WaitAllTimeout()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga90d702300eecee3d05f83e95b155c3ee_cgraph.png" border="0" usemap="#group__events_ga90d702300eecee3d05f83e95b155c3ee_cgraph" alt=""/></div>
<map name="group__events_ga90d702300eecee3d05f83e95b155c3ee_cgraph" id="group__events_ga90d702300eecee3d05f83e95b155c3ee_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__time.html#ga680d851a74e594cc965101e79891840f" title="Disables a Virtual Timer." alt="" coords="372,56,449,83"/> <area shape="rect" id="node9" href="group__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e" title="Enables a virtual timer." alt="" coords="377,107,444,133"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ga77651e22578713ebe355c1213286c2e9"></a><!-- doxytag: member="chevents.c::chEvtWaitOne" ref="ga77651e22578713ebe355c1213286c2e9" args="(eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitOne </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</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>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the lowest id served and cleared event. </dd></dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00256">256</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986">chSchGoSleepS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, and <a class="el" href="group__threads.html#gacd5f28475be26c300aa3444b9bad8feb">THD_STATE_WTOREVT</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a5853ef97699efe31a969c7fc200e09a1">chibios_rt::Event::WaitOne()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga77651e22578713ebe355c1213286c2e9_cgraph.png" border="0" usemap="#group__events_ga77651e22578713ebe355c1213286c2e9_cgraph" alt=""/></div>
<map name="group__events_ga77651e22578713ebe355c1213286c2e9_cgraph" id="group__events_ga77651e22578713ebe355c1213286c2e9_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="295,56,375,83"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="gabd731d3ed2f037b2409e370676575f8d"></a><!-- doxytag: member="chevents.c::chEvtWaitAny" ref="gabd731d3ed2f037b2409e370676575f8d" args="(eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitAny </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits for any of the specified events. </p>
<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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</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>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00283">283</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986">chSchGoSleepS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, and <a class="el" href="group__threads.html#gacd5f28475be26c300aa3444b9bad8feb">THD_STATE_WTOREVT</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#aeb53e2435cf8f614ea51e3c90334d5ae">chibios_rt::Event::WaitAny()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_gabd731d3ed2f037b2409e370676575f8d_cgraph.png" border="0" usemap="#group__events_gabd731d3ed2f037b2409e370676575f8d_cgraph" alt=""/></div>
<map name="group__events_gabd731d3ed2f037b2409e370676575f8d_cgraph" id="group__events_gabd731d3ed2f037b2409e370676575f8d_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="295,56,375,83"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
<a class="anchor" id="ga8c5c6bf310a08cdc836d23f98a87dbf5"></a><!-- doxytag: member="chevents.c::chEvtWaitAll" ref="ga8c5c6bf310a08cdc836d23f98a87dbf5" args="(eventmask_t mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a> chEvtWaitAll </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group__types.html#gabff0c32475baf20ea8c5c710d6e8b708">eventmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>mask</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits for all the specified events. </p>
<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>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>mask of the event ids that the function should wait for </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The mask of the served and cleared events. </dd></dl>
<p>Definition at line <a class="el" href="chevents_8c_source.html#l00308">308</a> of file <a class="el" href="chevents_8c_source.html">chevents.c</a>.</p>
2010-11-22 05:53:37 +00:00
<p>References <a class="el" href="group__scheduler.html#ga97c1c514b755a1e71caf2f19c1ccf986">chSchGoSleepS()</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_thread.html#adb02f57eaf969c9e55f19a250e364f5a">Thread::ewmask</a>, <a class="el" href="struct_thread.html#aa571d2963bd8100fa210715dc5669522">Thread::p_epending</a>, <a class="el" href="struct_thread.html#a72cd0424b6098ca241fac1f74d21b56a">Thread::p_u</a>, and <a class="el" href="group__threads.html#ga1227eb701b7ecaa8e8cd03edeeb79a92">THD_STATE_WTANDEVT</a>.</p>
2010-08-10 03:11:02 +00:00
<p>Referenced by <a class="el" href="classchibios__rt_1_1_event.html#a55bd3220048e77217f5f75af7697d46f">chibios_rt::Event::WaitAll()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<div class="center"><img src="group__events_ga8c5c6bf310a08cdc836d23f98a87dbf5_cgraph.png" border="0" usemap="#group__events_ga8c5c6bf310a08cdc836d23f98a87dbf5_cgraph" alt=""/></div>
<map name="group__events_ga8c5c6bf310a08cdc836d23f98a87dbf5_cgraph" id="group__events_ga8c5c6bf310a08cdc836d23f98a87dbf5_cgraph">
<area shape="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"/> <area shape="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"/> <area shape="rect" id="node7" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="287,56,367,83"/> </map>
2010-08-10 03:11:02 +00:00
</div>
</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
2010-11-22 05:53:37 +00:00
Generated on Sun Oct 24 2010 09:40:46 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address>
2010-08-10 03:11:02 +00:00
</body>
</html>