gnuk/ChibiOS_2.0.2/docs/html/group__io__queues.html

1307 lines
85 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: I/O Queues</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">
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<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>
<div class="contents">
<h1>I/O Queues<br/>
<small>
[<a class="el" href="group__io__support.html">I/O Support</a>]</small>
</h1>
<p><div class="dynheader">
Collaboration diagram for I/O Queues:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__io__queues.png" border="0" alt="" usemap="#group____io____queues_map"/>
<map name="group____io____queues_map" id="group____io____queues">
<area shape="rect" href="group__io__support.html" title="I/O Support" alt="" coords="7,5,81,29"/> </map></td></tr></table></center>
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>ChibiOS/RT queues are mostly used in serial-like device drivers. The device drivers are usually designed to have a lower side (lower driver, it is usually an interrupt service routine) and an upper side (upper driver, accessed by the application threads).<br/>
There are several kind of queues:<br/>
</p>
<ul>
<li><b>Input queue</b>, unidirectional queue where the writer is the lower side and the reader is the upper side.</li>
<li><b>Output queue</b>, unidirectional queue where the writer is the upper side and the reader is the lower side.</li>
<li><b>Full duplex queue</b>, bidirectional queue. Full duplex queues are implemented by pairing an input queue and an output queue together.</li>
</ul>
<p>In order to use the I/O queues the <code>CH_USE_QUEUES</code> option must be enabled in <code><a class="el" href="chconf_8h.html" title="Configuration file template.">chconf.h</a></code>.<br/>
I/O queues are usually used as an implementation layer for the I/O channels interface, also see <a class="el" href="group__io__channels.html">I/O Channels</a>. </p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_generic_queue.html">GenericQueue</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generic I/O queue structure. <a href="struct_generic_queue.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#gadfbe2a9b3e7477d3fd4026d61caf1fcd">Q_OK</a>&nbsp;&nbsp;&nbsp;RDY_OK</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned by the queue functions if the operation is successful. <a href="#gadfbe2a9b3e7477d3fd4026d61caf1fcd"></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__io__queues.html#gaed5efaf47ab37022f69e8080610bcb8b">Q_TIMEOUT</a>&nbsp;&nbsp;&nbsp;RDY_TIMEOUT</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned by the queue functions if a timeout occurs. <a href="#gaed5efaf47ab37022f69e8080610bcb8b"></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__io__queues.html#gaef6ed06ced720075658356892318f92d">Q_RESET</a>&nbsp;&nbsp;&nbsp;RDY_RESET</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned by the queue functions if the queue is reset. <a href="#gaef6ed06ced720075658356892318f92d"></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__io__queues.html#ga9d3fcfacb433cb513882db4515ac348b">Q_EMPTY</a>&nbsp;&nbsp;&nbsp;-3</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned by the queue functions if the queue is empty. <a href="#ga9d3fcfacb433cb513882db4515ac348b"></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__io__queues.html#ga6c462ef0a5b01afbd0d94a8e1ac8575a">Q_FULL</a>&nbsp;&nbsp;&nbsp;-4</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returned by the queue functions if the queue is full. <a href="#ga6c462ef0a5b01afbd0d94a8e1ac8575a"></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__io__queues.html#ga1d70b6f0faef169fd343806e4fd26f55">chQSize</a>(q)&nbsp;&nbsp;&nbsp;((q)-&gt;q_top - (q)-&gt;q_buffer)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the queue's buffer size. <a href="#ga1d70b6f0faef169fd343806e4fd26f55"></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__io__queues.html#ga36b3ceeb9c971245fb5cd5bfdce29804">chQSpace</a>(q)&nbsp;&nbsp;&nbsp;chSemGetCounterI(&amp;(q)-&gt;q_sem)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Queue space. <a href="#ga36b3ceeb9c971245fb5cd5bfdce29804"></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__io__queues.html#ga01d87285eb173d213eb9849514969d7d">chIQIsEmpty</a>(q)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &lt;= 0))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluates to <code>TRUE</code> if the specified Input Queue is empty. <a href="#ga01d87285eb173d213eb9849514969d7d"></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__io__queues.html#ga3b87d6f7e4110c882b13870930db5cbb">chIQIsFull</a>(q)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &gt;= chQSize(q)))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluates to <code>TRUE</code> if the specified Input Queue is full. <a href="#ga3b87d6f7e4110c882b13870930db5cbb"></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__io__queues.html#ga677247f42b796cedc0c0b58a15c11794">chIQGet</a>(iqp)&nbsp;&nbsp;&nbsp;chIQGetTimeout(iqp, TIME_INFINITE)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input queue read. <a href="#ga677247f42b796cedc0c0b58a15c11794"></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__io__queues.html#ga4103f441ac5c12c89180194b7a3044f2">_INPUTQUEUE_DATA</a>(name, buffer, size, inotify)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data part of a static input queue initializer. <a href="#ga4103f441ac5c12c89180194b7a3044f2"></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__io__queues.html#ga49e3c172ebb6efca6579bf97ca82569d">INPUTQUEUE_DECL</a>(name, buffer, size, inotify)&nbsp;&nbsp;&nbsp;<a class="el" href="struct_generic_queue.html">InputQueue</a> name = _INPUTQUEUE_DATA(name, buffer, size, inotify)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static input queue initializer. <a href="#ga49e3c172ebb6efca6579bf97ca82569d"></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__io__queues.html#gabf0eb1ba20cde6d4d9afa1139eaac19d">chOQIsEmpty</a>(q)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &gt;= chQSize(q)))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluates to <code>TRUE</code> if the specified Output Queue is empty. <a href="#gabf0eb1ba20cde6d4d9afa1139eaac19d"></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__io__queues.html#gaca8b2bc8aae722ba9f47f21c358420f9">chOQIsFull</a>(q)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &lt;= 0))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Evaluates to <code>TRUE</code> if the specified Output Queue is full. <a href="#gaca8b2bc8aae722ba9f47f21c358420f9"></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__io__queues.html#ga825aba08aea4a6ac97a763404265956b">chOQPut</a>(oqp, b)&nbsp;&nbsp;&nbsp;chOQPutTimeout(oqp, b, TIME_INFINITE)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output queue write. <a href="#ga825aba08aea4a6ac97a763404265956b"></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__io__queues.html#gafc29412cc872c152eadcb24183010a52">_OUTPUTQUEUE_DATA</a>(name, buffer, size, onotify)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data part of a static output queue initializer. <a href="#gafc29412cc872c152eadcb24183010a52"></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__io__queues.html#ga9381af63d682d4e0883bc9336a2366eb">OUTPUTQUEUE_DECL</a>(name, buffer, size, onotify)&nbsp;&nbsp;&nbsp;<a class="el" href="struct_generic_queue.html">InputQueue</a> name = _OUTPUTQUEUE_DATA(name, buffer, size, onotify)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static output queue initializer. <a href="#ga9381af63d682d4e0883bc9336a2366eb"></a><br/></td></tr>
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a> )(void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Queue notification callback type. <a href="#ga7c6a6ab1d0d4999011cfee832ad1c8b5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="struct_generic_queue.html">GenericQueue</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#gab15bb5ea346b37cd021c6a658e86084b">InputQueue</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input queue structure. <a href="#gab15bb5ea346b37cd021c6a658e86084b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="struct_generic_queue.html">GenericQueue</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#gac7723f9b71300f4231db2b6e502f23c9">OutputQueue</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output queue structure. <a href="#gac7723f9b71300f4231db2b6e502f23c9"></a><br/></td></tr>
<tr><td colspan="2"><h2>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__io__queues.html#ga0d3a250e6572526b165d2c61f69230e5">chIQInit</a> (<a class="el" href="struct_generic_queue.html">InputQueue</a> *iqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *bp, size_t size, <a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a> infy)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes an input queue. <a href="#ga0d3a250e6572526b165d2c61f69230e5"></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__io__queues.html#ga2252ca3e5d6ee6d8d323d025365aee59">chIQResetI</a> (<a class="el" href="struct_generic_queue.html">InputQueue</a> *iqp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets an input queue. <a href="#ga2252ca3e5d6ee6d8d323d025365aee59"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga23b72ba9803de5a20caa84ffd0c193fc">chIQPutI</a> (<a class="el" href="struct_generic_queue.html">InputQueue</a> *iqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> b)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input queue write. <a href="#ga23b72ba9803de5a20caa84ffd0c193fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga142d0e885ac3a695f5f033a65f49abd0">chIQGetTimeout</a> (<a class="el" href="struct_generic_queue.html">InputQueue</a> *iqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input queue read with timeout. <a href="#ga142d0e885ac3a695f5f033a65f49abd0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#gaddf6fc39af7d905c9f23afde14d8d764">chIQReadTimeout</a> (<a class="el" href="struct_generic_queue.html">InputQueue</a> *iqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *bp, size_t n, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input queue read with timeout. <a href="#gaddf6fc39af7d905c9f23afde14d8d764"></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__io__queues.html#gae2a5a0ef7c488ac02762e76933baa7b1">chOQInit</a> (<a class="el" href="struct_generic_queue.html">OutputQueue</a> *oqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *bp, size_t size, <a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a> onfy)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes an output queue. <a href="#gae2a5a0ef7c488ac02762e76933baa7b1"></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__io__queues.html#ga0a35a7de945e4b56b5fb5f5c8567e296">chOQResetI</a> (<a class="el" href="struct_generic_queue.html">OutputQueue</a> *oqp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets an output queue. <a href="#ga0a35a7de945e4b56b5fb5f5c8567e296"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga3df1926602eb698119990b311b097ad9">chOQPutTimeout</a> (<a class="el" href="struct_generic_queue.html">OutputQueue</a> *oqp, <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> b, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output queue write with timeout. <a href="#ga3df1926602eb698119990b311b097ad9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga34a5a71f39e94fcfdd88935da92a8ce9">chOQGetI</a> (<a class="el" href="struct_generic_queue.html">OutputQueue</a> *oqp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output queue read. <a href="#ga34a5a71f39e94fcfdd88935da92a8ce9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__io__queues.html#ga1e90d41fa021107d72b1bed81186aae8">chOQWriteTimeout</a> (<a class="el" href="struct_generic_queue.html">OutputQueue</a> *oqp, const <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *bp, size_t n, <a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a> time)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output queue write with timeout. <a href="#ga1e90d41fa021107d72b1bed81186aae8"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gadfbe2a9b3e7477d3fd4026d61caf1fcd"></a><!-- doxytag: member="chqueues.h::Q_OK" ref="gadfbe2a9b3e7477d3fd4026d61caf1fcd" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Q_OK&nbsp;&nbsp;&nbsp;RDY_OK</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returned by the queue functions if the operation is successful. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00051">51</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga23b72ba9803de5a20caa84ffd0c193fc">chIQPutI()</a>, <a class="el" href="group__io__queues.html#ga3df1926602eb698119990b311b097ad9">chOQPutTimeout()</a>, <a class="el" href="group___s_e_r_i_a_l.html#gac94544bc991e2b85a601459463604346">sdIncomingDataI()</a>, and <a class="el" href="group___s_e_r_i_a_l.html#gafa1753aa30a6b79cc7e6de3e8a156fdc">sdRequestDataI()</a>.</p>
</div>
</div>
<a class="anchor" id="gaed5efaf47ab37022f69e8080610bcb8b"></a><!-- doxytag: member="chqueues.h::Q_TIMEOUT" ref="gaed5efaf47ab37022f69e8080610bcb8b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Q_TIMEOUT&nbsp;&nbsp;&nbsp;RDY_TIMEOUT</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returned by the queue functions if a timeout occurs. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00053">53</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaef6ed06ced720075658356892318f92d"></a><!-- doxytag: member="chqueues.h::Q_RESET" ref="gaef6ed06ced720075658356892318f92d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Q_RESET&nbsp;&nbsp;&nbsp;RDY_RESET</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returned by the queue functions if the queue is reset. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00055">55</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga9d3fcfacb433cb513882db4515ac348b"></a><!-- doxytag: member="chqueues.h::Q_EMPTY" ref="ga9d3fcfacb433cb513882db4515ac348b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Q_EMPTY&nbsp;&nbsp;&nbsp;-3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returned by the queue functions if the queue is empty. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00057">57</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga34a5a71f39e94fcfdd88935da92a8ce9">chOQGetI()</a>.</p>
</div>
</div>
<a class="anchor" id="ga6c462ef0a5b01afbd0d94a8e1ac8575a"></a><!-- doxytag: member="chqueues.h::Q_FULL" ref="ga6c462ef0a5b01afbd0d94a8e1ac8575a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Q_FULL&nbsp;&nbsp;&nbsp;-4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returned by the queue functions if the queue is full. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00059">59</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga23b72ba9803de5a20caa84ffd0c193fc">chIQPutI()</a>.</p>
</div>
</div>
<a class="anchor" id="ga1d70b6f0faef169fd343806e4fd26f55"></a><!-- doxytag: member="chqueues.h::chQSize" ref="ga1d70b6f0faef169fd343806e4fd26f55" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chQSize</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((q)-&gt;q_top - (q)-&gt;q_buffer)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the queue's buffer size. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00083">83</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga36b3ceeb9c971245fb5cd5bfdce29804"></a><!-- doxytag: member="chqueues.h::chQSpace" ref="ga36b3ceeb9c971245fb5cd5bfdce29804" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chQSpace</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;chSemGetCounterI(&amp;(q)-&gt;q_sem)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Queue space. </p>
<p>Returns the used space if used on an Input Queue and the empty space if used on an Output Queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The returned value can be less than zero when there are waiting threads on the internal semaphore. </dd></dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00092">92</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga01d87285eb173d213eb9849514969d7d"></a><!-- doxytag: member="chqueues.h::chIQIsEmpty" ref="ga01d87285eb173d213eb9849514969d7d" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chIQIsEmpty</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &lt;= 0))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Evaluates to <code>TRUE</code> if the specified Input Queue is empty. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00108">108</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#gaddf6fc39af7d905c9f23afde14d8d764">chIQReadTimeout()</a>, and <a class="el" href="group___s_e_r_i_a_l.html#gac94544bc991e2b85a601459463604346">sdIncomingDataI()</a>.</p>
</div>
</div>
<a class="anchor" id="ga3b87d6f7e4110c882b13870930db5cbb"></a><!-- doxytag: member="chqueues.h::chIQIsFull" ref="ga3b87d6f7e4110c882b13870930db5cbb" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chIQIsFull</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &gt;= chQSize(q)))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Evaluates to <code>TRUE</code> if the specified Input Queue is full. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00111">111</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga23b72ba9803de5a20caa84ffd0c193fc">chIQPutI()</a>.</p>
</div>
</div>
<a class="anchor" id="ga677247f42b796cedc0c0b58a15c11794"></a><!-- doxytag: member="chqueues.h::chIQGet" ref="ga677247f42b796cedc0c0b58a15c11794" args="(iqp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chIQGet</td>
<td>(</td>
<td class="paramtype">iqp&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;chIQGetTimeout(iqp, TIME_INFINITE)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input queue read. </p>
<p>This function reads a byte value from an input queue. If the queue is empty then the calling thread is suspended until a byte arrives in the queue.</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>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A byte value from the queue or: </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>Q_RESET</em>&nbsp;</td><td>if the queue was reset. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00123">123</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga4103f441ac5c12c89180194b7a3044f2"></a><!-- doxytag: member="chqueues.h::_INPUTQUEUE_DATA" ref="ga4103f441ac5c12c89180194b7a3044f2" args="(name, buffer, size, inotify)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _INPUTQUEUE_DATA</td>
<td>(</td>
<td class="paramtype">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">buffer, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">inotify&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer) + size, \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
<a class="code" href="group__semaphores.html#ga1100c867cc8bd8328f7a7db5e7c74f6d" title="Data part of a static semaphore initializer.">_SEMAPHORE_DATA</a>(name.q_sem, 0), \
inotify \
}
</pre></div>
<p>Data part of a static input queue initializer. </p>
<p>This macro should be used when statically initializing an input queue 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"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the input queue variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>pointer to the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>inotify</em>&nbsp;</td><td>input notification callback pointer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00135">135</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga49e3c172ebb6efca6579bf97ca82569d"></a><!-- doxytag: member="chqueues.h::INPUTQUEUE_DECL" ref="ga49e3c172ebb6efca6579bf97ca82569d" args="(name, buffer, size, inotify)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define INPUTQUEUE_DECL</td>
<td>(</td>
<td class="paramtype">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">buffer, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">inotify&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a class="el" href="struct_generic_queue.html">InputQueue</a> name = _INPUTQUEUE_DATA(name, buffer, size, inotify)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Static input queue initializer. </p>
<p>Statically initialized input queues require no explicit initialization using <code><a class="el" href="group__io__queues.html#ga0d3a250e6572526b165d2c61f69230e5" title="Initializes an input queue.">chIQInit()</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>name</em>&nbsp;</td><td>the name of the input queue variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>pointer to the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>inotify</em>&nbsp;</td><td>input notification callback pointer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00154">154</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="gabf0eb1ba20cde6d4d9afa1139eaac19d"></a><!-- doxytag: member="chqueues.h::chOQIsEmpty" ref="gabf0eb1ba20cde6d4d9afa1139eaac19d" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chOQIsEmpty</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &gt;= chQSize(q)))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Evaluates to <code>TRUE</code> if the specified Output Queue is empty. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00173">173</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga34a5a71f39e94fcfdd88935da92a8ce9">chOQGetI()</a>.</p>
</div>
</div>
<a class="anchor" id="gaca8b2bc8aae722ba9f47f21c358420f9"></a><!-- doxytag: member="chqueues.h::chOQIsFull" ref="gaca8b2bc8aae722ba9f47f21c358420f9" args="(q)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chOQIsFull</td>
<td>(</td>
<td class="paramtype">q&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___s_t_m8___c_o_r_e.html#gaf900ae86327eeeb5750901c89f1f8912">bool_t</a>)(chQSpace(q) &lt;= 0))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Evaluates to <code>TRUE</code> if the specified Output Queue is full. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00178">178</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
<p>Referenced by <a class="el" href="group__io__queues.html#ga1e90d41fa021107d72b1bed81186aae8">chOQWriteTimeout()</a>.</p>
</div>
</div>
<a class="anchor" id="ga825aba08aea4a6ac97a763404265956b"></a><!-- doxytag: member="chqueues.h::chOQPut" ref="ga825aba08aea4a6ac97a763404265956b" args="(oqp, b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chOQPut</td>
<td>(</td>
<td class="paramtype">oqp, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">b&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;chOQPutTimeout(oqp, b, TIME_INFINITE)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Output queue write. </p>
<p>This function writes a byte value to an output queue. If the queue is full then the calling thread is suspended until there is space in the queue.</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>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>b</em>&nbsp;</td><td>the byte value to be written in the queue </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The operation status: </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>Q_OK</em>&nbsp;</td><td>if the operation succeeded. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Q_RESET</em>&nbsp;</td><td>if the queue was reset. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00192">192</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="gafc29412cc872c152eadcb24183010a52"></a><!-- doxytag: member="chqueues.h::_OUTPUTQUEUE_DATA" ref="gafc29412cc872c152eadcb24183010a52" args="(name, buffer, size, onotify)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _OUTPUTQUEUE_DATA</td>
<td>(</td>
<td class="paramtype">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">buffer, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">onotify&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer) + size, \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
(<a class="code" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)(buffer), \
<a class="code" href="group__semaphores.html#ga1100c867cc8bd8328f7a7db5e7c74f6d" title="Data part of a static semaphore initializer.">_SEMAPHORE_DATA</a>(name.q_sem, size), \
onotify \
}
</pre></div>
<p>Data part of a static output queue initializer. </p>
<p>This macro should be used when statically initializing an output queue 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"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the output queue variable. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>pointer to the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>onotify</em>&nbsp;</td><td>output notification callback pointer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00204">204</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga9381af63d682d4e0883bc9336a2366eb"></a><!-- doxytag: member="chqueues.h::OUTPUTQUEUE_DECL" ref="ga9381af63d682d4e0883bc9336a2366eb" args="(name, buffer, size, onotify)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define OUTPUTQUEUE_DECL</td>
<td>(</td>
<td class="paramtype">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">buffer, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">onotify&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;<a class="el" href="struct_generic_queue.html">InputQueue</a> name = _OUTPUTQUEUE_DATA(name, buffer, size, onotify)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Static output queue initializer. </p>
<p>Statically initialized output queues require no explicit initialization using <code><a class="el" href="group__io__queues.html#gae2a5a0ef7c488ac02762e76933baa7b1" title="Initializes an output queue.">chOQInit()</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>name</em>&nbsp;</td><td>the name of the output queue variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>pointer to the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer area </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>onotify</em>&nbsp;</td><td>output notification callback pointer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00223">223</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga7c6a6ab1d0d4999011cfee832ad1c8b5"></a><!-- doxytag: member="chqueues.h::qnotify_t" ref="ga7c6a6ab1d0d4999011cfee832ad1c8b5" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Queue notification callback type. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00048">48</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="gab15bb5ea346b37cd021c6a658e86084b"></a><!-- doxytag: member="chqueues.h::InputQueue" ref="gab15bb5ea346b37cd021c6a658e86084b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="struct_generic_queue.html">GenericQueue</a> <a class="el" href="struct_generic_queue.html">InputQueue</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input queue structure. </p>
<p>This structure represents a generic asymmetrical input queue. Writing in the queue is non-blocking and can be performed from interrupt handlers or from within a kernel lock zone (see <b>I-Locked</b> and <b>S-Locked</b> states in <a class="el" href="concepts.html#system_states">System States</a>). Reading the queue can be a blocking operation and is supposed to be performed by a system thread. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00105">105</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<a class="anchor" id="gac7723f9b71300f4231db2b6e502f23c9"></a><!-- doxytag: member="chqueues.h::OutputQueue" ref="gac7723f9b71300f4231db2b6e502f23c9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="struct_generic_queue.html">GenericQueue</a> <a class="el" href="struct_generic_queue.html">OutputQueue</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Output queue structure. </p>
<p>This structure represents a generic asymmetrical output queue. Reading from the queue is non-blocking and can be performed from interrupt handlers or from within a kernel lock zone (see <b>I-Locked</b> and <b>S-Locked</b> states in <a class="el" href="concepts.html#system_states">System States</a>). Writing the queue can be a blocking operation and is supposed to be performed by a system thread. </p>
<p>Definition at line <a class="el" href="chqueues_8h_source.html#l00168">168</a> of file <a class="el" href="chqueues_8h_source.html">chqueues.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga0d3a250e6572526b165d2c61f69230e5"></a><!-- doxytag: member="chqueues.h::chIQInit" ref="ga0d3a250e6572526b165d2c61f69230e5" args="(InputQueue *iqp, uint8_t *bp, size_t size, qnotify_t infy)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chIQInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">InputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>iqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&nbsp;</td>
<td class="paramname"> <em>bp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a>&nbsp;</td>
<td class="paramname"> <em>infy</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes an input queue. </p>
<p>A <a class="el" href="struct_semaphore.html" title="Semaphore structure.">Semaphore</a> is internally initialized and works as a counter of the bytes contained in the queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The callback is invoked from within the S-Locked system state, see <a class="el" href="concepts.html#system_states">System States</a>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bp</em>&nbsp;</td><td>pointer to a memory area allocated as queue buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>infy</em>&nbsp;</td><td>pointer to a callback function that is invoked when data is read from the queue. The value can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00069">69</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58">chSemInit()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gacb9838adcf51106f4e481f41a851cc34">sdObjectInit()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga0d3a250e6572526b165d2c61f69230e5_cgraph.png" border="0" usemap="#group__io__queues_ga0d3a250e6572526b165d2c61f69230e5_cgraph_map" alt=""></div>
<map name="group__io__queues_ga0d3a250e6572526b165d2c61f69230e5_cgraph_map" id="group__io__queues_ga0d3a250e6572526b165d2c61f69230e5_cgraph">
<area shape="rect" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58" title="Initializes a semaphore with the specified counter value." alt="" coords="111,5,177,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga2252ca3e5d6ee6d8d323d025365aee59"></a><!-- doxytag: member="chqueues.h::chIQResetI" ref="ga2252ca3e5d6ee6d8d323d025365aee59" args="(InputQueue *iqp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chIQResetI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">InputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>iqp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resets an input queue. </p>
<p>All the data in the input queue is erased and lost, any waiting thread is resumed with status <code>Q_RESET</code>. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>A reset operation can be used by a low level driver in order to obtain immediate attention from the high level layers.</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>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00086">86</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#gae7972b6b22b80ac09bac5a186277ab81">chSemResetI()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, and <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gacb106a30f8007afdf9eeaf8681dbd3cf">sdStop()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga2252ca3e5d6ee6d8d323d025365aee59_cgraph.png" border="0" usemap="#group__io__queues_ga2252ca3e5d6ee6d8d323d025365aee59_cgraph_map" alt=""></div>
<map name="group__io__queues_ga2252ca3e5d6ee6d8d323d025365aee59_cgraph_map" id="group__io__queues_ga2252ca3e5d6ee6d8d323d025365aee59_cgraph">
<area shape="rect" href="group__semaphores.html#gae7972b6b22b80ac09bac5a186277ab81" title="Performs a reset operation on the semaphore." alt="" coords="129,29,212,53"/> <area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="261,5,347,29"/> <area shape="rect" href="group__internals.html#gacacfe77140cab62948e63d898bf4dfba" title="Removes the last&#45;out Thread from a queue and returns it." alt="" coords="265,53,343,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga23b72ba9803de5a20caa84ffd0c193fc"></a><!-- doxytag: member="chqueues.h::chIQPutI" ref="ga23b72ba9803de5a20caa84ffd0c193fc" args="(InputQueue *iqp, uint8_t b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chIQPutI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">InputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>iqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&nbsp;</td>
<td class="paramname"> <em>b</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input queue write. </p>
<p>A byte value is written into the low end of an input queue.</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>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>b</em>&nbsp;</td><td>the byte value to be written in the queue </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The operation status, it can be one of: </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>Q_OK</em>&nbsp;</td><td>if the operation has been completed with success. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Q_FULL</em>&nbsp;</td><td>if the queue is full and the operation cannot be completed. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00103">103</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__io__queues.html#ga3b87d6f7e4110c882b13870930db5cbb">chIQIsFull</a>, <a class="el" href="group__semaphores.html#gaca0b70cf495a9cb7569e1cf5b07e2b3d">chSemSignalI()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="group__io__queues.html#ga6c462ef0a5b01afbd0d94a8e1ac8575a">Q_FULL</a>, <a class="el" href="group__io__queues.html#gadfbe2a9b3e7477d3fd4026d61caf1fcd">Q_OK</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gac94544bc991e2b85a601459463604346">sdIncomingDataI()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga23b72ba9803de5a20caa84ffd0c193fc_cgraph.png" border="0" usemap="#group__io__queues_ga23b72ba9803de5a20caa84ffd0c193fc_cgraph_map" alt=""></div>
<map name="group__io__queues_ga23b72ba9803de5a20caa84ffd0c193fc_cgraph_map" id="group__io__queues_ga23b72ba9803de5a20caa84ffd0c193fc_cgraph">
<area shape="rect" href="group__semaphores.html#gaca0b70cf495a9cb7569e1cf5b07e2b3d" title="Performs a signal operation on a semaphore." alt="" coords="115,29,200,53"/> <area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="248,5,333,29"/> <area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="251,53,331,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga142d0e885ac3a695f5f033a65f49abd0"></a><!-- doxytag: member="chqueues.h::chIQGetTimeout" ref="ga142d0e885ac3a695f5f033a65f49abd0" args="(InputQueue *iqp, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chIQGetTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">InputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>iqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<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>Input queue read with timeout. </p>
<p>This function reads a byte value from an input queue. If the queue is empty then the calling thread is suspended until a byte arrives in the queue or a timeout occurs.</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>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </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>A byte value from the queue or: </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>Q_TIMEOUT</em>&nbsp;</td><td>if the specified time expired. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Q_RESET</em>&nbsp;</td><td>if the queue was reset. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00131">131</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03">chSemWaitTimeoutS()</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_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga142d0e885ac3a695f5f033a65f49abd0_cgraph.png" border="0" usemap="#group__io__queues_ga142d0e885ac3a695f5f033a65f49abd0_cgraph_map" alt=""></div>
<map name="group__io__queues_ga142d0e885ac3a695f5f033a65f49abd0_cgraph_map" id="group__io__queues_ga142d0e885ac3a695f5f033a65f49abd0_cgraph">
<area shape="rect" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03" title="Performs a wait operation on a semaphore with timeout specification." alt="" coords="152,5,272,29"/> <area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="321,5,457,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gaddf6fc39af7d905c9f23afde14d8d764"></a><!-- doxytag: member="chqueues.h::chIQReadTimeout" ref="gaddf6fc39af7d905c9f23afde14d8d764" args="(InputQueue *iqp, uint8_t *bp, size_t n, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t chIQReadTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">InputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>iqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&nbsp;</td>
<td class="paramname"> <em>bp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<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>Input queue read with timeout. </p>
<p>The function reads data from an input queue into a buffer. The operation completes when the specified amount of data has been transferred or after the specified timeout or if the queue has been reset. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The function is not atomic, if you need atomicity it is suggested to use a semaphore or a mutex for mutual exclusion. </dd>
<dd>
The queue callback is invoked before entering a sleep state and at the end of the transfer.</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>iqp</em>&nbsp;</td><td>pointer to an <code>InputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>bp</em>&nbsp;</td><td>pointer to the data buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>the maximum amount of data to be transferred, the value 0 is reserved </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 number of bytes effectively transferred. </dd></dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00174">174</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__io__queues.html#ga01d87285eb173d213eb9849514969d7d">chIQIsEmpty</a>, <a class="el" href="group__semaphores.html#ga748b56bc2be187e316496d7b6e748f89">chSemFastWaitI</a>, <a class="el" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03">chSemWaitTimeoutS()</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_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_gaddf6fc39af7d905c9f23afde14d8d764_cgraph.png" border="0" usemap="#group__io__queues_gaddf6fc39af7d905c9f23afde14d8d764_cgraph_map" alt=""></div>
<map name="group__io__queues_gaddf6fc39af7d905c9f23afde14d8d764_cgraph_map" id="group__io__queues_gaddf6fc39af7d905c9f23afde14d8d764_cgraph">
<area shape="rect" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03" title="Performs a wait operation on a semaphore with timeout specification." alt="" coords="160,5,280,29"/> <area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="329,5,465,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gae2a5a0ef7c488ac02762e76933baa7b1"></a><!-- doxytag: member="chqueues.h::chOQInit" ref="gae2a5a0ef7c488ac02762e76933baa7b1" args="(OutputQueue *oqp, uint8_t *bp, size_t size, qnotify_t onfy)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chOQInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">OutputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>oqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&nbsp;</td>
<td class="paramname"> <em>bp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__io__queues.html#ga7c6a6ab1d0d4999011cfee832ad1c8b5">qnotify_t</a>&nbsp;</td>
<td class="paramname"> <em>onfy</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes an output queue. </p>
<p>A <a class="el" href="struct_semaphore.html" title="Semaphore structure.">Semaphore</a> is internally initialized and works as a counter of the free bytes in the queue. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The callback is invoked from within the S-Locked system state, see <a class="el" href="concepts.html#system_states">System States</a>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bp</em>&nbsp;</td><td>pointer to a memory area allocated as queue buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>size of the queue buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>onfy</em>&nbsp;</td><td>pointer to a callback function that is invoked when data is written to the queue. The value can be <code>NULL</code>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00224">224</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58">chSemInit()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gacb9838adcf51106f4e481f41a851cc34">sdObjectInit()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_gae2a5a0ef7c488ac02762e76933baa7b1_cgraph.png" border="0" usemap="#group__io__queues_gae2a5a0ef7c488ac02762e76933baa7b1_cgraph_map" alt=""></div>
<map name="group__io__queues_gae2a5a0ef7c488ac02762e76933baa7b1_cgraph_map" id="group__io__queues_gae2a5a0ef7c488ac02762e76933baa7b1_cgraph">
<area shape="rect" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58" title="Initializes a semaphore with the specified counter value." alt="" coords="119,5,185,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga0a35a7de945e4b56b5fb5f5c8567e296"></a><!-- doxytag: member="chqueues.h::chOQResetI" ref="ga0a35a7de945e4b56b5fb5f5c8567e296" args="(OutputQueue *oqp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chOQResetI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">OutputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>oqp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resets an output queue. </p>
<p>All the data in the output queue is erased and lost, any waiting thread is resumed with status <code>Q_RESET</code>. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>A reset operation can be used by a low level driver in order to obtain immediate attention from the high level layers.</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>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00241">241</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#gae7972b6b22b80ac09bac5a186277ab81">chSemResetI()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, and <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gacb106a30f8007afdf9eeaf8681dbd3cf">sdStop()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga0a35a7de945e4b56b5fb5f5c8567e296_cgraph.png" border="0" usemap="#group__io__queues_ga0a35a7de945e4b56b5fb5f5c8567e296_cgraph_map" alt=""></div>
<map name="group__io__queues_ga0a35a7de945e4b56b5fb5f5c8567e296_cgraph_map" id="group__io__queues_ga0a35a7de945e4b56b5fb5f5c8567e296_cgraph">
<area shape="rect" href="group__semaphores.html#gae7972b6b22b80ac09bac5a186277ab81" title="Performs a reset operation on the semaphore." alt="" coords="135,29,217,53"/> <area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="267,5,352,29"/> <area shape="rect" href="group__internals.html#gacacfe77140cab62948e63d898bf4dfba" title="Removes the last&#45;out Thread from a queue and returns it." alt="" coords="271,53,348,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga3df1926602eb698119990b311b097ad9"></a><!-- doxytag: member="chqueues.h::chOQPutTimeout" ref="ga3df1926602eb698119990b311b097ad9" args="(OutputQueue *oqp, uint8_t b, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chOQPutTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">OutputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>oqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&nbsp;</td>
<td class="paramname"> <em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<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>Output queue write with timeout. </p>
<p>This function writes a byte value to an output queue. If the queue is full then the calling thread is suspended until there is space in the queue or a timeout occurs.</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>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>b</em>&nbsp;</td><td>the byte value to be written in the queue </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 operation status: </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>Q_OK</em>&nbsp;</td><td>if the operation succeeded. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Q_TIMEOUT</em>&nbsp;</td><td>if the specified time expired. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Q_RESET</em>&nbsp;</td><td>if the queue was reset. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00265">265</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03">chSemWaitTimeoutS()</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_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="group__io__queues.html#gadfbe2a9b3e7477d3fd4026d61caf1fcd">Q_OK</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>, and <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga3df1926602eb698119990b311b097ad9_cgraph.png" border="0" usemap="#group__io__queues_ga3df1926602eb698119990b311b097ad9_cgraph_map" alt=""></div>
<map name="group__io__queues_ga3df1926602eb698119990b311b097ad9_cgraph_map" id="group__io__queues_ga3df1926602eb698119990b311b097ad9_cgraph">
<area shape="rect" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03" title="Performs a wait operation on a semaphore with timeout specification." alt="" coords="155,5,275,29"/> <area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="324,5,460,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga34a5a71f39e94fcfdd88935da92a8ce9"></a><!-- doxytag: member="chqueues.h::chOQGetI" ref="ga34a5a71f39e94fcfdd88935da92a8ce9" args="(OutputQueue *oqp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___s_t_m8___c_o_r_e.html#ga1e402860c42e2ceda36d0307f3aa6209">msg_t</a> chOQGetI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">OutputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>oqp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Output queue read. </p>
<p>A byte value is read from the low end of an output queue.</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>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The byte value from the queue or: </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>Q_EMPTY</em>&nbsp;</td><td>if the queue is empty. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00292">292</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__io__queues.html#gabf0eb1ba20cde6d4d9afa1139eaac19d">chOQIsEmpty</a>, <a class="el" href="group__semaphores.html#gaca0b70cf495a9cb7569e1cf5b07e2b3d">chSemSignalI()</a>, <a class="el" href="struct_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="group__io__queues.html#ga9d3fcfacb433cb513882db4515ac348b">Q_EMPTY</a>, <a class="el" href="struct_generic_queue.html#acc1453d7bc5a4ceddba2166b72ba3b47">GenericQueue::q_rdptr</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, and <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>.</p>
<p>Referenced by <a class="el" href="group___s_e_r_i_a_l.html#gafa1753aa30a6b79cc7e6de3e8a156fdc">sdRequestDataI()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga34a5a71f39e94fcfdd88935da92a8ce9_cgraph.png" border="0" usemap="#group__io__queues_ga34a5a71f39e94fcfdd88935da92a8ce9_cgraph_map" alt=""></div>
<map name="group__io__queues_ga34a5a71f39e94fcfdd88935da92a8ce9_cgraph_map" id="group__io__queues_ga34a5a71f39e94fcfdd88935da92a8ce9_cgraph">
<area shape="rect" href="group__semaphores.html#gaca0b70cf495a9cb7569e1cf5b07e2b3d" title="Performs a signal operation on a semaphore." alt="" coords="123,29,208,53"/> <area shape="rect" href="group__scheduler.html#ga535d58cfb3436c8d4e4586c31c062298" title="Inserts a thread in the Ready List." alt="" coords="256,5,341,29"/> <area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="259,53,339,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga1e90d41fa021107d72b1bed81186aae8"></a><!-- doxytag: member="chqueues.h::chOQWriteTimeout" ref="ga1e90d41fa021107d72b1bed81186aae8" args="(OutputQueue *oqp, const uint8_t *bp, size_t n, systime_t time)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t chOQWriteTimeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_generic_queue.html">OutputQueue</a> *&nbsp;</td>
<td class="paramname"> <em>oqp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="group___s_t_m8___c_o_r_e.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&nbsp;</td>
<td class="paramname"> <em>bp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gac46524873fe28f00864e5ebe155bb523">systime_t</a>&nbsp;</td>
<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>Output queue write with timeout. </p>
<p>The function writes data from a buffer to an output queue. The operation completes when the specified amount of data has been transferred or after the specified timeout or if the queue has been reset. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The function is not atomic, if you need atomicity it is suggested to use a semaphore or a mutex for mutual exclusion. </dd>
<dd>
The queue callback is invoked before entering a sleep state and at the end of the transfer.</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>oqp</em>&nbsp;</td><td>pointer to an <code>OutputQueue</code> structure </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>bp</em>&nbsp;</td><td>pointer to the data buffer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>the maximum amount of data to be transferred, the value 0 is reserved </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 number of bytes effectively transferred. </dd></dl>
<p>Definition at line <a class="el" href="chqueues_8c_source.html#l00327">327</a> of file <a class="el" href="chqueues_8c_source.html">chqueues.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__io__queues.html#gaca8b2bc8aae722ba9f47f21c358420f9">chOQIsFull</a>, <a class="el" href="group__semaphores.html#ga748b56bc2be187e316496d7b6e748f89">chSemFastWaitI</a>, <a class="el" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03">chSemWaitTimeoutS()</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_generic_queue.html#a644ac8a420048012cf562a31e8c144c6">GenericQueue::q_buffer</a>, <a class="el" href="struct_generic_queue.html#ab8c8dc77de2c387f8a980a9c179388e1">GenericQueue::q_notify</a>, <a class="el" href="struct_generic_queue.html#a21fa1b28fa19bbb1b036c396b44d9fd5">GenericQueue::q_sem</a>, <a class="el" href="struct_generic_queue.html#a2345976305f32ce54981ad1ee36e77be">GenericQueue::q_top</a>, <a class="el" href="struct_generic_queue.html#a5cf5a39a1a57b15d1a2491edcbd72442">GenericQueue::q_wrptr</a>, and <a class="el" href="group__scheduler.html#gae1c86078318e11c2fa57ee3c2ec69f61">RDY_OK</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group__io__queues_ga1e90d41fa021107d72b1bed81186aae8_cgraph.png" border="0" usemap="#group__io__queues_ga1e90d41fa021107d72b1bed81186aae8_cgraph_map" alt=""></div>
<map name="group__io__queues_ga1e90d41fa021107d72b1bed81186aae8_cgraph_map" id="group__io__queues_ga1e90d41fa021107d72b1bed81186aae8_cgraph">
<area shape="rect" href="group__semaphores.html#ga924ec5d191bb8debe8727ae4dd5d6d03" title="Performs a wait operation on a semaphore with timeout specification." alt="" coords="165,5,285,29"/> <area shape="rect" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b" title="Puts the current thread to sleep into the specified state with timeout specification..." alt="" coords="335,5,471,29"/> </map>
</div>
</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Jul 11 13:13:17 2010 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.6.3</small></address>
</body>
</html>