📄 button_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>AVR323 Interfacing GSM modems: button.c File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>ATAVRBFLY_FILES/button.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>Atmel Corporation<p><ul><li>File : <a class="el" href="button_8c.html">button.c</a></li><li>Compiler : IAR EWAAVR 4.11a</li></ul><p><ul><li>Support mail : <a href="mailto:avr@atmel.com">avr@atmel.com</a></li></ul><p><ul><li>Supported devices : All devices with a UART/USART can be used. The example is written for ATmega169</li></ul><p><ul><li>AppNote : AVR323 - Interfacing GSM modems</li></ul><p><ul><li>Description : Example of how to use AT-Commands to control a GSM modem</li></ul><p><dl compact><dt><b>Revision</b></dt><dd>1.2 </dd></dl><dl compact><dt><b>Date</b></dt><dd>Wednesday, January 26, 2005 10:43:44 UTC </dd></dl><p>Definition in file <a class="el" href="button_8c-source.html">button.c</a>.<p><code>#include <inavr.h></code><br><code>#include "ioavr.h"</code><br><code>#include "<a class="el" href="main_8h-source.html">main.h</a>"</code><br><code>#include "<a class="el" href="button_8h-source.html">button.h</a>"</code><br><code>#include "<a class="el" href="types_8h-source.html">types.h</a>"</code><br><p>Include dependency graph for button.c:<p><center><img src="button_8c__incl.png" border="0" usemap="#button.c_map" alt="Include dependency graph"></center><map name="button.c_map"><area href="main_8h.html" shape="rect" coords="177,7,239,34" alt=""><area href="button_8h.html" shape="rect" coords="263,7,332,34" alt=""><area href="types_8h.html" shape="rect" coords="356,7,423,34" alt=""></map><p><a href="button_8c-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a3">Button_Init</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a7">getkey</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>__interrupt void </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a4">PCINT0_interrupt</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>__interrupt void </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a5">PCINT1_interrupt</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a6">PinChangeInterrupt</a> (void)</td></tr><tr><td colspan=2><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a0">gButtonTimeout</a> = FALSE</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a1">KEY</a> = NULL</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="button_8c.html#a2">KEY_VALID</a> = FALSE</td></tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a3" doxytag="button.c::Button_Init" ></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 Button_Init </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#l00050">50</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>References <a class="el" href="main_8h-source.html#l00026">cbi</a>, <a class="el" href="button_8h-source.html#l00026">PINB_MASK</a>, and <a class="el" href="button_8h-source.html#l00027">PINE_MASK</a>.<p>Referenced by <a class="el" href="main_8c-source.html#l00206">Initialization()</a>.<p><pre class="fragment"><div>00051 {00052 <span class="comment">// Init port pins</span>00053 <a class="code" href="main_8h.html#a1">cbi</a>(DDRB,7);00054 <a class="code" href="main_8h.html#a1">cbi</a>(DDRB,6);00055 <a class="code" href="main_8h.html#a1">cbi</a>(DDRB,4);00056 PORTB |= <a class="code" href="button_8h.html#a0">PINB_MASK</a>;00057 DDRE = 0x00;00058 PORTE |= <a class="code" href="button_8h.html#a1">PINE_MASK</a>;00059 00060 <span class="comment">// Enable pin change interrupt on PORTB and PORTE</span>00061 PCMSK0 = <a class="code" href="button_8h.html#a1">PINE_MASK</a>;00062 PCMSK1 = <a class="code" href="button_8h.html#a0">PINB_MASK</a>;00063 EIFR = (1<<PCIF0)|(1<<PCIF1);00064 EIMSK = (1<<PCIE0)|(1<<PCIE1);00065 }</div></pre> </td> </tr></table><a class="anchor" name="a7" doxytag="button.c::getkey" ></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 getkey </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#l00161">161</a> of file <a class="el" href="button_8c-source.html">button.c</a>.<p>References <a class="el" href="LCD__functions_8c-source.html#l00030">FALSE</a>, <a class="el" href="button_8c-source.html#l00034">KEY</a>, <a class="el" href="main_8h.html#a27a17">KEY_NULL</a>, and <a class="el" href="button_8c-source.html#l00035">KEY_VALID</a>.<p>Referenced by <a class="el" href="main_8c-source.html#l00084">main()</a>.<p><pre class="fragment"><div>00162 {00163 <span class="keywordtype">char</span> k;00164 00165 __disable_interrupt();00166 00167 <span class="keywordflow">if</span> (<a class="code" href="button_8c.html#a2">KEY_VALID</a>) <span class="comment">// Check for unread key in buffer</span>00168 {00169 k = <a class="code" href="button_8c.html#a1">KEY</a>;00170 <a class="code" href="button_8c.html#a2">KEY_VALID</a> = <a class="code" href="LCD__functions_8c.html#a0">FALSE</a>;00171 }00172 <span class="keywordflow">else</span>00173 k = <a class="code" href="main_8h.html#a27a17">KEY_NULL</a>; <span class="comment">// No key stroke available</span>00174 00175 __enable_interrupt();00176 00177 <span class="keywordflow">return</span> k;00178 }</div></pre> </td> </tr></table><a class="anchor" name="a4" doxytag="button.c::PCINT0_interrupt" ></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"> __interrupt void PCINT0_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#l00069">69</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>00070 {00071 <a class="code" href="button_8c.html#a6">PinChangeInterrupt</a>();00072 }</div></pre><p>Here is the call graph for this function:<p><center><img src="button_8c_a4_cgraph.png" border="0" usemap="#button_8c_a4_cgraph_map" alt=""></center><map name="button_8c_a4_cgraph_map"><area href="button_8c.html#a6" shape="rect" coords="183,7,321,33" alt=""></map> </td> </tr></table><a class="anchor" name="a5" doxytag="button.c::PCINT1_interrupt" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -