📄 timer_8c.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>WirelessUSB(TM) LS PRoC DVK RS232 Master Application: timer.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>timer.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
This module provides a timer interface for general purpose timing requirements.
<p>
<code>#include "tick.h"</code><br>
<code>#include "<a class="el" href="ls__config_8h.html">ls_config.h</a>"</code><br>
<p>
Include dependency graph for timer.c:<p><center><img src="timer_8c__incl.png" border="0" usemap="#timer.c_map" alt="Include dependency graph"></center>
<map name="timer.c_map">
<area href="ls__config_8h.html" shape="rect" coords="113,157,198,184" alt="">
<area href="isr_8h.html" shape="rect" coords="133,82,178,109" alt="">
<area href="timer_8h.html" shape="rect" coords="202,82,266,109" alt="">
<area href="cypdef_8h.html" shape="rect" coords="198,8,270,34" alt="">
</map>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a1">tick_isr</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a2">delay_usec_loop</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a3">timer_init</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a4">timer_timer_on</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a5">timer_timer_off</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a6">timer_delay_10_usec</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a7">timer_delay_50_usec</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a8">timer_delay_100_usec</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a9">timer_delay_msec</a> (<a class="el" href="cypdef_8h.html#a2">UINT16</a> num_milliseconds)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a10">timer_countdown_start</a> (<a class="el" href="cypdef_8h.html#a2">UINT16</a> num_milliseconds)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a1">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a11">timer_countdown_expired</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="timer_8h.html#a3">TIME_STAMP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a12">timer_get_time_stamp</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a13">timer_time_elapsed</a> (<a class="el" href="timer_8h.html#a3">TIME_STAMP</a> from_timestamp, <a class="el" href="cypdef_8h.html#a2">UINT16</a> elapsed_time_ms)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="timer_8h.html#a3">TIME_STAMP</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8c.html#a0">tick</a></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a1" doxytag="timer.c::tick_isr"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void tick_isr </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: Interrupt service routine for the timer to tick<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="timer.c::delay_usec_loop"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void delay_usec_loop </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: The main delay loop for the specific Usec delay routines<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="timer.c::timer_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_init </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: Initialize the timer by setting the 32KHz clock parameters during calibration, and actually starting the timer.<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="timer_8c_a3_cgraph.png" border="0" usemap="#timer_8c_a3_cgraph_map" alt=""></center>
<map name="timer_8c_a3_cgraph_map">
<area href="timer_8c.html#a4" shape="rect" coords="137,8,249,34" alt="">
</map>
<a class="anchor" name="a4" doxytag="timer.c::timer_timer_on"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_timer_on </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: Resets the tick count, starts the timer, and enabled the timer interrupt<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="timer.c::timer_timer_off"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_timer_off </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: Stops the timer and disables the timer interrupts<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="timer.c::timer_delay_10_usec"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_delay_10_usec </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: To delay 10 Usec by running through the cycles for these instructions and 4 iterations of the delay_msec_loop routine<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="timer.c::timer_delay_50_usec"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_delay_50_usec </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Description: To delay 50 Usec by running through the cycles for these instructions and 28 iterations of the delay_msec_loop routine<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="timer.c::timer_delay_100_usec"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void timer_delay_100_usec </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -