VLSI Solution Oy VLSI Solution Oy Evaluation MP3 Player Source Code Documentation

Main Page | Class List | File List | Class Members | File Members | Related Pages

lcd.h File Reference

LCD functions. More...

#include "console.h"
#include "lcdfonts.h"

Include dependency graph for lcd.h:

Include dependency graph

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 ROM_CHAR_PTR   code char*
#define LcdLocateHome()   {LcdPutCommand (128);InitiateDelay(39);}
 Low level: Move LCD Cursor to start of the first line.

#define LcdLocateLine2()   {LcdPutCommand (168);InitiateDelay(39);}
 Low level: Move LCD Cursor to start of the second line.

#define LcdLocateCG()   {LcdPutCommand (64);InitiateDelay(39);}
 Low level: Point to start of LCD Character Generator RAM.


Functions

void LcdSelectFont (ROM_CHAR_PTR font)
void LcdPutChar (char c)
 Low level: Send one data character to LCD.

void LcdPutCommand (char cmd)
 Low level: Send one command octet to LCD.

void LcdReset ()
 Low level: Reset LCD.

void LcdPutString (char *str)
 Low level: Send a zero-terminated string of bytes to lcd from buffer in any memory.

void LcdPutConstantString (char code *str)
 Low level: Send a zero-terminated string of bytes to lcd from buffer in ROM.

void LcdSplashScreen ()
 Splash screen.

void LcdPutHex8 (unsigned char value)
 Print an 8-bit hex value on LCD.

void LcdPutHex16 (unsigned int value)
 Print a 16-bit hex value on LCD.

unsigned char LcdPrintGenericResult (unsigned char errorlevel)
 Print OK or Error (hex8) on LCD.

void LcdPutUInt (unsigned long value)
 Print a 16-bit unsigned integer value on LCD.


Variables

code const unsigned char lcd_hexchars [17]
 hexadecimal character set


Detailed Description

LCD functions.

Definition in file lcd.h.


Define Documentation

 
#define LcdLocateCG  )     {LcdPutCommand (64);InitiateDelay(39);}
 

Low level: Point to start of LCD Character Generator RAM.

Definition at line 23 of file lcd.h.

Referenced by LcdSelectFont().

 
#define LcdLocateHome  )     {LcdPutCommand (128);InitiateDelay(39);}
 

Low level: Move LCD Cursor to start of the first line.

Definition at line 17 of file lcd.h.

Referenced by LcdSelectFont(), LcdSplashScreen(), PlayCurrentFile(), and UpdateDisplay().

 
#define LcdLocateLine2  )     {LcdPutCommand (168);InitiateDelay(39);}
 

Low level: Move LCD Cursor to start of the second line.

Definition at line 20 of file lcd.h.

Referenced by InitDisplay(), LcdSplashScreen(), main(), and UpdateDisplay().

#define ROM_CHAR_PTR   code char*
 

Definition at line 11 of file lcd.h.

Referenced by LcdSelectFont().


Function Documentation

unsigned char LcdPrintGenericResult unsigned char  errorlevel  ) 
 

Print OK or Error (hex8) on LCD.

Definition at line 185 of file lcd.c.

References Delay(), lcd_hexchars, LcdPutChar(), and LcdPutConstantString().

Referenced by main().

00185 { 00186 if (!errorlevel){ 00187 LcdPutConstantString ("OK "); 00188 }else{ 00189 LcdPutConstantString ("Error "); 00190 LcdPutChar(lcd_hexchars[(errorlevel>>4)&0xf]); 00191 LcdPutChar(lcd_hexchars[(errorlevel)&0xf]); 00192 ConsoleWrite ("\rSystem error "); 00193 ConsolePutHex8 (errorlevel); 00194 ConsoleWrite (": \""); 00195 00196 switch (errorlevel){ 00197 case 0x01: ConsoleWrite ("No storage"); break; 00198 case 0x02: ConsoleWrite ("Storage powerup"); break; 00199 case 0x03: ConsoleWrite ("Storage init"); break; 00200 case 0x04: ConsoleWrite ("No storage ID"); break; 00201 case 0x05: ConsoleWrite ("Datablock header"); break; 00202 case 0x06: ConsoleWrite ("Storage Data reply failed"); break; 00203 case 0x07: ConsoleWrite ("Generic Storage Command"); break; 00204 case 0x08: ConsoleWrite ("Sector 0 not in recognized format"); break; 00205 case 0x09: ConsoleWrite ("No active partition"); break; 00206 case 0x0a: ConsoleWrite ("Filesystem load"); break; 00207 case 0x0b: ConsoleWrite ("No root directory"); break; 00208 case 0x0c: ConsoleWrite ("File not found"); break; 00209 00210 }; 00211 ConsoleWrite("\" failure.\r"); 00212 00213 00214 Delay(500); 00215 } 00216 return errorlevel; 00217 }

Here is the call graph for this function:

void LcdPutChar char  c  ) 
 

Low level: Send one data character to LCD.

Parameters:
c Octet to be sent to LCD

Definition at line 17 of file lcd.c.

References InitiateDelay, LCD_DATA_MODE, LCD_DATABUS, LCD_ENABLE, LCD_RS, and WaitOutDelay.

Referenced by LcdPrintGenericResult(), LcdPutConstantString(), LcdPutHex16(), LcdPutHex8(), LcdPutString(), LcdPutUInt(), LcdSplashScreen(), main(), and UpdateDisplay().

00017 { 00018 WaitOutDelay(); 00019 LCD_RS = LCD_DATA_MODE; 00020 LCD_ENABLE = 1; /* Rising edge */ 00021 LCD_DATABUS = c; 00022 LCD_ENABLE = 1; /* Keep high...*/ 00023 LCD_ENABLE = 0; /* Falling edge */ 00024 InitiateDelay(44); 00025 }

void LcdPutCommand char  cmd  ) 
 

Low level: Send one command octet to LCD.

Parameters:
cmd Command octet to be sent to LCD

Definition at line 33 of file lcd.c.

References LCD_COMMAND_MODE, LCD_DATABUS, LCD_ENABLE, LCD_RS, and WaitOutDelay.

Referenced by LcdFadeIn(), LcdFadeOut(), and LcdReset().

00033 { 00034 WaitOutDelay(); 00035 LCD_RS = LCD_COMMAND_MODE; 00036 LCD_ENABLE = 1; /* Rising edge */ 00037 LCD_DATABUS = cmd; 00038 LCD_ENABLE = 0; /* Falling edge */ 00039 }

void LcdPutConstantString char code *  str  ) 
 

Low level: Send a zero-terminated string of bytes to lcd from buffer in ROM.

Example: LcdPutConstantString ("Hello!");

Parameters:
*str pointer to a zero-terminated string in code ROM.

Definition at line 102 of file lcd.c.

References LcdPutChar().

Referenced by LcdPrintGenericResult(), LcdSelectFont(), LcdSplashScreen(), main(), PlayCurrentFile(), and UpdateDisplay().

00102 { 00103 while (*str) 00104 { 00105 LcdPutChar (*str++); 00106 } 00107 }

Here is the call graph for this function:

void LcdPutHex16 unsigned int  value  ) 
 

Print a 16-bit hex value on LCD.

Definition at line 168 of file lcd.c.

References lcd_hexchars, and LcdPutChar().

00168 { 00169 LcdPutChar(lcd_hexchars[value>>12]); 00170 LcdPutChar(lcd_hexchars[(value>>8)&0xf]); 00171 LcdPutChar(lcd_hexchars[(value>>4)&0xf]); 00172 LcdPutChar(lcd_hexchars[(value)&0xf]); 00173 }

Here is the call graph for this function:

void LcdPutHex8 unsigned char  value  ) 
 

Print an 8-bit hex value on LCD.

Definition at line 177 of file lcd.c.

References lcd_hexchars, and LcdPutChar().

00177 { 00178 00179 LcdPutChar(lcd_hexchars[(value>>4)&0xf]); 00180 LcdPutChar(lcd_hexchars[(value)&0xf]); 00181 }

Here is the call graph for this function:

void LcdPutString char *  str  ) 
 

Low level: Send a zero-terminated string of bytes to lcd from buffer in any memory.

Example: LcdPutString (s);

Parameters:
*str pointer to a zero-terminated string in idata segment
Warning:
Do not call for const type strings in the ROM!

Definition at line 89 of file lcd.c.

References LcdPutChar().

Referenced by InitDisplay().

00089 { 00090 while (*str) { 00091 LcdPutChar (*str++); 00092 } 00093 }

Here is the call graph for this function:

void LcdPutUInt unsigned long  value  ) 
 

Print a 16-bit unsigned integer value on LCD.

Definition at line 221 of file lcd.c.

References LcdPutChar().

Referenced by main(), and UpdateDisplay().

00221 { 00222 xdata unsigned char valueString[10]; 00223 char c; 00224 for (c=0; c<10; c++){ 00225 valueString[c]=value % 10; 00226 value = value / 10; 00227 } 00228 c=9; 00229 while ((valueString[c]==0) && (c!=0)) 00230 c--; 00231 for (;c!=0;c--) 00232 LcdPutChar('0'+valueString[c]); 00233 LcdPutChar('0'+valueString[0]); 00234 00235 }

Here is the call graph for this function:

void LcdReset  ) 
 

Low level: Reset LCD.

Definition at line 56 of file lcd.c.

References InitiateDelay, LCD_ENABLE, lcdFont_barchars, LcdPutCommand(), LcdSelectFont(), and WaitOutDelay.

Referenced by AvailableProcessorTime(), InitDisplay(), LcdSplashScreen(), and main().

00056 { 00057 00058 00059 LCD_ENABLE = 0; 00060 InitiateDelay(0); /* Initialize the delay system */ 00061 00062 LcdPutCommand(56); /* 8 data bits, 2 lines */ 00063 InitiateDelay(39); 00064 00065 WaitOutDelay(); 00066 LcdPutCommand(56); /* Command 2 times "just in case" */ 00067 InitiateDelay(39); 00068 00069 WaitOutDelay(); 00070 LcdPutCommand(12); /* Panel on, no cursor */ 00071 InitiateDelay(39); 00072 00073 WaitOutDelay(); 00074 LcdPutCommand(1); /* Clear screen */ 00075 InitiateDelay(1530); /* Start a 1.53 ms delay */ 00076 00077 LcdSelectFont(lcdFont_barchars); 00078 00079 }

Here is the call graph for this function:

void LcdSelectFont ROM_CHAR_PTR  font  ) 
 

Definition at line 43 of file lcd.c.

References LcdLocateCG, LcdLocateHome, LcdPutConstantString(), and ROM_CHAR_PTR.

Referenced by AvailableProcessorTime(), LcdReset(), and LcdSplashScreen().

00043 { 00044 static ROM_CHAR_PTR loadedFont = 0; 00045 if (loadedFont != font){ 00046 loadedFont=font; 00047 00048 LcdLocateCG(); 00049 LcdPutConstantString(font); 00050 LcdLocateHome(); 00051 00052 } 00053 }

Here is the call graph for this function:

void LcdSplashScreen  ) 
 

Splash screen.

Definition at line 147 of file lcd.c.

References LcdFadeIn(), LcdFadeOut(), lcdFont_vlsichars, LcdLocateHome, LcdLocateLine2, LcdPutChar(), LcdPutConstantString(), LcdReset(), and LcdSelectFont().

00147 { 00148 00149 LcdReset(); 00150 00151 LcdSelectFont(lcdFont_vlsichars); 00152 00153 LcdLocateHome(); 00154 00155 LcdPutChar(0); 00156 LcdPutConstantString("\1\2\3 Sol"); 00157 LcdLocateLine2(); 00158 LcdPutConstantString("ution Oy"); 00159 00160 00161 LcdFadeIn(); 00162 LcdFadeOut(); 00163 00164 }

Here is the call graph for this function:


Variable Documentation

code const unsigned char lcd_hexchars[17]
 

hexadecimal character set

Definition at line 14 of file lcd.h.

Referenced by LcdPrintGenericResult(), LcdPutHex16(), and LcdPutHex8().


All software copyright 2000-2004 VLSI Solution OY. Redistribution of these software modules are limited to promotional use only and only with the VS1011 / VS1002 / VS1003 MP3-Evakit evaluation boards. Free or commercial use of these software modules in MP3 players is ok if the product includes MP3 decoder chip(s) from VLSI. You can request the complete (compilable) package from mp3@vlsi.fi