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

📄 protocol_8c.html

📁 cypress公司PROC开发源码(cywusb6953)
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<li>LS_STATUS_SUCCESS - successful bind</li><li>LS_STATUS_FAILED - unsuccessful bind </li></ul>
    </td>
  </tr>
</table>

<p>
Here is the call graph for this function:<p><center><img src="protocol_8c_a19_cgraph.png" border="0" usemap="#protocol_8c_a19_cgraph_map" alt=""></center>
<map name="protocol_8c_a19_cgraph_map">
<area href="protocol_8h.html#a105" shape="rect" coords="196,109,332,136" alt="">
<area href="protocol_8c.html#a28" shape="rect" coords="394,210,552,237" alt="">
<area href="protocol_8h.html#a99" shape="rect" coords="613,198,768,225" alt="">
<area href="protocol_8h.html#a98" shape="rect" coords="621,249,760,276" alt="">
<area href="protocol_8c.html#a31" shape="rect" coords="382,8,564,34" alt="">
<area href="protocol_8c.html#a32" shape="rect" coords="398,58,548,85" alt="">
<area href="timer_8h.html#a13" shape="rect" coords="394,109,552,136" alt="">
<area href="timer_8c.html#a5" shape="rect" coords="633,72,748,98" alt="">
<area href="timer_8c.html#a4" shape="rect" coords="634,122,746,149" alt="">
</map>
<a class="anchor" name="a20" doxytag="protocol.c::master_data_mode"></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> master_data_mode           </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: Checks for idle data and receives a packet. If no packet is received then the radio is turned off. If a packet is received it transmits a response and checks for a receive response. While checking for a receive response, it first checks for a regular data packet (lets the app know if there is one), then either creates and sends an ack/data packet or an ack packet. If it doesn't check for a receive response it checks if the packet is a connect request with an approved device or if it is a ping packet and formats and transmits the packet. If it is neither of those, it checks to see if it a good acknowledge packet and sets up the return value. If it isn't a packet it checks the RSSI<p>
Inputs: Void<p>
Returns:<ul>
<li>DATA_RECEIVED - data packet</li><li>ACK_RECEIVED - valid acknowledge packet</li><li>DATA_IDLE - idle data </li></ul>
    </td>
  </tr>
</table>

<p>
Here is the call graph for this function:<p><center><img src="protocol_8c_a20_cgraph.png" border="0" usemap="#protocol_8c_a20_cgraph_map" alt=""></center>
<map name="protocol_8c_a20_cgraph_map">
<area href="protocol_8h.html#a105" shape="rect" coords="216,109,352,136" alt="">
<area href="protocol_8c.html#a28" shape="rect" coords="434,160,592,186" alt="">
<area href="protocol_8h.html#a99" shape="rect" coords="653,72,808,98" alt="">
<area href="protocol_8h.html#a98" shape="rect" coords="661,185,800,212" alt="">
<area href="timer_8h.html#a13" shape="rect" coords="434,261,592,288" alt="">
<area href="timer_8c.html#a11" shape="rect" coords="196,312,372,338" alt="">
<area href="protocol_8c.html#a31" shape="rect" coords="422,58,604,85" alt="">
<area href="protocol_8c.html#a32" shape="rect" coords="438,109,588,136" alt="">
<area href="timer_8c.html#a5" shape="rect" coords="673,298,788,325" alt="">
<area href="timer_8c.html#a4" shape="rect" coords="674,248,786,274" alt="">
</map>
<a class="anchor" name="a21" doxytag="protocol.c::master_send_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> master_send_packet           </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_length</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: Sets the transmit length of the data to be sent. The data loaded into tx_packet will be sent in an ACK/DATA packet in response to the next received DATA or NULL packet.<p>
Inputs:<ul>
<li>data_length: Length of app data in bytes</li></ul>
<p>
Returns:<ul>
<li>TRUE: Returns TRUE in order to maintain API consistency with slave. </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a22" doxytag="protocol.c::master_is_tx_buffer_empty"></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> master_is_tx_buffer_empty           </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: Checks if the master's tx_packet is currently empty.<p>
Inputs: Void<p>
Returns:<ul>
<li>TRUE - buffer is empty and can be loaded with the next packet</li><li>FALSE - buffer is not empty </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a23" doxytag="protocol.c::master_read_rx_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> master_read_rx_packet           </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_ptr</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>num_bytes</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: This routine copies the last received packet into the app's receive buffer.<p>
Inputs:<ul>
<li>*UINT8 - data_ptr = Location to copy the packet.</li><li>UINT8 - num_bytes = Number of bytes to copy. (If less than the full packet length, the extra bytes are discarded.)</li></ul>
<p>
Returns:<ul>
<li>UINT8 - i = Number of bytes copied. 0 if buffer was empty </li></ul>
    </td>
  </tr>
</table>
<a class="anchor" name="a24" doxytag="protocol.c::protocol_calc_ck_sum"></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_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="a25" 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="a26" 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="a27" 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;

⌨️ 快捷键说明

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