📄 main_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 Radio Tutorial: main.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="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>main.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The main user module tutorial code.
<p>
<code>#include "WirelessUSBLS_1.h"</code><br>
<code>#include "<a class="el" href="cypdef_8h.html">cypdef.h</a>"</code><br>
<code>#include "psocgpioint.h"</code><br>
<code>#include "lcd.h"</code><br>
<code>#include "stdlib.h"</code><br>
<p>
Include dependency graph for main.c:<p><center><img src="main_8c__incl.png" border="0" usemap="#main.c_map" alt="Include dependency graph"></center>
<map name="main.c_map">
<area href="cypdef_8h.html" shape="rect" coords="176,82,248,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 </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a0">RX_TIMEOUT</a> 1000</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a9">button_pressed</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a10">switch_LED</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a11">main</a> ()</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="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a1">flag_LED</a> = 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a2">button_up</a> = TRUE</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a3">pn_code_table</a> []</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a4">tx_buf</a> [1]</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a5">rx_buf</a> [1]</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a0">UINT8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a6">valid_buf</a> [1]</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a1">UINT16</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a7">tx_count</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="cypdef_8h.html#a1">UINT16</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a8">rx_count</a></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a0" doxytag="main.c::RX_TIMEOUT"></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 RX_TIMEOUT 1000 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
A 16 bit timeout counter. (15 usec units) Only used for the blocking read, WirelessUSBLS_bReadData()). See WirelessUSBLS user module datasheet for more details. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a9" doxytag="main.c::button_pressed"></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#a0">UINT8</a> button_pressed </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: Check to see if the button is pressed<p>
Inputs: void<p>
Returns:<ul>
<li>1 - Button pressed</li><li>0 - Button not pressed </li></ul>
</td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="main.c::switch_LED"></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 switch_LED </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: Switches LED's when the radio receives a packet<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="main.c::main"></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 main </td>
<td class="md" valign="top">( </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: The User Module tutorial main routine initializes the radio and sets the channel and PN code via the WirelessUSB LS user module. Then it continuously looks for a button press ( using <a class="el" href="main_8c.html#a9">button_pressed()</a> ) and listens for byte 0x55. If the button is pressed, byte 0x55 will be transmitted. If byte 0x55 is received, the LEDs will toggle. It listens for and transmits byte 0x55 via the WirelessUSB LS user module.<p>
Inputs: Void<p>
Returns: Void </td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="main_8c_a11_cgraph.png" border="0" usemap="#main_8c_a11_cgraph_map" alt=""></center>
<map name="main_8c_a11_cgraph_map">
<area href="main_8c.html#a9" shape="rect" coords="110,7,222,34" alt="">
<area href="main_8c.html#a10" shape="rect" coords="121,58,212,85" alt="">
</map>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="a1" doxytag="main.c::flag_LED"></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#a0">UINT8</a> <a class="el" href="main_8c.html#a1">flag_LED</a> = 1 </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Flag for toggling LEDs.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="main.c::button_up"></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#a0">UINT8</a> <a class="el" href="main_8c.html#a2">button_up</a> = TRUE </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -