VLSI Solution Oy VS1103 VLSI Solution Karaoke, MIDI and ADPCM Player Source Code Documentation

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

display.h File Reference

Definitions for high level display. More...

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

Included by dependency graph

Go to the source code of this file.

Classes

struct  displayItemStruct

Defines

#define DS_STATIC   0
#define DS_TEXT   1
#define DS_NUMERIC   2
#define DS_PERCENTAGE   3
#define DS_NO_YES   4
#define DS_ARROWS   5
#define DS_RAWTEXT   6
#define DS_TEXTLENGTH   50
#define DISPLAY_ITEMS   32

Functions

void SetDisplayTitle (char n, char *s)
void SetDisplayText (char n, char *s)
void SetDisplayPercent (char n, char displayValue)
void SetDisplaySignedValue (char n, int i)
void UpdateDisplay (unsigned char n)
 Paint display.

Variables

xdata unsigned char displayTimeCount
xdata struct displayItemStruct displayItem [DISPLAY_ITEMS]


Detailed Description

Definitions for high level display.

Definition in file display.h.


Define Documentation

#define DISPLAY_ITEMS   32
 

Definition at line 18 of file display.h.

#define DS_ARROWS   5
 

Definition at line 13 of file display.h.

#define DS_NO_YES   4
 

Definition at line 12 of file display.h.

#define DS_NUMERIC   2
 

Definition at line 10 of file display.h.

#define DS_PERCENTAGE   3
 

Definition at line 11 of file display.h.

#define DS_RAWTEXT   6
 

Definition at line 14 of file display.h.

#define DS_STATIC   0
 

Definition at line 8 of file display.h.

#define DS_TEXT   1
 

Definition at line 9 of file display.h.

#define DS_TEXTLENGTH   50
 

Definition at line 17 of file display.h.


Function Documentation

void SetDisplayPercent char  n,
char  displayValue
 

Definition at line 52 of file display.c.

References displayItem, temp, and displayItemStruct::text.

Referenced by AvailableProcessorTime(), EchoEnable(), and main().

00052                                                   {
00053     unsigned char temp,majorp, minorp;
00054     if (displayValue>100){
00055       displayValue=100;
00056     }
00057     majorp = (displayValue-4) / 12;
00058     minorp = ((displayValue-4) % 12) >> 1;
00059     for (temp=0; temp<8; temp++){
00060       if (majorp>temp){
00061         displayItem[n].text[temp] = 4;
00062       }else{
00063         if (majorp<temp){
00064           displayItem[n].text[temp] = ' ';
00065         }else{
00066           switch(minorp){
00067           case 0:
00068             displayItem[n].text[temp] = ' ';
00069             break;
00070           case 1:
00071             displayItem[n].text[temp] = 0;
00072             break;
00073           case 2:
00074             displayItem[n].text[temp] = 1;
00075             break;
00076           case 3:
00077             displayItem[n].text[temp] = 2;
00078             break;
00079           case 4:
00080             displayItem[n].text[temp] = 3;
00081             break;
00082           case 5:
00083             displayItem[n].text[temp] = 4;
00084             break;
00085           }//switch
00086         }
00087       }
00088     }       
00089     displayItem[n].text[8] = ' ';
00090     displayItem[n].text[9] = ' ';
00091     if (displayValue>99) displayItem[n].text[9]='1';
00092     displayItem[n].text[10] = ' ';
00093     if (displayValue>9) displayItem[n].text[10]='0' + ((displayValue / 10) % 10);
00094     displayItem[n].text[11]='0' + (displayValue % 10);
00095     
00096 }

void SetDisplaySignedValue char  n,
int  i
 

Definition at line 24 of file display.c.

References displayItem, and displayItemStruct::text.

Referenced by AvailableProcessorTime(), and main().

00024                                          {
00025   bit negative;
00026   char c;
00027   negative = 0;
00028   if (i<0){
00029     negative = 1;
00030     i = -i;
00031   }
00032   for (c=0; c<12; c++) displayItem[n].text[c] = ' ';
00033   c=2;
00034   if (i>99) c=3;
00035   if (i>999) c=6;
00036   do {
00037     displayItem[n].text[c--] = '0' + (i % 10);
00038     i /= 10; 
00039   }  while (i);
00040   if (negative){
00041     displayItem[n].text[c] = '-';
00042   } else {
00043     displayItem[n].text[c] = '+';
00044   }      
00045 }

void SetDisplayText char  n,
char *  s
 

Definition at line 47 of file display.c.

References displayItem, and displayItemStruct::text.

Referenced by AvailableProcessorTime(), CancelMidi(), CancelRecord(), CancelWave(), EchoEnable(), main(), SelectMidiFile(), SelectRecordFile(), SelectWaveFile(), SetMidiFromFile(), and SetMidiFromUART().

00047                                     {
00048   char c;
00049   for (c=0; c<12; c++) displayItem[n].text[c] = s[c];
00050 }

void SetDisplayTitle char  n,
char *  s
 

Definition at line 19 of file display.c.

References displayItem, and displayItemStruct::title.

Referenced by main().

00019                                      {
00020   char c; 
00021   for (c=0; c<12; c++) displayItem[n].title[c] = s[c];
00022 }

void UpdateDisplay unsigned char  n  ) 
 

Paint display.

Definition at line 106 of file display.c.

References Temp::b, Temp::b0, Temp::b1, displayItem, displayTimeCount, Temp::i, LcdLocateHome, LcdLocateLine2, LcdPutChar(), LcdPutConstantString(), lyrics, Mp3ReadRegister(), Mp3WriteRegister, PlayerTaskHandler(), SCI_WRAM, SCI_WRAMADDR, temp, and UI_END_OF_MODES.

Referenced by AvailableProcessorTime(), and SelectWaveFile().

00106                                    {
00107   char i;
00108   static xdata char poly[16];
00109   
00110   PlayerTaskHandler();
00111   LcdLocateHome();
00112  
00113   if (n<1) {
00114 #if 0
00115     LcdPutConstantString("  *VS1103*  ");
00116 #else
00117     for (i=0; i<15; i++){
00118       unsigned char nn;
00119       temp.i = 1641 + i*19;
00120       Mp3WriteRegister(SCI_WRAMADDR, temp.b.b1, temp.b.b0);
00121       nn = Mp3ReadRegister(SCI_WRAM);
00122       if (nn){  
00123         if (nn>poly[i]){
00124           LcdPutChar(0xff);
00125         } else {
00126           LcdPutChar('0'+((i+1)%10));
00127         }      
00128       }else{
00129         LcdPutChar(' ');
00130       }
00131       poly[i]=nn;
00132     }   
00133     LcdPutConstantString("    ");
00134 #endif    
00135   }else{
00136     for (i=0; i<12; i++){
00137       PlayerTaskHandler();
00138       LcdPutChar(displayItem[n-1].title[i]);
00139     }
00140   }
00141 
00142   if (displayTimeCount & 0x10){
00143     //LcdPutConstantString("\xa2\xff");
00144     LcdPutConstantString(" \xff");
00145   }else{
00146     //LcdPutConstantString("\xa2 ");
00147     LcdPutConstantString("  ");
00148   }
00149 
00150   for (i=0; i<12; i++){
00151     PlayerTaskHandler();
00152     LcdPutChar(displayItem[n].title[i]);
00153   }
00154   //LcdPutConstantString(" \x7c");
00155   LcdPutConstantString("  ");
00156 
00157   if (n==0) {
00158     LcdPutConstantString("     ");
00159   }else{
00160     if (n>UI_END_OF_MODES-2) {
00161       LcdPutConstantString("            ");
00162     }else{
00163       for (i=0; i<12; i++){
00164         LcdPutChar(displayItem[n+1].title[i]);
00165       }
00166     }
00167   }
00168 
00169 
00170   PlayerTaskHandler();
00171   LcdLocateLine2();
00172   PlayerTaskHandler();
00173 
00174 
00175   if (lyricsDisplay){
00176     for (i=0; i<40; i++){
00177       PlayerTaskHandler();
00178       LcdPutChar(lyrics[i]);
00179     }
00180   } else {
00181     
00182     if (n<1) {
00183 
00184 
00185 #if 1
00186       LcdPutConstantString("^Channel Activity^ ");
00187 #else
00188     for (i=8; i<16; i++){
00189       unsigned char n;
00190       temp.i = 1641 + i*19;
00191       Mp3WriteRegister(SCI_WRAMADDR, temp.b.b1, temp.b.b0);
00192       n = Mp3ReadRegister(SCI_WRAM);
00193       if (n>poly[i]){
00194         LcdPutChar('0'+((i+1)%10));
00195       }else{
00196         LcdPutChar(' ');
00197       }
00198       poly[i]=n;
00199     }   
00200     LcdPutConstantString("    ");
00201 #endif    
00202 
00203     }else{
00204       for (i=0; i<12; i++){
00205         PlayerTaskHandler();
00206         LcdPutChar(displayItem[n-1].text[i]);
00207       }
00208     }
00209     if (displayTimeCount & 0x10){
00210       //    LcdPutConstantString("\x7c ");
00211       LcdPutConstantString("  ");
00212     }else{
00213       //    LcdPutConstantString("\x7c\xff");
00214       LcdPutConstantString(" \xff");
00215     }
00216     
00217     
00218     
00219     for (i=0; i<12; i++){
00220       PlayerTaskHandler();
00221       LcdPutChar(displayItem[n].text[i]);
00222     }
00223     //LcdPutConstantString(" \xa3");
00224     LcdPutConstantString("  ");
00225     if (n==0) {
00226       LcdPutConstantString("..-->");
00227     }else{
00228       if (n>UI_END_OF_MODES-2) {
00229         LcdPutConstantString("            ");
00230       }else{
00231         for (i=0; i<12; i++){
00232           PlayerTaskHandler();
00233           LcdPutChar(displayItem[n+1].text[i]);
00234         }
00235       }
00236     }
00237   }  
00238 
00239 }

Here is the call graph for this function:


Variable Documentation

xdata struct displayItemStruct displayItem[DISPLAY_ITEMS]
 

xdata unsigned char displayTimeCount
 

Definition at line 12 of file display.c.

Referenced by timer0_interrupt(), and UpdateDisplay().


All software copyright 2000-2004 VLSI Solution OY. Redistribution of these software modules is limited to VLSI Solution Oy chip promotional use only. Free or commercial use of these software modules in MP3 players is ok if the product includes chip(s) from VLSI. You can request the complete (compilable) package from mp3@vlsi.fi. This exampe code is provided with good faith to assist You in code development, but under no circumstances will VLSI offer any guarantees on the usability or functionality of any example software or its fitness for any purpose.