📄 main_8h.html
字号:
<tr><td valign=top><em><a class="anchor" name="a26a3" doxytag="ST_AVR_INIT_MODEM" ></a>ST_AVR_INIT_MODEM</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a4" doxytag="ST_AVR_READY" ></a>ST_AVR_READY</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a5" doxytag="ST_AVR_NO_ECHO" ></a>ST_AVR_NO_ECHO</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a6" doxytag="ST_AVR_WRONG_STORAGE" ></a>ST_AVR_WRONG_STORAGE</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a7" doxytag="ST_AVR_WRONG_OPTION" ></a>ST_AVR_WRONG_OPTION</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a8" doxytag="ST_AVR_NEW_SMS" ></a>ST_AVR_NEW_SMS</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a9" doxytag="ST_AVR_NEW_SMS_function" ></a>ST_AVR_NEW_SMS_function</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a10" doxytag="ST_AVR_DELETE" ></a>ST_AVR_DELETE</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a11" doxytag="ST_AVR_DELETE_function" ></a>ST_AVR_DELETE_function</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a12" doxytag="ST_AVR_READ" ></a>ST_AVR_READ</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a13" doxytag="ST_AVR_READ_function" ></a>ST_AVR_READ_function</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a14" doxytag="ST_AVR_DISPLAY" ></a>ST_AVR_DISPLAY</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a15" doxytag="ST_AVR_SEND" ></a>ST_AVR_SEND</em> </td><td></td></tr><tr><td valign=top><em><a class="anchor" name="a26a16" doxytag="ST_AVR_SEND_function" ></a>ST_AVR_SEND_function</em> </td><td></td></tr></table></dl><p>Definition at line <a class="el" href="main_8h-source.html#l00031">31</a> of file <a class="el" href="main_8h-source.html">main.h</a>.<p><pre class="fragment"><div>00032 {00033 00034 <a class="code" href="main_8h.html#a26a2">ST_AVR_IDLE</a> = 10, <span class="comment">//<! Idle state, before the phone is connected</span>00035 <a class="code" href="main_8h.html#a26a3">ST_AVR_INIT_MODEM</a>, <span class="comment">//<! This state will call the modem init function</span>00036 <a class="code" href="main_8h.html#a26a4">ST_AVR_READY</a>, <span class="comment">//<! Ready state, waiting for new message or key input</span>00037 00038 <a class="code" href="main_8h.html#a26a5">ST_AVR_NO_ECHO</a>, <span class="comment">//<! State to give error message to user during API_modem_init()</span>00039 <a class="code" href="main_8h.html#a26a6">ST_AVR_WRONG_STORAGE</a>, <span class="comment">//<! State to give error message to user during API_modem_init()</span>00040 <a class="code" href="main_8h.html#a26a7">ST_AVR_WRONG_OPTION</a>, <span class="comment">//<! State to give error message to user during API_modem_init()</span>00041 00042 <a class="code" href="main_8h.html#a26a8">ST_AVR_NEW_SMS</a>, <span class="comment">//<! Will display that a new message has arrived, user must push enter to read</span>00043 <a class="code" href="main_8h.html#a26a9">ST_AVR_NEW_SMS_function</a>, <span class="comment">//<! In this state the index of the new message will be extracted</span>00044 00045 <a class="code" href="main_8h.html#a26a10">ST_AVR_DELETE</a>, <span class="comment">//<! Display "DELETE MESSAGE"</span>00046 <a class="code" href="main_8h.html#a26a11">ST_AVR_DELETE_function</a>, <span class="comment">//<! Call the API_delete() function</span>00047 <a class="code" href="main_8h.html#a26a12">ST_AVR_READ</a>, <span class="comment">//<! Display "READ MESSAGE"</span>00048 <a class="code" href="main_8h.html#a26a13">ST_AVR_READ_function</a>, <span class="comment">//<! Call API_readmsg()</span>00049 00050 <a class="code" href="main_8h.html#a26a14">ST_AVR_DISPLAY</a>, <span class="comment">//<! Display new message</span>00051 00052 <a class="code" href="main_8h.html#a26a15">ST_AVR_SEND</a>, <span class="comment">//<! Dispaly "SEND SMS "</span>00053 <a class="code" href="main_8h.html#a26a16">ST_AVR_SEND_function</a> <span class="comment">//<! Call API_sendmsg</span>00054 }<a class="code" href="main_8h.html#a26">states</a>;</div></pre> </td> </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a25" doxytag="main.h::getInput" ></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"> char getInput </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> </td> </tr></table><a class="anchor" name="a23" doxytag="main.h::Initialization" ></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 Initialization </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>This function setup the hardware. <p>Set up:<br> *PORTB<br> *PORTE<br> *Serial communication<br> *Buttons<br> *LCD<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>void</em> </td><td></td></tr> </table></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>none</em> </td><td></td></tr> </table></dl><p>Definition at line <a class="el" href="main_8c-source.html#l00206">206</a> of file <a class="el" href="main_8c-source.html">main.c</a>.<p>References <a class="el" href="button_8c-source.html#l00050">Button_Init()</a>, <a class="el" href="AVRGSM__com_8c-source.html#l00066">COM_init()</a>, and <a class="el" href="LCD__driver_8c-source.html#l00134">LCD_Init()</a>.<p>Referenced by <a class="el" href="main_8c-source.html#l00084">main()</a>.<p><pre class="fragment"><div>00207 {00208 00209 PORTB = (15<<PORTB0); <span class="comment">// Enable pullup on</span>00210 PORTE = (15<<PORTE4);00211 00212 <a class="code" href="AVRGSM__com_8h.html#a7">COM_init</a>( 51 ); <span class="comment">//9600bps @ 8MHz</span>00213 <a class="code" href="button_8c.html#a3">Button_Init</a>( ); <span class="comment">// Initialize pin change interrupt on joystick</span>00214 <a class="code" href="LCD__driver_8c.html#a11">LCD_Init</a>( ); <span class="comment">// initialize the LCD</span>00215 }</div></pre><p>Here is the call graph for this function:<p><center><img src="main_8h_a23_cgraph.png" border="0" usemap="#main_8h_a23_cgraph_map" alt=""></center><map name="main_8h_a23_cgraph_map"><area href="button_8c.html#a3" shape="rect" coords="149,7,235,33" alt=""><area href="AVRGSM__com_8h.html#a7" shape="rect" coords="153,57,231,84" alt=""><area href="LCD__driver_8c.html#a11" shape="rect" coords="155,108,229,135" alt=""><area href="AVRGSM__com_8c.html#a13" shape="rect" coords="296,57,405,84" alt=""><area href="LCD__driver_8h.html#a20" shape="rect" coords="285,108,416,135" alt=""></map> </td> </tr></table><a class="anchor" name="a24" doxytag="main.h::StateMachine" ></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"> unsigned char StateMachine </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname" nowrap> <em>state</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>unsigned char </td> <td class="mdname" nowrap> <em>stimuli</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This function controls the state machine. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>state</em> </td><td>Present state </td></tr> <tr><td></td><td valign=top><em>stimuli</em> </td><td>Input from joypad</td></tr> </table></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>nextstate</em> </td><td>New state of the system </td></tr> </table></dl><p>Definition at line <a class="el" href="main_8c-source.html#l00171">171</a> of file <a class="el" href="main_8c-source.html">main.c</a>.<p>References <a class="el" href="menu_8h-source.html#l00032">MENU_NEXTSTATE::input</a>, <a class="el" href="menu_8h-source.html#l00065">menu_nextstate</a>, <a class="el" href="menu_8h-source.html#l00033">MENU_NEXTSTATE::nextstate</a>, <a class="el" href="menu_8h-source.html#l00031">MENU_NEXTSTATE::state</a>, and <a class="el" href="main_8c-source.html#l00071">state</a>.<p>Referenced by <a class="el" href="main_8c-source.html#l00084">main()</a>.<p><pre class="fragment"><div>00172 {00173 00174 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> nextstate = <a class="code" href="main_8c.html#a3">state</a>; <span class="comment">// Default stay in same state</span>00175 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> i;00176 00177 <span class="keywordflow">for</span> ( i=0; <a class="code" href="menu_8h.html#a10">menu_nextstate</a>[i].<a class="code" href="structMENU__NEXTSTATE.html#o2">state</a>; i++ )00178 {00179 00180 <span class="keywordflow">if</span> ( ( <a class="code" href="menu_8h.html#a10">menu_nextstate</a>[i].<a class="code" href="structMENU__NEXTSTATE.html#o2">state</a> == <a class="code" href="main_8c.html#a3">state</a> ) && ( <a class="code" href="menu_8h.html#a10">menu_nextstate</a>[i].<a class="code" href="structMENU__NEXTSTATE.html#o0">input</a> == stimuli ) )00181 {00182 00183 <span class="comment">// This is the one!</span>00184 nextstate = <a class="code" href="menu_8h.html#a10">menu_nextstate</a>[i].<a class="code" href="structMENU__NEXTSTATE.html#o1">nextstate</a>;00185 <span class="keywordflow">break</span>;00186 }00187 }00188 00189 <span class="keywordflow">return</span> nextstate;00190 }</div></pre> </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 1 16:21:40 2005 for AVR323 Interfacing GSM modems by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -