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

📄 protocol_8c.html

📁 cypress公司PROC开发源码(cywusb6953)
💻 HTML
📖 第 1 页 / 共 3 页
字号:
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="cypdef_8h.html#a1">UINT8</a> protocol_calc_ck_sum           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="cypdef_8h.html#a1">UINT8</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="cypdef_8h.html#a1">UINT8</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>len</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="cypdef_8h.html#a1">UINT8</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>seed</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Description: Calculate Packet Checksum<p>
Inputs:<ul>
<li>*data - Packet pointer</li><li>len - Length of packet</li><li>seed - Checksum seed</li></ul>
<p>
Returns:<ul>
<li>checksum - Checksum calculated from data </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a20" doxytag="protocol.c::protocol_gen_parity"></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"><a class="el" href="cypdef_8h.html#a1">UINT8</a> protocol_gen_parity           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="cypdef_8h.html#a1">UINT8</a>&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>data</em>          </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: Calculate odd parity for a byte of data<p>
Inputs:<ul>
<li>data - data byte</li></ul>
<p>
Returns:<ul>
<li>1 - even number of ones</li><li>0 - odd number of ones </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a21" doxytag="protocol.c::protocol_get_rx_packet_length"></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"><a class="el" href="cypdef_8h.html#a1">UINT8</a> protocol_get_rx_packet_length           </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: Returns the length of the data that is being received<p>
Inputs: Void<p>
Returns:<ul>
<li>rx_data_length - Length of receive packet </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a22" doxytag="protocol.c::protocol_send_ack"></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 protocol_send_ack           </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: Formats the acknowledge packet and transmits it<p>
Inputs: Void<p>
Returns: Void     </td>
  </tr>
</table>

<p>
Here is the call graph for this function:<p><center><img src="protocol_8c_a22_cgraph.png" border="0" usemap="#protocol_8c_a22_cgraph_map" alt=""></center>
<map name="protocol_8c_a22_cgraph_map">
<area href="protocol_8h.html#a95" shape="rect" coords="193,8,331,34" alt="">
</map>
<a class="anchor" name="a23" doxytag="protocol.c::protocol_verify_packet"></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"><a class="el" href="cypdef_8h.html#a1">UINT8</a> protocol_verify_packet           </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: Gets packet data and makes sure the bytes are protocol perfect(otherwise it will return NO_PACKET). It checks and fixes packets with checksums by testing each column of bits (See comments and comment block in code source). It then compares checksums with the calculated checksum.<p>
Inputs: Void<p>
Returns:<ul>
<li>0x00-0x07 - Packet type (See <a class="el" href="protocol_8h.html">protocol.h</a> for types of packets)</li><li>NO_PACKET - no packet or bad packet </li></ul>
    </td>
  </tr>
</table>

<p>
Here is the call graph for this function:<p><center><img src="protocol_8c_a23_cgraph.png" border="0" usemap="#protocol_8c_a23_cgraph_map" alt=""></center>
<map name="protocol_8c_a23_cgraph_map">
<area href="protocol_8h.html#a96" shape="rect" coords="213,7,368,34" alt="">
<area href="protocol_8h.html#a95" shape="rect" coords="221,58,360,85" alt="">
</map>
<a class="anchor" name="a24" doxytag="protocol.c::protocol_get_tx_pkt"></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* protocol_get_tx_pkt           </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: Returns a pointer to the radio transmit packet<p>
Inputs: Void<p>
Returns: Void *     </td>
  </tr>
</table>
<a class="anchor" name="a25" doxytag="protocol.c::protocol_get_rx_pkt"></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* protocol_get_rx_pkt           </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: Returns a pointer to the radio receive packet<p>
Inputs: Void<p>
Returns: Void *     </td>
  </tr>
</table>
<a class="anchor" name="a26" doxytag="protocol.c::protocol_get_next_channel"></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 protocol_get_next_channel           </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: Performs the channel selection algorithm. Every sixth channel will be used.<p>
Inputs: Void<p>
Returns: Void     </td>
  </tr>
</table>
<a class="anchor" name="a27" doxytag="protocol.c::protocol_init_channel"></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 protocol_init_channel           </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 channel selection algorithm to the top channel in the channel subset<p>
Inputs: Void<p>
Returns: Void     </td>
  </tr>
</table>
<a class="anchor" name="a28" doxytag="protocol.c::protocol_calculate_network_id"></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 protocol_calculate_network_id           </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: Figures device parameters using algorithms to find PN code, channel, pin, and checksum seed (based off the MID).<p>
Inputs: Void<p>
Returns: Void     </td>
  </tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="a2" doxytag="protocol.c::sys_params"></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"><a class="el" href="struct__SYS__PARAMETERS.html">SYS_PARAMETERS</a> <a class="el" href="protocol_8c.html#a2">sys_params</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>

⌨️ 快捷键说明

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