Main Page | Data Structures | File List | Data Fields | Globals

ATAVRBFLY_FILES/LCD_functions.c File Reference


Detailed Description

Atmel Corporation

Revision
1.2
Date
Wednesday, January 26, 2005 10:43:44 UTC

Definition in file LCD_functions.c.

#include "iom169.h"
#include "main.h"
#include "Lcd_driver.h"
#include "Lcd_functions.h"
#include "BCD.h"

Include dependency graph for LCD_functions.c:

Include dependency graph

Go to the source code of this file.

Defines

#define FALSE   0
#define TRUE   (!FALSE)

Functions

void LCD_Clear (void)
void LCD_Colon (char show)
void LCD_FlashReset (void)
void LCD_putc (char digit, char character)
void LCD_puts (char *pStr, char scrollmode)
void LCD_puts_f (char __flash *pFlashStr, char scrollmode)
void LCD_UpdateRequired (char update, char scrollmode)
char SetContrast (char input)

Variables

char CONTRAST = LCD_INITIAL_CONTRAST
char gLCD_Start_Scroll_Timer


Define Documentation

#define FALSE   0
 

Definition at line 30 of file LCD_functions.c.

Referenced by getkey(), LCD_Init(), LCD_SOF_interrupt(), and PinChangeInterrupt().

#define TRUE   (!FALSE)
 

Definition at line 31 of file LCD_functions.c.

Referenced by LCD_SOF_interrupt(), PinChangeInterrupt(), and SetContrast().


Function Documentation

void LCD_Clear void   ) 
 

Definition at line 151 of file LCD_functions.c.

References gTextBuffer, and TEXTBUFFER_SIZE.

Referenced by SetContrast().

00152 { 00153 char i; 00154 00155 for (i=0; i<TEXTBUFFER_SIZE; i++) 00156 gTextBuffer[i] = ' '; 00157 }

void LCD_Colon char  show  ) 
 

Definition at line 171 of file LCD_functions.c.

References gColon.

Referenced by main().

00172 { 00173 gColon = show; 00174 }

void LCD_FlashReset void   ) 
 

Definition at line 212 of file LCD_functions.c.

References gFlashTimer.

00213 { 00214 gFlashTimer = 0; 00215 }

void LCD_putc char  digit,
char  character
 

Definition at line 133 of file LCD_functions.c.

References gTextBuffer, and TEXTBUFFER_SIZE.

Referenced by SetContrast().

00134 { 00135 if (digit < TEXTBUFFER_SIZE) 00136 gTextBuffer[digit] = character; 00137 }

void LCD_puts char *  pStr,
char  scrollmode
 

Definition at line 92 of file LCD_functions.c.

References gLCD_Start_Scroll_Timer, gLCD_Update_Required, gScroll, gScrollMode, gTextBuffer, and TEXTBUFFER_SIZE.

Referenced by ST_read().

00093 { 00094 char i; 00095 00096 while (gLCD_Update_Required); // Wait for access to buffer 00097 00098 for (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++) 00099 { 00100 gTextBuffer[i] = pStr[i]; 00101 } 00102 00103 gTextBuffer[i] = '\0'; 00104 00105 if (i > 6) 00106 { 00107 gScrollMode = 1; // Scroll if text is longer than display size 00108 gScroll = 0; 00109 gLCD_Start_Scroll_Timer = 3; //Start-up delay before scrolling the text 00110 } 00111 else 00112 { 00113 gScrollMode = 0; 00114 gScroll = 0; 00115 } 00116 00117 gLCD_Update_Required = 1; 00118 }

void LCD_puts_f char __flash *  pFlashStr,
char  scrollmode
 

Definition at line 51 of file LCD_functions.c.

References gLCD_Start_Scroll_Timer, gLCD_Update_Required, gScroll, gScrollMode, gTextBuffer, and TEXTBUFFER_SIZE.

Referenced by main().

00052 { 00053 char i; 00054 00055 while (gLCD_Update_Required); // Wait for access to buffer 00056 00057 for (i = 0; pFlashStr[i] && i < TEXTBUFFER_SIZE; i++) 00058 { 00059 gTextBuffer[i] = pFlashStr[i]; 00060 } 00061 00062 gTextBuffer[i] = '\0'; 00063 00064 if (i > 6) 00065 { 00066 gScrollMode = 1; // Scroll if text is longer than display size 00067 gScroll = 0; 00068 gLCD_Start_Scroll_Timer = 3; //Start-up delay before scrolling the text 00069 } 00070 else 00071 { 00072 gScrollMode = 0; 00073 gScroll = 0; 00074 } 00075 00076 gLCD_Update_Required = 1; 00077 }

void LCD_UpdateRequired char  update,
char  scrollmode
 

Definition at line 189 of file LCD_functions.c.

References gLCD_Update_Required, gScroll, and gScrollMode.

Referenced by SetContrast().

00190 { 00191 00192 while (gLCD_Update_Required); 00193 00194 gScrollMode = scrollmode; 00195 gScroll = 0; 00196 00197 gLCD_Update_Required = update; 00198 }

char SetContrast char  input  ) 
 

Definition at line 230 of file LCD_functions.c.

References CHAR2BCD2(), CONTRAST, input, KEY_MINUS, KEY_PLUS, LCD_Clear(), LCD_CONTRAST_LEVEL, LCD_putc(), LCD_UpdateRequired(), and TRUE.

00231 { 00232 static char enter = 1; 00233 char CH, CL; 00234 00235 if (enter) 00236 { 00237 LCD_Clear(); 00238 enter = 0; 00239 } 00240 00241 CH = CHAR2BCD2(CONTRAST); 00242 CL = (CH & 0x0F) + '0'; 00243 CH = (CH >> 4) + '0'; 00244 00245 LCD_putc(0, 'C'); 00246 LCD_putc(1, 'T'); 00247 LCD_putc(2, 'R'); 00248 LCD_putc(3, ' '); 00249 LCD_putc(4, CH); 00250 LCD_putc(5, CL); 00251 00252 LCD_UpdateRequired(TRUE, 0); 00253 00254 if (input == KEY_PLUS) 00255 CONTRAST++; 00256 else if (input == KEY_MINUS) 00257 CONTRAST--; 00258 00259 if (CONTRAST == 255) 00260 CONTRAST = 0; 00261 if (CONTRAST > 15) 00262 CONTRAST = 15; 00263 00264 LCD_CONTRAST_LEVEL(CONTRAST); 00265 00266 00267 00268 00269 return 1; 00270 }

Here is the call graph for this function:


Variable Documentation

char CONTRAST = LCD_INITIAL_CONTRAST
 

Definition at line 33 of file LCD_functions.c.

Referenced by SetContrast().

char gLCD_Start_Scroll_Timer
 

Definition at line 36 of file LCD_functions.c.

Referenced by LCD_puts(), LCD_puts_f(), and LCD_SOF_interrupt().


Generated on Tue Nov 1 16:21:39 2005 for AVR323 Interfacing GSM modems by doxygen 1.3.7