⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer_8h.html

📁 cypress公司PROC开发源码(cywusb6953)
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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 Slave Application: timer.h 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&nbsp;Page</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>timer.h 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 "<a class="el" href="cypdef_8h.html">cypdef.h</a>"</code><br>

<p>
Include dependency graph for timer.h:<p><center><img src="timer_8h__incl.png" border="0" usemap="#timer.h_map" alt="Include dependency graph"></center>
<map name="timer.h_map">
<area href="cypdef_8h.html" shape="rect" coords="8,82,80,109" alt="">
</map>

<p>
This graph shows which files directly or indirectly include this file:<p><center><img src="timer_8h__dep__incl.png" border="0" usemap="#timer.hdep_map" alt="Included by dependency graph"></center>
<map name="timer.hdep_map">
<area href="ls__config_8h.html" shape="rect" coords="188,157,273,184" alt="">
<area href="protocol_8h.html" shape="rect" coords="142,82,222,109" alt="">
<area href="main_8c.html" shape="rect" coords="8,8,69,34" alt="">
<area href="mfgtest_8c.html" shape="rect" coords="93,8,170,34" alt="">
<area href="protocol_8c.html" shape="rect" coords="194,8,274,34" alt="">
<area href="rs232_8c.html" shape="rect" coords="298,8,362,34" alt="">
<area href="timer_8c.html" shape="rect" coords="246,82,310,109" alt="">
</map>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a0">MS_TO_TICK</a>(n)&nbsp;&nbsp;&nbsp;(n)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a1">TICK_TO_MS</a>(n)&nbsp;&nbsp;&nbsp;(n)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a2">TIMER_CALIBRATE_TIMER</a>(b)</td></tr>

<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="cypdef_8h.html#a2">UINT16</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a3">TIME_STAMP</a></td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a4">timer_init</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a5">timer_timer_on</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a6">timer_timer_off</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a7">timer_delay_10_usec</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a8">timer_delay_50_usec</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a9">timer_delay_100_usec</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a10">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"><a class="el" href="timer_8h.html#a3">TIME_STAMP</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a11">timer_get_time_stamp</a> (void)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">BOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a12">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 class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a13">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>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="timer_8h.html#a14">timer_countdown_expired</a> (void)</td></tr>

</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a0" doxytag="timer.h::MS_TO_TICK"></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">#define MS_TO_TICK          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">n&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(n)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Millisecond to Tick (Note: 1 Millisecond is equivalent to 1 Tick). 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="a1" doxytag="timer.h::TICK_TO_MS"></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">#define TICK_TO_MS          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">n&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(n)</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Tick to Millisecond. 
<p>
    </td>
  </tr>
</table>
<a class="anchor" name="a2" doxytag="timer.h::TIMER_CALIBRATE_TIMER"></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">#define TIMER_CALIBRATE_TIMER          </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">b&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Defined as null unless TIMER_CAL is defined then it is defined as timer_calibrate_timer(b)     </td>
  </tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="a3" doxytag="timer.h::TIME_STAMP"></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">typedef <a class="el" href="cypdef_8h.html#a2">UINT16</a> <a class="el" href="timer_8h.html#a3">TIME_STAMP</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Mainly used for finding a time elapse. 
<p>
    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a4" doxytag="timer.h::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">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </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_8h_a4_cgraph.png" border="0" usemap="#timer_8h_a4_cgraph_map" alt=""></center>
<map name="timer_8h_a4_cgraph_map">
<area href="timer_8c.html#a4" shape="rect" coords="137,8,249,34" alt="">
</map>
<a class="anchor" name="a5" doxytag="timer.h::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">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </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="a6" doxytag="timer.h::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">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </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="a7" doxytag="timer.h::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">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -