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

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

display.c File Reference

Functions for high level display. More...

#include "display.h"
#include "lcd.h"
#include "board.h"
#include "string.h"

Include dependency graph for display.c:

Include dependency graph

Go to the source code of this file.

Functions

char InitDisplay (char style, char *title, char *text, int value)
 Reset display and print initial values.

void UpdateDisplay ()
 Paint display.


Variables

volatile xdata char displayPosition
xdata char displayTitle [16]
xdata char displayText [DS_TEXTLENGTH+1]
xdata char displayLength
xdata char displayStyle
xdata char displayValue


Detailed Description

Functions for high level display.

Definition in file display.c.


Function Documentation

char InitDisplay char  style,
char *  title,
char *  text,
int  value
 

Reset display and print initial values.

Definition at line 23 of file display.c.

References displayLength, displayPosition, displayStyle, displayText, displayTitle, displayValue, DS_TEXTLENGTH, LcdLocateLine2, LcdPutString(), LcdReset(), and UpdateDisplay().

Referenced by main(), and Record().

00023 { 00024 00025 LcdReset(); 00026 00027 //Init display title array 00028 for(displayPosition=0; displayPosition<8; displayPosition++){ 00029 displayTitle[displayPosition]=' '; 00030 } 00031 displayTitle[8]=0; //ending zero 00032 strcpy(displayTitle, title); 00033 00034 00035 displayLength = strlen(text); 00036 //Init display text array 00037 //Clear display text array to spaces 00038 for(displayPosition=0; displayPosition<DS_TEXTLENGTH; displayPosition++){ 00039 displayText[displayPosition]=' '; 00040 } 00041 displayText[DS_TEXTLENGTH] = 0; //ending zero 00042 strcpy(displayText, text); 00043 00044 00045 displayPosition = 0; 00046 displayStyle = style; 00047 displayValue = value; 00048 LcdPutString(displayTitle); 00049 LcdLocateLine2(); 00050 LcdPutString(displayText); 00051 UpdateDisplay(); 00052 00053 return 0; 00054 }

Here is the call graph for this function:

void UpdateDisplay  ) 
 

Paint display.

Definition at line 58 of file display.c.

References displayPosition, displayStyle, displayText, displayTitle, displayValue, DS_ARROWS, DS_NO_YES, DS_NUMERIC, DS_PERCENTAGE, DS_RAWTEXT, DS_STATIC, DS_TEXT, LcdLocateHome, LcdLocateLine2, LcdPutChar(), LcdPutConstantString(), LcdPutUInt(), and temp.

Referenced by AvailableProcessorTime(), and InitDisplay().

00058 { 00059 00060 signed char temp; 00061 00062 LcdLocateHome(); 00063 LcdPutChar(displayTitle[0]); 00064 LcdPutChar(displayTitle[1]); 00065 LcdPutChar(displayTitle[2]); 00066 LcdPutChar(displayTitle[3]); 00067 LcdPutChar(displayTitle[4]); 00068 LcdPutChar(displayTitle[5]); 00069 LcdPutChar(displayTitle[6]); 00070 LcdPutChar(displayTitle[7]); 00071 LcdLocateLine2(); 00072 00073 if (displayStyle == DS_STATIC){ 00074 for (temp=0; temp<8; temp++){ 00075 LcdPutChar(displayText[temp]); 00076 } 00077 } 00078 00079 if (displayStyle == DS_TEXT){ 00080 for (temp=displayPosition; temp<displayPosition + 8; temp++){ 00081 if (temp<0){ 00082 LcdPutChar(' '); 00083 }else{ 00084 if (displayText[temp]){ 00085 LcdPutChar(displayText[temp]); 00086 }else{ 00087 LcdPutChar(' '); 00088 } 00089 } 00090 } 00091 } 00092 00093 if (displayStyle == DS_NUMERIC){ 00094 LcdPutUInt(displayValue); 00095 LcdPutConstantString(" "); 00096 } 00097 00098 if (displayStyle == DS_NO_YES){ 00099 LcdPutConstantString(" No<>Yes"); 00100 } 00101 00102 if (displayStyle == DS_ARROWS){ 00103 LcdPutConstantString(" <- ->"); 00104 } 00105 00106 if (displayStyle == DS_PERCENTAGE){ 00107 unsigned char majorp, minorp; 00108 if (displayValue>100){ 00109 displayValue=100; 00110 } 00111 00112 majorp = (displayValue-4) / 12; 00113 minorp = ((displayValue-4) % 12) >> 1; 00114 for (temp=0; temp<8; temp++){ 00115 if (majorp>temp){ 00116 LcdPutChar(4); 00117 }else{ 00118 if (majorp<temp){ 00119 LcdPutChar(' '); 00120 }else{ 00121 switch(minorp){ 00122 case 0: 00123 LcdPutChar(' '); 00124 break; 00125 case 1: 00126 LcdPutChar(0); 00127 break; 00128 case 2: 00129 LcdPutChar(1); 00130 break; 00131 case 3: 00132 LcdPutChar(2); 00133 break; 00134 case 4: 00135 LcdPutChar(3); 00136 break; 00137 case 5: 00138 LcdPutChar(4); 00139 break; 00140 }//switch 00141 } 00142 } 00143 } 00144 //LcdPutUInt(displayValue); 00145 //LcdPutConstantString("% "); 00146 } 00147 00148 if (displayStyle==DS_RAWTEXT){ 00149 LcdPutChar(displayTitle[8]); 00150 LcdPutChar(displayTitle[9]); 00151 LcdPutChar(displayTitle[10]); 00152 LcdPutChar(displayTitle[11]); 00153 LcdPutChar(displayTitle[12]); 00154 LcdPutChar(displayTitle[13]); 00155 LcdPutChar(displayTitle[14]); 00156 LcdPutChar(displayTitle[15]); 00157 } 00158 00159 00160 }

Here is the call graph for this function:


Variable Documentation

xdata char displayLength
 

Definition at line 13 of file display.c.

Referenced by InitDisplay(), and timer0_interrupt().

volatile xdata char displayPosition
 

Definition at line 10 of file display.c.

Referenced by InitDisplay(), timer0_interrupt(), and UpdateDisplay().

xdata char displayStyle
 

Definition at line 14 of file display.c.

Referenced by AvailableProcessorTime(), InitDisplay(), and UpdateDisplay().

xdata char displayText[DS_TEXTLENGTH+1]
 

Definition at line 12 of file display.c.

Referenced by InitDisplay(), OpenFile(), and UpdateDisplay().

xdata char displayTitle[16]
 

Definition at line 11 of file display.c.

Referenced by AvailableProcessorTime(), InitDisplay(), ScreenSetPlayTime(), and UpdateDisplay().

xdata char displayValue
 

Definition at line 15 of file display.c.

Referenced by AvailableProcessorTime(), InitDisplay(), Record(), and UpdateDisplay().


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