gnuk/ChibiOS_2.0.8/docs/html/group__time.html
2010-11-30 13:54:43 +09:00

505 lines
33 KiB
HTML

<!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: Time and Virtual Timers</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.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<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="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> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<h1>Time and Virtual Timers<br/>
<small>
[<a class="el" href="group__base.html">Base Kernel Services</a>]</small>
</h1> </div>
</div>
<div class="contents">
<p><div class="dynheader">
Collaboration diagram for Time and Virtual Timers:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__time.png" border="0" alt="" usemap="#group____time"/>
<map name="group____time" id="group____time">
<area shape="rect" id="node1" href="group__base.html" title="Base Kernel Services" alt="" coords="7,5,132,32"/>
</map>
</td></tr></table></center>
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>Time and Virtual Timers related APIs and services. </p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
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_virtual_timer.html">VirtualTimer</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual Timer descriptor structure. <a href="struct_virtual_timer.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_v_t_list.html">VTList</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual timers list header. <a href="struct_v_t_list.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
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__time.html#gab64090e53ca84e2179acbbf61aa9c71f">S2ST</a>(sec)&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)((sec) * CH_FREQUENCY))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Time conversion utility. <a href="#gab64090e53ca84e2179acbbf61aa9c71f"></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__time.html#ga0a7e7bc6c6225bd9652c4f1567f1bc6a">MS2ST</a>(msec)&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)(((((msec) - 1L) * CH_FREQUENCY) / 1000L) + 1L))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Time conversion utility. <a href="#ga0a7e7bc6c6225bd9652c4f1567f1bc6a"></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__time.html#ga093b2a96d7a52eb5988739fff1b5a995">US2ST</a>(usec)&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)(((((usec) - 1L) * CH_FREQUENCY) / 1000000L) + 1L))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Time conversion utility. <a href="#ga093b2a96d7a52eb5988739fff1b5a995"></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__time.html#ga3cc8210175b310d62e2043f752ccafee">chVTDoTickI</a>()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual timers ticker. <a href="#ga3cc8210175b310d62e2043f752ccafee"></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__time.html#gae54e6dd40bc7b9cdeb409393ec9e134a">chVTIsArmedI</a>(vtp)&nbsp;&nbsp;&nbsp;((vtp)-&gt;vt_func != NULL)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns TRUE if the speciified timer is armed. <a href="#gae54e6dd40bc7b9cdeb409393ec9e134a"></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__time.html#ga137c8f67c450f34416a786d169be90e2">chTimeNow</a>()&nbsp;&nbsp;&nbsp;(vtlist.vt_systime)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Current system time. <a href="#ga137c8f67c450f34416a786d169be90e2"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
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__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2">vtfunc_t</a> )(void *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual Timer callback function. <a href="#gae6dbe55ffac66f346e05fd99cb4a76b2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_virtual_timer.html">VirtualTimer</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__time.html#ga56e290c9d94c0d1888c09df6af39c74a">VirtualTimer</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual Timer structure type. <a href="#ga56e290c9d94c0d1888c09df6af39c74a"></a><br/></td></tr>
<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__time.html#ga3f64863d042de0de89233bfeabe39b62">vt_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual Timers initialization. <a href="#ga3f64863d042de0de89233bfeabe39b62"></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__time.html#ga1c44c3a0bc64b2954d95cd98b2e7124e">chVTSetI</a> (<a class="el" href="struct_virtual_timer.html">VirtualTimer</a> *vtp, <a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> time, <a class="el" href="group__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2">vtfunc_t</a> vtfunc, void *par)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables a virtual timer. <a href="#ga1c44c3a0bc64b2954d95cd98b2e7124e"></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__time.html#ga680d851a74e594cc965101e79891840f">chVTResetI</a> (<a class="el" href="struct_virtual_timer.html">VirtualTimer</a> *vtp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disables a Virtual Timer. <a href="#ga680d851a74e594cc965101e79891840f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga7556af1cb61728b53228fa3af1c851de">bool_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__time.html#ga47933e7381151ab9cc0888e53ced3847">chTimeIsWithin</a> (<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> start, <a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a> end)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks if the current system time is within the specified time window. <a href="#ga47933e7381151ab9cc0888e53ced3847"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_v_t_list.html">VTList</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac">vtlist</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual timers delta list header. <a href="#gaf86fafcf8f7ea15d07e55f45dd80e3ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_v_t_list.html">VTList</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac">vtlist</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual timers delta list header. <a href="#gaf86fafcf8f7ea15d07e55f45dd80e3ac"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gab64090e53ca84e2179acbbf61aa9c71f"></a><!-- doxytag: member="chvt.h::S2ST" ref="gab64090e53ca84e2179acbbf61aa9c71f" args="(sec)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define S2ST</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">sec</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)((sec) * CH_FREQUENCY))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Time conversion utility. </p>
<p>Converts from seconds to system ticks number. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The result is rounded upward to the next tick boundary. </dd></dl>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00043">43</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga0a7e7bc6c6225bd9652c4f1567f1bc6a"></a><!-- doxytag: member="chvt.h::MS2ST" ref="ga0a7e7bc6c6225bd9652c4f1567f1bc6a" args="(msec)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MS2ST</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">msec</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)(((((msec) - 1L) * CH_FREQUENCY) / 1000L) + 1L))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Time conversion utility. </p>
<p>Converts from milliseconds to system ticks number. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The result is rounded upward to the next tick boundary. </dd></dl>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00050">50</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga076506461b42641a9fe632cc3e72dab5">mmcStart()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga6aae8e8af4ea0c35c677fa472fb36318">tmrfunc()</a>.</p>
</div>
</div>
<a class="anchor" id="ga093b2a96d7a52eb5988739fff1b5a995"></a><!-- doxytag: member="chvt.h::US2ST" ref="ga093b2a96d7a52eb5988739fff1b5a995" args="(usec)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define US2ST</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">usec</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>)(((((usec) - 1L) * CH_FREQUENCY) / 1000000L) + 1L))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Time conversion utility. </p>
<p>Converts from microseconds to system ticks number. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The result is rounded upward to the next tick boundary. </dd></dl>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00057">57</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga3cc8210175b310d62e2043f752ccafee"></a><!-- doxytag: member="chvt.h::chVTDoTickI" ref="ga3cc8210175b310d62e2043f752ccafee" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chVTDoTickI</td>
<td>(</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__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>.<a class="code" href="struct_v_t_list.html#ac2964dcbab06e6498301aaf51d508d77" title="System Time counter.">vt_systime</a>++; \
<span class="keywordflow">if</span> (&amp;<a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a> != (<a class="code" href="struct_v_t_list.html" title="Virtual timers list header.">VTList</a> *)<a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>.<a class="code" href="struct_v_t_list.html#a18ed6321ebb9d1d4977bc3b1a8d6531d" title="Next timer in the delta list.">vt_next</a>) { \
<a class="code" href="struct_virtual_timer.html" title="Virtual Timer descriptor structure.">VirtualTimer</a> *vtp; \
\
--<a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>.<a class="code" href="struct_v_t_list.html#a18ed6321ebb9d1d4977bc3b1a8d6531d" title="Next timer in the delta list.">vt_next</a>-&gt;<a class="code" href="struct_virtual_timer.html#a81422ae4e1d42f486d678bf85772573f" title="Time delta before timeout.">vt_time</a>; \
<span class="keywordflow">while</span> (!(vtp = <a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>.<a class="code" href="struct_v_t_list.html#a18ed6321ebb9d1d4977bc3b1a8d6531d" title="Next timer in the delta list.">vt_next</a>)-&gt;vt_time) { \
<a class="code" href="group__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2" title="Virtual Timer callback function.">vtfunc_t</a> fn = vtp-&gt;<a class="code" href="struct_virtual_timer.html#aac8307916bebf903e4f3e783910cf0e6" title="Timer callback function pointer.">vt_func</a>; \
vtp-&gt;<a class="code" href="struct_virtual_timer.html#aac8307916bebf903e4f3e783910cf0e6" title="Timer callback function pointer.">vt_func</a> = (vtfunc_t)NULL; \
vtp-&gt;<a class="code" href="struct_virtual_timer.html#a7130d3aa62ec1ee1c71a1034278cd60f" title="Next timer in the delta list.">vt_next</a>-&gt;<a class="code" href="struct_virtual_timer.html#ab2a1ca6407192845f2cb04ba9775c593" title="Previous timer in the delta list.">vt_prev</a> = (<span class="keywordtype">void</span> *)&amp;<a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>; \
(&amp;<a class="code" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac" title="Virtual timers delta list header.">vtlist</a>)-&gt;vt_next = vtp-&gt;<a class="code" href="struct_virtual_timer.html#a7130d3aa62ec1ee1c71a1034278cd60f" title="Next timer in the delta list.">vt_next</a>; \
fn(vtp-&gt;<a class="code" href="struct_virtual_timer.html#aa86e3ff1de8fa6c58f2267ed6bc09cb1" title="Timer callback function parameter.">vt_par</a>); \
} \
} \
}
</pre></div>
<p>Virtual timers ticker. </p>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00106">106</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
<p>Referenced by <a class="el" href="group__system.html#ga1e42ee112f4a5d2c95be07d523c247be">chSysTimerHandlerI()</a>.</p>
</div>
</div>
<a class="anchor" id="gae54e6dd40bc7b9cdeb409393ec9e134a"></a><!-- doxytag: member="chvt.h::chVTIsArmedI" ref="gae54e6dd40bc7b9cdeb409393ec9e134a" args="(vtp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chVTIsArmedI</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">vtp</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((vtp)-&gt;vt_func != NULL)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns TRUE if the speciified timer is armed. </p>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00139">139</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
<p>Referenced by <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, and <a class="el" href="classchibios__rt_1_1_timer.html#a97e29d53a4aaf2ef997732be63fdee6e">chibios_rt::Timer::IsArmed()</a>.</p>
</div>
</div>
<a class="anchor" id="ga137c8f67c450f34416a786d169be90e2"></a><!-- doxytag: member="chvt.h::chTimeNow" ref="ga137c8f67c450f34416a786d169be90e2" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define chTimeNow</td>
<td>(</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(vtlist.vt_systime)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Current system time. </p>
<p>Returns the number of system ticks since the <code><a class="el" href="group__system.html#gafe2c7de6567e98e487e009e81e3be10b" title="ChibiOS/RT initialization.">chSysInit()</a></code> invocation. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The counter can reach its maximum and then restart from zero. </dd>
<dd>
This function is designed to work with the <code><a class="el" href="group__threads.html#ga9e6e2f8d46d415e8f0862daf0be1d984" title="Suspends the invoking thread until the system time arrives to the specified value.">chThdSleepUntil()</a></code>.</dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The system time in ticks.r </dd></dl>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00150">150</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
<p>Referenced by <a class="el" href="group__debug.html#gac7f8f0653faf2e3a93108ff5333821b7">chDbgTrace()</a>, <a class="el" href="group__threads.html#ga9e6e2f8d46d415e8f0862daf0be1d984">chThdSleepUntil()</a>, <a class="el" href="group__time.html#ga47933e7381151ab9cc0888e53ced3847">chTimeIsWithin()</a>, <a class="el" href="classchibios__rt_1_1_system.html#a74fb442c63f2a34c0a81dbfa42319976">chibios_rt::System::GetTime()</a>, <a class="el" href="group___m_a_c.html#ga151a33674ef86c2403ac7797fa87805c">macWaitReceiveDescriptor()</a>, and <a class="el" href="group___m_a_c.html#ga7304721038db1d7c0cb616c9c4d3f0ce">macWaitTransmitDescriptor()</a>.</p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gae6dbe55ffac66f346e05fd99cb4a76b2"></a><!-- doxytag: member="chvt.h::vtfunc_t" ref="gae6dbe55ffac66f346e05fd99cb4a76b2" args=")(void *)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2">vtfunc_t</a>)(void *)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Virtual Timer callback function. </p>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00062">62</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga56e290c9d94c0d1888c09df6af39c74a"></a><!-- doxytag: member="chvt.h::VirtualTimer" ref="ga56e290c9d94c0d1888c09df6af39c74a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="struct_virtual_timer.html">VirtualTimer</a> <a class="el" href="struct_virtual_timer.html">VirtualTimer</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Virtual Timer structure type. </p>
<p>Definition at line <a class="el" href="chvt_8h_source.html#l00067">67</a> of file <a class="el" href="chvt_8h_source.html">chvt.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga3f64863d042de0de89233bfeabe39b62"></a><!-- doxytag: member="chvt.h::vt_init" ref="ga3f64863d042de0de89233bfeabe39b62" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void vt_init </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Virtual Timers initialization. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Internal use only. </dd></dl>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00047">47</a> of file <a class="el" href="chvt_8c_source.html">chvt.c</a>.</p>
<p>References <a class="el" href="struct_v_t_list.html#a18ed6321ebb9d1d4977bc3b1a8d6531d">VTList::vt_next</a>, <a class="el" href="struct_v_t_list.html#a0e89630d5a1b82bb6bfbca1465cfa1f7">VTList::vt_prev</a>, <a class="el" href="struct_v_t_list.html#ac2964dcbab06e6498301aaf51d508d77">VTList::vt_systime</a>, and <a class="el" href="struct_v_t_list.html#a565bf88a53b8ee8a5cd20f42d94b05c6">VTList::vt_time</a>.</p>
<p>Referenced by <a class="el" href="group__system.html#gafe2c7de6567e98e487e009e81e3be10b">chSysInit()</a>.</p>
</div>
</div>
<a class="anchor" id="ga1c44c3a0bc64b2954d95cd98b2e7124e"></a><!-- doxytag: member="chvt.h::chVTSetI" ref="ga1c44c3a0bc64b2954d95cd98b2e7124e" args="(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chVTSetI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_virtual_timer.html">VirtualTimer</a> *&nbsp;</td>
<td class="paramname"> <em>vtp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
<td class="paramname"> <em>time</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__time.html#gae6dbe55ffac66f346e05fd99cb4a76b2">vtfunc_t</a>&nbsp;</td>
<td class="paramname"> <em>vtfunc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>par</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables a virtual timer. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The associated function is invoked by an interrupt handler within the I-Locked 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>vtp</em>&nbsp;</td><td>the <code><a class="el" href="struct_virtual_timer.html" title="Virtual Timer descriptor structure.">VirtualTimer</a></code> structure pointer </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>time</em>&nbsp;</td><td>the number of time ticks, the value <code>TIME_INFINITE</code> is notallowed. The value <code>TIME_IMMEDIATE</code> is allowed but interpreted as a normal time specification not as an immediate timeout specification. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>vtfunc</em>&nbsp;</td><td>the timer callback function. After invoking the callback the timer is disabled and the structure can be disposed or reused. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>par</em>&nbsp;</td><td>a parameter that will be passed to the callback function </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00070">70</a> of file <a class="el" href="chvt_8c_source.html">chvt.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__scheduler.html#gae1568cf3090c973c3bc47f86ae2f5afb">TIME_INFINITE</a>, <a class="el" href="struct_virtual_timer.html#aac8307916bebf903e4f3e783910cf0e6">VirtualTimer::vt_func</a>, <a class="el" href="struct_virtual_timer.html#a7130d3aa62ec1ee1c71a1034278cd60f">VirtualTimer::vt_next</a>, <a class="el" href="struct_v_t_list.html#a18ed6321ebb9d1d4977bc3b1a8d6531d">VTList::vt_next</a>, <a class="el" href="struct_virtual_timer.html#aa86e3ff1de8fa6c58f2267ed6bc09cb1">VirtualTimer::vt_par</a>, <a class="el" href="struct_virtual_timer.html#ab2a1ca6407192845f2cb04ba9775c593">VirtualTimer::vt_prev</a>, and <a class="el" href="struct_virtual_timer.html#a81422ae4e1d42f486d678bf85772573f">VirtualTimer::vt_time</a>.</p>
<p>Referenced by <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga076506461b42641a9fe632cc3e72dab5">mmcStart()</a>, <a class="el" href="classchibios__rt_1_1_timer.html#a375cb7ce8108c24336016a94efd8a787">chibios_rt::Timer::Set()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga6aae8e8af4ea0c35c677fa472fb36318">tmrfunc()</a>.</p>
</div>
</div>
<a class="anchor" id="ga680d851a74e594cc965101e79891840f"></a><!-- doxytag: member="chvt.h::chVTResetI" ref="ga680d851a74e594cc965101e79891840f" args="(VirtualTimer *vtp)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void chVTResetI </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_virtual_timer.html">VirtualTimer</a> *&nbsp;</td>
<td class="paramname"> <em>vtp</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disables a Virtual Timer. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The timer MUST be active when this function is invoked.</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>vtp</em>&nbsp;</td><td>the <code><a class="el" href="struct_virtual_timer.html" title="Virtual Timer descriptor structure.">VirtualTimer</a></code> structure pointer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00097">97</a> of file <a class="el" href="chvt_8c_source.html">chvt.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>, <a class="el" href="struct_virtual_timer.html#aac8307916bebf903e4f3e783910cf0e6">VirtualTimer::vt_func</a>, <a class="el" href="struct_virtual_timer.html#a7130d3aa62ec1ee1c71a1034278cd60f">VirtualTimer::vt_next</a>, <a class="el" href="struct_virtual_timer.html#ab2a1ca6407192845f2cb04ba9775c593">VirtualTimer::vt_prev</a>, and <a class="el" href="struct_virtual_timer.html#a81422ae4e1d42f486d678bf85772573f">VirtualTimer::vt_time</a>.</p>
<p>Referenced by <a class="el" href="group__scheduler.html#ga306e564f678c1a39139639490c77e78b">chSchGoSleepTimeoutS()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga27833cde77794f914e4802c7e65281a5">mmcStop()</a>, and <a class="el" href="classchibios__rt_1_1_timer.html#a065b7fbc2a055152c39505ae91ea9754">chibios_rt::Timer::Reset()</a>.</p>
</div>
</div>
<a class="anchor" id="ga47933e7381151ab9cc0888e53ced3847"></a><!-- doxytag: member="chvt.h::chTimeIsWithin" ref="ga47933e7381151ab9cc0888e53ced3847" args="(systime_t start, systime_t end)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__types.html#ga7556af1cb61728b53228fa3af1c851de">bool_t</a> chTimeIsWithin </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
<td class="paramname"> <em>start</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__types.html#gae3e32a98d431a02106616da3071832dd">systime_t</a>&nbsp;</td>
<td class="paramname"> <em>end</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks if the current system time is within the specified time window. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>When start==end then the function returns always true because the whole time range is specified.</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>start</em>&nbsp;</td><td>the start of the time window (inclusive) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>end</em>&nbsp;</td><td>the end of the time window (non inclusive) </td></tr>
</table>
</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>TRUE</em>&nbsp;</td><td>current time within the specified time window. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FALSE</em>&nbsp;</td><td>current time not within the specified time window. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00122">122</a> of file <a class="el" href="chvt_8c_source.html">chvt.c</a>.</p>
<p>References <a class="el" href="group__time.html#ga137c8f67c450f34416a786d169be90e2">chTimeNow</a>.</p>
</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gaf86fafcf8f7ea15d07e55f45dd80e3ac"></a><!-- doxytag: member="chvt.h::vtlist" ref="gaf86fafcf8f7ea15d07e55f45dd80e3ac" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_v_t_list.html">VTList</a> <a class="el" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac">vtlist</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Virtual timers delta list header. </p>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00041">41</a> of file <a class="el" href="chvt_8c_source.html">chvt.c</a>.</p>
</div>
</div>
<a class="anchor" id="gaf86fafcf8f7ea15d07e55f45dd80e3ac"></a><!-- doxytag: member="chvt.c::vtlist" ref="gaf86fafcf8f7ea15d07e55f45dd80e3ac" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_v_t_list.html">VTList</a> <a class="el" href="group__time.html#gaf86fafcf8f7ea15d07e55f45dd80e3ac">vtlist</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Virtual timers delta list header. </p>
<p>Definition at line <a class="el" href="chvt_8c_source.html#l00041">41</a> of file <a class="el" href="chvt_8c_source.html">chvt.c</a>.</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Nov 28 2010 14:09:56 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>
</body>
</html>