📄 lcd__driver_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: LCD_driver.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/LCD_driver.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>Atmel Corporation<p><ul><li>File : <a class="el" href="LCD__driver_8c.html">LCD_driver.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="LCD__driver_8c-source.html">LCD_driver.c</a>.<p><code>#include "iom169.h"</code><br><code>#include "<a class="el" href="LCD__driver_8h-source.html">LCD_driver.h</a>"</code><br><code>#include "<a class="el" href="types_8h-source.html">types.h</a>"</code><br><p>Include dependency graph for LCD_driver.c:<p><center><img src="LCD__driver_8c__incl.png" border="0" usemap="#LCD_driver.c_map" alt="Include dependency graph"></center><map name="LCD_driver.c_map"><area href="LCD__driver_8h.html" shape="rect" coords="108,7,210,34" alt=""><area href="types_8h.html" shape="rect" coords="234,7,300,34" alt=""></map><p><a href="LCD__driver_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="LCD__driver_8c.html#a13">LCD_AllSegments</a> (char show)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a11">LCD_Init</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="LCD__driver_8c.html#a14">LCD_SOF_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="LCD__driver_8c.html#a12">LCD_WriteDigit</a> (char c, char digit)</td></tr><tr><td colspan=2><br><h2>Variables</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>BOOL </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a1">gAutoPressJoystick</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>unsigned char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a0">gButtonTimeout</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a9">gColon</a> = 0</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a8">gFlashTimer</a> = 0</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a7">gLCD_Start_Scroll_Timer</a> = 0</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a> = FALSE</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>signed char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a5">gScroll</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a6">gScrollMode</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a4">gTextBuffer</a> [TEXTBUFFER_SIZE]</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>__flash unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a10">LCD_character_table</a> []</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="LCD__driver_8c.html#a3">LCD_Data</a> [LCD_REGISTER_COUNT]</td></tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a13" doxytag="LCD_driver.c::LCD_AllSegments" ></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 LCD_AllSegments </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">char </td> <td class="mdname1" valign="top" nowrap> <em>show</em> </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="LCD__driver_8c-source.html#l00230">230</a> of file <a class="el" href="LCD__driver_8c-source.html">LCD_driver.c</a>.<p>References <a class="el" href="LCD__driver_8c-source.html#l00038">LCD_Data</a>, and <a class="el" href="LCD__driver_8h-source.html#l00029">LCD_REGISTER_COUNT</a>.<p>Referenced by <a class="el" href="LCD__driver_8c-source.html#l00134">LCD_Init()</a>.<p><pre class="fragment"><div>00231 {00232 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> i;00233 00234 <span class="keywordflow">if</span> (show)00235 show = 0xFF;00236 00237 <span class="comment">// Set/clear all bits in all LCD registers</span>00238 <span class="keywordflow">for</span> (i=0; i < <a class="code" href="LCD__driver_8h.html#a3">LCD_REGISTER_COUNT</a>; i++)00239 *(<a class="code" href="LCD__driver_8c.html#a3">LCD_Data</a> + i) = show;00240 }</div></pre> </td> </tr></table><a class="anchor" name="a11" doxytag="LCD_driver.c::LCD_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 LCD_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="LCD__driver_8c-source.html#l00134">134</a> of file <a class="el" href="LCD__driver_8c-source.html">LCD_driver.c</a>.<p>References <a class="el" href="LCD__functions_8c-source.html#l00030">FALSE</a>, <a class="el" href="LCD__driver_8c-source.html#l00035">gLCD_Update_Required</a>, <a class="el" href="LCD__driver_8c-source.html#l00230">LCD_AllSegments()</a>, <a class="el" href="LCD__driver_8h-source.html#l00046">LCD_CONTRAST_LEVEL</a>, and <a class="el" href="LCD__driver_8h-source.html#l00026">LCD_INITIAL_CONTRAST</a>.<p>Referenced by <a class="el" href="main_8c-source.html#l00206">Initialization()</a>.<p><pre class="fragment"><div>00135 {00136 <a class="code" href="LCD__driver_8h.html#a20">LCD_AllSegments</a>(FALSE); <span class="comment">// Clear segment buffer.</span>00137 00138 <a class="code" href="LCD__driver_8h.html#a10">LCD_CONTRAST_LEVEL</a>(LCD_INITIAL_CONTRAST); <span class="comment">//Set the LCD contrast level</span>00139 00140 <span class="comment">// Select asynchronous clock source, enable all COM pins and enable all</span>00141 <span class="comment">// segment pins.</span>00142 LCDCRB = (1<<LCDCS) | (3<<LCDMUX0) | (7<<LCDPM0);00143 00144 <span class="comment">// Set LCD prescaler to give a framerate of 32,0 Hz</span>00145 LCDFRR = (0<<LCDPS0) | (7<<LCDCD0);00146 00147 LCDCRA = (1<<LCDEN) | (1<<LCDAB); <span class="comment">// Enable LCD and set low power waveform</span>00148 00149 <span class="comment">//Enable LCD start of frame interrupt</span>00150 LCDCRA |= (1<<LCDIE);00151 00152 <a class="code" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a> = <a class="code" href="LCD__functions_8c.html#a0">FALSE</a>;00153 00154 00155 }</div></pre><p>Here is the call graph for this function:<p><center><img src="LCD__driver_8c_a11_cgraph.png" border="0" usemap="#LCD__driver_8c_a11_cgraph_map" alt=""></center><map name="LCD__driver_8c_a11_cgraph_map"><area href="LCD__driver_8h.html#a20" shape="rect" coords="131,7,261,33" alt=""></map> </td> </tr></table><a class="anchor" name="a14" doxytag="LCD_driver.c::LCD_SOF_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 LCD_SOF_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="LCD__driver_8c-source.html#l00255">255</a> of file <a class="el" href="LCD__driver_8c-source.html">LCD_driver.c</a>.<p>References <a class="el" href="splint_8h-source.html#l00025">__interrupt</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="LCD__driver_8c-source.html#l00058">gColon</a>, <a class="el" href="LCD__driver_8c-source.html#l00055">gFlashTimer</a>, <a class="el" href="LCD__driver_8c-source.html#l00051">gLCD_Start_Scroll_Timer</a>, <a class="el" href="LCD__driver_8c-source.html#l00035">gLCD_Update_Required</a>, <a class="el" href="LCD__driver_8c-source.html#l00047">gScroll</a>, <a class="el" href="LCD__driver_8c-source.html#l00048">gScrollMode</a>, <a class="el" href="LCD__driver_8c-source.html#l00042">gTextBuffer</a>, <a class="el" href="LCD__driver_8c-source.html#l00038">LCD_Data</a>, <a class="el" href="LCD__driver_8h-source.html#l00028">LCD_FLASH_SEED</a>, <a class="el" href="LCD__driver_8h-source.html#l00029">LCD_REGISTER_COUNT</a>, <a class="el" href="LCD__driver_8h-source.html#l00027">LCD_TIMER_SEED</a>, <a class="el" href="LCD__driver_8c-source.html#l00174">LCD_WriteDigit()</a>, <a class="el" href="LCD__driver_8h-source.html#l00043">pLCDREG</a>, and <a class="el" href="LCD__functions_8c-source.html#l00031">TRUE</a>.<p><pre class="fragment"><div>00256 {00257 <span class="keyword">static</span> <span class="keywordtype">char</span> LCD_timer = <a class="code" href="LCD__driver_8h.html#a1">LCD_TIMER_SEED</a>;00258 <span class="keywordtype">char</span> c;00259 <span class="keywordtype">char</span> c_flash;00260 <span class="keywordtype">char</span> flash;00261 00262 <span class="keywordtype">char</span> EOL;00263 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> i;00264 00265 00266 <span class="keyword">static</span> <span class="keywordtype">char</span> timeout_count;00267 00268 00269 <span class="comment">/**************** Button timeout for the button.c, START ****************/</span>00270 <span class="keywordflow">if</span>(!<a class="code" href="button_8c.html#a0">gButtonTimeout</a>)00271 {00272 timeout_count++;00273 00274 <span class="keywordflow">if</span>(timeout_count > 3)00275 {00276 <a class="code" href="button_8c.html#a0">gButtonTimeout</a> = <a class="code" href="LCD__functions_8c.html#a1">TRUE</a>;00277 timeout_count = 0;00278 }00279 }00280 <span class="comment">/**************** Button timeout for the button.c, END ******************/</span>00281 00282 <span class="comment">/**************** Auto press joystick for the main.c, START *************/</span>00283 <span class="comment">/*if(gAutoPressJoystick == AUTO)</span>00284 <span class="comment"> {</span>00285 <span class="comment"> auto_joystick_count++;</span>00286 <span class="comment"></span>00287 <span class="comment"> if(auto_joystick_count > 16)</span>00288 <span class="comment"> {</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -