📄 button_8c.html
字号:
<table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> __interrupt void PCINT1_interrupt </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><p>Definition at line <a class="el" href="button_8c-source.html#l00075">75</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>References <a class="el" href="splint_8h-source.html#l00025">__interrupt</a>, and <a class="el" href="button_8c-source.html#l00092">PinChangeInterrupt()</a>.<p><pre class="fragment"><div>00076 {00077 <a class="code" href="button_8c.html#a6">PinChangeInterrupt</a>();00078 }</div></pre><p>Here is the call graph for this function:<p><center><img src="button_8c_a5_cgraph.png" border="0" usemap="#button_8c_a5_cgraph_map" alt=""></center><map name="button_8c_a5_cgraph_map"><area href="button_8c.html#a6" shape="rect" coords="183,7,321,33" alt=""></map> </td> </tr></table><a class="anchor" name="a6" doxytag="button.c::PinChangeInterrupt" ></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 PinChangeInterrupt </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><p>Definition at line <a class="el" href="button_8c-source.html#l00092">92</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>References <a class="el" href="button_8h-source.html#l00029">BUTTON_A</a>, <a class="el" href="button_8h-source.html#l00030">BUTTON_B</a>, <a class="el" href="button_8h-source.html#l00031">BUTTON_C</a>, <a class="el" href="button_8h-source.html#l00032">BUTTON_D</a>, <a class="el" href="button_8h-source.html#l00033">BUTTON_O</a>, <a class="el" href="LCD__functions_8c-source.html#l00030">FALSE</a>, <a class="el" href="button_8c-source.html#l00032">gButtonTimeout</a>, <a class="el" href="button_8c-source.html#l00034">KEY</a>, <a class="el" href="main_8h.html#a27a18">KEY_ENTER</a>, <a class="el" href="main_8h.html#a27a22">KEY_MINUS</a>, <a class="el" href="main_8h.html#a27a19">KEY_NEXT</a>, <a class="el" href="main_8h.html#a27a17">KEY_NULL</a>, <a class="el" href="main_8h.html#a27a21">KEY_PLUS</a>, <a class="el" href="main_8h.html#a27a20">KEY_PREV</a>, <a class="el" href="button_8c-source.html#l00035">KEY_VALID</a>, <a class="el" href="button_8h-source.html#l00026">PINB_MASK</a>, <a class="el" href="button_8h-source.html#l00027">PINE_MASK</a>, and <a class="el" href="LCD__functions_8c-source.html#l00031">TRUE</a>.<p>Referenced by <a class="el" href="button_8c-source.html#l00069">PCINT0_interrupt()</a>, and <a class="el" href="button_8c-source.html#l00075">PCINT1_interrupt()</a>.<p><pre class="fragment"><div>00093 {00094 <span class="keywordtype">char</span> buttons;00095 00096 <span class="keywordtype">char</span> key;00097 00098 <span class="comment">/*</span>00099 <span class="comment"> Read the buttons:</span>00100 <span class="comment"></span>00101 <span class="comment"> Bit 7 6 5 4 3 2 1 0</span>00102 <span class="comment"> ---------------------------------------------</span>00103 <span class="comment"> PORTB B A O</span>00104 <span class="comment"> PORTE D C</span>00105 <span class="comment"> ---------------------------------------------</span>00106 <span class="comment"> PORTB | PORTE B A O D C</span>00107 <span class="comment"> =============================================</span>00108 <span class="comment">*/</span>00109 00110 00111 buttons = (~PINB) & <a class="code" href="button_8h.html#a0">PINB_MASK</a>;00112 buttons |= (~PINE) & <a class="code" href="button_8h.html#a1">PINE_MASK</a>;00113 00114 <span class="comment">// Output virtual keys</span>00115 <span class="keywordflow">if</span> (buttons & (1<<<a class="code" href="button_8h.html#a2">BUTTON_A</a>))00116 key = <a class="code" href="main_8h.html#a27a21">KEY_PLUS</a>;00117 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (buttons & (1<<<a class="code" href="button_8h.html#a3">BUTTON_B</a>))00118 key = <a class="code" href="main_8h.html#a27a22">KEY_MINUS</a>;00119 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (buttons & (1<<<a class="code" href="button_8h.html#a4">BUTTON_C</a>))00120 key = <a class="code" href="main_8h.html#a27a20">KEY_PREV</a>;00121 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (buttons & (1<<<a class="code" href="button_8h.html#a5">BUTTON_D</a>))00122 key = <a class="code" href="main_8h.html#a27a19">KEY_NEXT</a>;00123 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (buttons & (1<<<a class="code" href="button_8h.html#a6">BUTTON_O</a>))00124 key = <a class="code" href="main_8h.html#a27a18">KEY_ENTER</a>;00125 <span class="keywordflow">else</span>00126 key = <a class="code" href="main_8h.html#a27a17">KEY_NULL</a>;00127 00128 00129 <span class="keywordflow">if</span>(key != <a class="code" href="main_8h.html#a27a17">KEY_NULL</a>)00130 {00131 <span class="keywordflow">if</span>(<a class="code" href="button_8c.html#a0">gButtonTimeout</a>) <span class="comment">// gButtonTimeout is set in the LCD_SOF_interrupt in LCD_driver.c</span>00132 {00133 <span class="keywordflow">if</span> (!<a class="code" href="button_8c.html#a2">KEY_VALID</a>)00134 {00135 <a class="code" href="button_8c.html#a1">KEY</a> = key; <span class="comment">// Store key in global key buffer</span>00136 <a class="code" href="button_8c.html#a2">KEY_VALID</a> = <a class="code" href="LCD__functions_8c.html#a1">TRUE</a>;00137 }00138 00139 <a class="code" href="button_8c.html#a0">gButtonTimeout</a> = <a class="code" href="LCD__functions_8c.html#a0">FALSE</a>;00140 00141 }00142 }00143 00144 EIFR = (1<<PCIF1) | (1<<PCIF0); <span class="comment">// Delete pin change interrupt flags</span>00145 00146 00147 }</div></pre> </td> </tr></table><hr><h2>Variable Documentation</h2><a class="anchor" name="a0" doxytag="button.c::gButtonTimeout" ></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 <a class="el" href="LCD__driver_8c.html#a0">gButtonTimeout</a> = FALSE </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="button_8c-source.html#l00032">32</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>Referenced by <a class="el" href="LCD__driver_8c-source.html#l00255">LCD_SOF_interrupt()</a>, and <a class="el" href="button_8c-source.html#l00092">PinChangeInterrupt()</a>. </td> </tr></table><a class="anchor" name="a1" doxytag="button.c::KEY" ></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 <a class="el" href="button_8c.html#a1">KEY</a> = NULL </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="button_8c-source.html#l00034">34</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>Referenced by <a class="el" href="button_8c-source.html#l00161">getkey()</a>, and <a class="el" href="button_8c-source.html#l00092">PinChangeInterrupt()</a>. </td> </tr></table><a class="anchor" name="a2" doxytag="button.c::KEY_VALID" ></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 <a class="el" href="button_8c.html#a2">KEY_VALID</a> = FALSE </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><p>Definition at line <a class="el" href="button_8c-source.html#l00035">35</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>Referenced by <a class="el" href="button_8c-source.html#l00161">getkey()</a>, and <a class="el" href="button_8c-source.html#l00092">PinChangeInterrupt()</a>. </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 1 16:21:39 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 + -