📄 lcd__functions_8c-source.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: ATAVRBFLY_FILES/LCD_functions.c Source File</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_functions.c</h1><a href="LCD__functions_8c.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">// This file has been prepared for Doxygen automatic documentation generation.</span>00023 <span class="comment"></span><span class="comment">// Include files</span>00024 <span class="preprocessor">#include"iom169.h"</span>00025 <span class="preprocessor">#include"<a class="code" href="main_8h.html">main.h</a>"</span>00026 <span class="preprocessor">#include"Lcd_driver.h"</span>00027 <span class="preprocessor">#include"<a class="code" href="Lcd__functions_8h.html">Lcd_functions.h</a>"</span>00028 <span class="preprocessor">#include"<a class="code" href="BCD_8h.html">BCD.h</a>"</span>00029 <a name="l00030"></a><a class="code" href="LCD__functions_8c.html#a0">00030</a> <span class="preprocessor">#define FALSE 0</span><a name="l00031"></a><a class="code" href="LCD__functions_8c.html#a1">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define TRUE (!FALSE)</span>00032 <span class="preprocessor"></span><a name="l00033"></a><a class="code" href="LCD__functions_8c.html#a2">00033</a> <span class="keywordtype">char</span> <a class="code" href="LCD__functions_8c.html#a2">CONTRAST</a> = <a class="code" href="LCD__driver_8h.html#a0">LCD_INITIAL_CONTRAST</a>;00034 00035 <span class="comment">// Start-up delay before scrolling a string over the LCD. "LCD_driver.c"</span><a name="l00036"></a><a class="code" href="LCD__functions_8c.html#a3">00036</a> <span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code" href="LCD__driver_8c.html#a7">gLCD_Start_Scroll_Timer</a>;00037 00038 <span class="comment">/****************************************************************************</span>00039 <span class="comment">*</span>00040 <span class="comment">* Function name : LCD_puts_f</span>00041 <span class="comment">*</span>00042 <span class="comment">* Returns : None</span>00043 <span class="comment">*</span>00044 <span class="comment">* Parameters : pFlashStr: Pointer to the string in flash</span>00045 <span class="comment">* scrollmode: Not in use</span>00046 <span class="comment">*</span>00047 <span class="comment">* Purpose : Writes a string stored in flash to the LCD</span>00048 <span class="comment">*</span>00049 <span class="comment">*****************************************************************************/</span>00050 <a name="l00051"></a><a class="code" href="Lcd__functions_8h.html#a0">00051</a> <span class="keywordtype">void</span> <a class="code" href="Lcd__functions_8h.html#a0">LCD_puts_f</a>(<span class="keywordtype">char</span> __flash *pFlashStr, <span class="keywordtype">char</span> scrollmode)00052 {00053 <span class="keywordtype">char</span> i;00054 00055 <span class="keywordflow">while</span> (<a class="code" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a>); <span class="comment">// Wait for access to buffer</span>00056 00057 <span class="keywordflow">for</span> (i = 0; pFlashStr[i] && i < <a class="code" href="LCD__driver_8h.html#a4">TEXTBUFFER_SIZE</a>; i++)00058 {00059 <a class="code" href="LCD__driver_8c.html#a4">gTextBuffer</a>[i] = pFlashStr[i];00060 }00061 00062 <a class="code" href="LCD__driver_8c.html#a4">gTextBuffer</a>[i] = <span class="charliteral">'\0'</span>;00063 00064 <span class="keywordflow">if</span> (i > 6)00065 {00066 <a class="code" href="LCD__driver_8c.html#a6">gScrollMode</a> = 1; <span class="comment">// Scroll if text is longer than display size</span>00067 <a class="code" href="LCD__driver_8c.html#a5">gScroll</a> = 0;00068 <a class="code" href="LCD__driver_8c.html#a7">gLCD_Start_Scroll_Timer</a> = 3; <span class="comment">//Start-up delay before scrolling the text</span>00069 }00070 <span class="keywordflow">else</span>00071 {00072 <a class="code" href="LCD__driver_8c.html#a6">gScrollMode</a> = 0;00073 <a class="code" href="LCD__driver_8c.html#a5">gScroll</a> = 0;00074 }00075 00076 <a class="code" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a> = 1;00077 }00078 00079 00080 <span class="comment">/****************************************************************************</span>00081 <span class="comment">*</span>00082 <span class="comment">* Function name : LCD_puts</span>00083 <span class="comment">*</span>00084 <span class="comment">* Returns : None</span>00085 <span class="comment">*</span>00086 <span class="comment">* Parameters : pStr: Pointer to the string</span>00087 <span class="comment">* scrollmode: Not in use</span>00088 <span class="comment">*</span>00089 <span class="comment">* Purpose : Writes a string to the LCD</span>00090 <span class="comment">*</span>00091 <span class="comment">*****************************************************************************/</span><a name="l00092"></a><a class="code" href="Lcd__functions_8h.html#a1">00092</a> <span class="keywordtype">void</span> <a class="code" href="Lcd__functions_8h.html#a1">LCD_puts</a>(<span class="keywordtype">char</span> *pStr, <span class="keywordtype">char</span> scrollmode)00093 {00094 <span class="keywordtype">char</span> i;00095 00096 <span class="keywordflow">while</span> (<a class="code" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a>); <span class="comment">// Wait for access to buffer</span>00097 00098 <span class="keywordflow">for</span> (i = 0; pStr[i] && i < <a class="code" href="LCD__driver_8h.html#a4">TEXTBUFFER_SIZE</a>; i++)00099 {00100 <a class="code" href="LCD__driver_8c.html#a4">gTextBuffer</a>[i] = pStr[i];00101 }00102 00103 <a class="code" href="LCD__driver_8c.html#a4">gTextBuffer</a>[i] = <span class="charliteral">'\0'</span>;00104 00105 <span class="keywordflow">if</span> (i > 6)00106 {00107 <a class="code" href="LCD__driver_8c.html#a6">gScrollMode</a> = 1; <span class="comment">// Scroll if text is longer than display size</span>00108 <a class="code" href="LCD__driver_8c.html#a5">gScroll</a> = 0;00109 <a class="code" href="LCD__driver_8c.html#a7">gLCD_Start_Scroll_Timer</a> = 3; <span class="comment">//Start-up delay before scrolling the text</span>00110 }00111 <span class="keywordflow">else</span>00112 {00113 <a class="code" href="LCD__driver_8c.html#a6">gScrollMode</a> = 0;00114 <a class="code" href="LCD__driver_8c.html#a5">gScroll</a> = 0;00115 }00116 00117 <a class="code" href="LCD__driver_8c.html#a2">gLCD_Update_Required</a> = 1;00118 }00119 00120 00121 <span class="comment">/****************************************************************************</span>00122 <span class="comment">*</span>00123 <span class="comment">* Function name : LCD_putc</span>00124 <span class="comment">*</span>00125 <span class="comment">* Returns : None</span>00126 <span class="comment">*</span>00127 <span class="comment">* Parameters : digit: Which digit to write on the LCD</span>00128 <span class="comment">* character: Character to write</span>00129 <span class="comment">*</span>00130 <span class="comment">* Purpose : Writes a character to the LCD</span>00131 <span class="comment">*</span>00132 <span class="comment">*****************************************************************************/</span><a name="l00133"></a><a class="code" href="Lcd__functions_8h.html#a3">00133</a> <span class="keywordtype">void</span> <a class="code" href="Lcd__functions_8h.html#a3">LCD_putc</a>(<span class="keywordtype">char</span> digit, <span class="keywordtype">char</span> character)00134 {00135 <span class="keywordflow">if</span> (digit < <a class="code" href="LCD__driver_8h.html#a4">TEXTBUFFER_SIZE</a>)00136 <a class="code" href="LCD__driver_8c.html#a4">gTextBuffer</a>[digit] = character;00137 }00138 00139 00140 <span class="comment">/****************************************************************************</span>00141 <span class="comment">*</span>00142 <span class="comment">* Function name : LCD_Clear</span>00143 <span class="comment">*</span>00144 <span class="comment">* Returns : None</span>00145 <span class="comment">*</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -