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

ATAVRBFLY_FILES/LCD_driver.h File Reference


Detailed Description

Atmel Corporation

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

Definition in file LCD_driver.h.

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define LCD_CONTRAST_LEVEL(level)   LCDCCR=(0x0F & level)
#define LCD_FLASH_SEED   10
#define LCD_INITIAL_CONTRAST   0x0F
#define LCD_REGISTER_COUNT   20
#define LCD_SET_COLON(active)   LCD_Data[8] = active
#define LCD_TIMER_SEED   3
#define pLCDREG   ((unsigned char *)(0xEC))
#define SCROLLMODE_LOOP   0x02
#define SCROLLMODE_ONCE   0x01
#define SCROLLMODE_WAVE   0x03
#define TEXTBUFFER_SIZE   25

Functions

void LCD_AllSegments (char show)
void LCD_Init (void)
void LCD_WriteDigit (char input, char digit)

Variables

char gColon
char gFlashTimer
char gLCD_Update_Required
signed char gScroll
char gScrollMode
char gTextBuffer [TEXTBUFFER_SIZE]
char LCD_Data [LCD_REGISTER_COUNT]


Define Documentation

#define LCD_CONTRAST_LEVEL level   )     LCDCCR=(0x0F & level)
 

Definition at line 46 of file LCD_driver.h.

Referenced by LCD_Init(), and SetContrast().

#define LCD_FLASH_SEED   10
 

Definition at line 28 of file LCD_driver.h.

Referenced by LCD_SOF_interrupt().

#define LCD_INITIAL_CONTRAST   0x0F
 

Definition at line 26 of file LCD_driver.h.

Referenced by LCD_Init().

#define LCD_REGISTER_COUNT   20
 

Definition at line 29 of file LCD_driver.h.

Referenced by LCD_AllSegments(), and LCD_SOF_interrupt().

#define LCD_SET_COLON active   )     LCD_Data[8] = active
 

Definition at line 40 of file LCD_driver.h.

#define LCD_TIMER_SEED   3
 

Definition at line 27 of file LCD_driver.h.

Referenced by LCD_SOF_interrupt().

#define pLCDREG   ((unsigned char *)(0xEC))
 

Definition at line 43 of file LCD_driver.h.

Referenced by LCD_SOF_interrupt().

#define SCROLLMODE_LOOP   0x02
 

Definition at line 33 of file LCD_driver.h.

#define SCROLLMODE_ONCE   0x01
 

Definition at line 32 of file LCD_driver.h.

#define SCROLLMODE_WAVE   0x03
 

Definition at line 34 of file LCD_driver.h.

#define TEXTBUFFER_SIZE   25
 

Definition at line 30 of file LCD_driver.h.

Referenced by LCD_Clear(), LCD_putc(), LCD_puts(), and LCD_puts_f().


Function Documentation

void LCD_AllSegments char  show  ) 
 

Definition at line 230 of file LCD_driver.c.

References LCD_Data, and LCD_REGISTER_COUNT.

Referenced by LCD_Init().

00231 { 00232 unsigned char i; 00233 00234 if (show) 00235 show = 0xFF; 00236 00237 // Set/clear all bits in all LCD registers 00238 for (i=0; i < LCD_REGISTER_COUNT; i++) 00239 *(LCD_Data + i) = show; 00240 }

void LCD_Init void   ) 
 

Definition at line 134 of file LCD_driver.c.

References FALSE, gLCD_Update_Required, LCD_AllSegments(), LCD_CONTRAST_LEVEL, and LCD_INITIAL_CONTRAST.

Referenced by Initialization().

00135 { 00136 LCD_AllSegments(FALSE); // Clear segment buffer. 00137 00138 LCD_CONTRAST_LEVEL(LCD_INITIAL_CONTRAST); //Set the LCD contrast level 00139 00140 // Select asynchronous clock source, enable all COM pins and enable all 00141 // segment pins. 00142 LCDCRB = (1<<LCDCS) | (3<<LCDMUX0) | (7<<LCDPM0); 00143 00144 // Set LCD prescaler to give a framerate of 32,0 Hz 00145 LCDFRR = (0<<LCDPS0) | (7<<LCDCD0); 00146 00147 LCDCRA = (1<<LCDEN) | (1<<LCDAB); // Enable LCD and set low power waveform 00148 00149 //Enable LCD start of frame interrupt 00150 LCDCRA |= (1<<LCDIE); 00151 00152 gLCD_Update_Required = FALSE; 00153 00154 00155 }

Here is the call graph for this function:

void LCD_WriteDigit char  input,
char  digit
 

Definition at line 174 of file LCD_driver.c.

References LCD_character_table, LCD_Data, and mask.

Referenced by LCD_SOF_interrupt().

00175 { 00176 00177 unsigned int seg = 0x0000; // Holds the segment pattern 00178 char mask, nibble; 00179 char *ptr; 00180 char i; 00181 00182 00183 if (digit > 5) // Skip if digit is illegal 00184 return; 00185 00186 //Lookup character table for segmet data 00187 if ((c >= '*') && (c <= 'z')) 00188 { 00189 // c is a letter 00190 if (c >= 'a') // Convert to upper case 00191 c &= ~0x20; // if necessarry 00192 00193 c -= '*'; 00194 00195 seg = LCD_character_table[c]; 00196 } 00197 00198 // Adjust mask according to LCD segment mapping 00199 if (digit & 0x01) 00200 mask = 0x0F; // Digit 1, 3, 5 00201 else 00202 mask = 0xF0; // Digit 0, 2, 4 00203 00204 ptr = LCD_Data + (digit >> 1); // digit = {0,0,1,1,2,2} 00205 00206 for (i = 0; i < 4; i++) 00207 { 00208 nibble = seg & 0x000F; 00209 seg >>= 4; 00210 if (digit & 0x01) 00211 nibble <<= 4; 00212 *ptr = (*ptr & mask) | nibble; 00213 ptr += 5; 00214 } 00215 }


Variable Documentation

char gColon
 

Definition at line 57 of file LCD_driver.h.

Referenced by LCD_Colon(), and LCD_SOF_interrupt().

char gFlashTimer
 

Definition at line 56 of file LCD_driver.h.

Referenced by LCD_FlashReset(), and LCD_SOF_interrupt().

char gLCD_Update_Required
 

Definition at line 52 of file LCD_driver.h.

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

signed char gScroll
 

Definition at line 58 of file LCD_driver.h.

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

char gScrollMode
 

Definition at line 55 of file LCD_driver.h.

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

char gTextBuffer[TEXTBUFFER_SIZE]
 

Definition at line 54 of file LCD_driver.h.

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

char LCD_Data[LCD_REGISTER_COUNT]
 

Definition at line 53 of file LCD_driver.h.

Referenced by LCD_AllSegments(), LCD_SOF_interrupt(), and LCD_WriteDigit().


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