📄 lcm.c
字号:
{
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i+6,34);
for(j=0;j<11;j++)
{
k=PlayModeIcon128x64[(gc_DisplayPlayMode-1)*22+j+i*11];
LCM_Send_Data(k);
}
}
}
}
void LCM_ShowEQ(void)
{
U8 tc_word,i;
U8 tc_column;
U8 tc_EQ_table[8];
switch(gc_PlayEQMode)
{
default:
gc_PlayEQMode=0;
case 0: // NORMAL
tc_word=6;
tc_EQ_table[0]=22;
tc_EQ_table[1]=23;
tc_EQ_table[2]=25;
tc_EQ_table[3]=21;
tc_EQ_table[4]=11;
tc_EQ_table[5]=20;
break;
case 1: // DBB
tc_word=3;
tc_EQ_table[0]=14;
tc_EQ_table[1]=12;
tc_EQ_table[2]=12;
break;
case 2: // JAZZ
tc_word=4;
tc_EQ_table[0]=19;
tc_EQ_table[1]=11;
tc_EQ_table[2]=29;
tc_EQ_table[3]=29;
break;
case 3: // DISCO
tc_word=4;
tc_EQ_table[0]=14;
tc_EQ_table[1]=18;
tc_EQ_table[2]=26;
tc_EQ_table[3]=13;
tc_EQ_table[4]=23;
break;
case 4: // POP
tc_word=3;
tc_EQ_table[0]=24;
tc_EQ_table[1]=23;
tc_EQ_table[2]=24;
break;
case 5: // CLASS
tc_word=5;
tc_EQ_table[0]=13;
tc_EQ_table[1]=20;
tc_EQ_table[2]=11;
tc_EQ_table[3]=26;
tc_EQ_table[4]=26;
break;
}
tc_column=(8-tc_word)*6;
if(gc_LCM_Size!=0)
{
tc_column+=16;
}
else
{
tc_column+=((U8)gb_LCM_reverse*LCM_ReverseOffset);
}
for(i=0;i<tc_word;i++)
{
LCM_ShowChar12x32(tc_EQ_table[i],tc_column);
tc_column+=12;
}
}
void LCM_Show_NOMP3FILE(void)
{
U8 i;
U8 tc_column=0;
U8 tc_NoFile[12];
if(gc_LCM_Size==1)
{
LCM_ShowChar8x16_L2(12,0);
LCM_ShowChar8x16_L2(12,8);
tc_column=16;
}
else if(gb_LCM_reverse==1)
{
tc_column=(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
tc_NoFile[0]=26;
tc_NoFile[1]=27;
tc_NoFile[2]=12;
tc_NoFile[3]=25;
tc_NoFile[4]=28;
tc_NoFile[5]=03;
tc_NoFile[6]=12;
tc_NoFile[7]=18;
tc_NoFile[8]=21;
tc_NoFile[9]=24;
tc_NoFile[10]=17;
tc_NoFile[11]=67;
for(i=0;i<12;i++)
{
LCM_ShowChar8x16_L2(tc_NoFile[i],tc_column);
tc_column+=8;
}
if(gc_LCM_Size==1)
{
LCM_ShowChar8x16_L2(12,112);
LCM_ShowChar8x16_L2(12,120);
}
}
void LCM_Show_Filename(void)
{
U8 i;
U8 j;
U8 tc_column=(U8)gb_LCM_reverse*LCM_ReverseOffset;
U8 tc_DisplayWord;
U8 tc_data;
U16 tc_word;
if(gc_FileLongName[2]==0)
{
tc_word=(gc_FileLongName[4]-1)/2;
j=2;
}
else
{
tc_word=gc_FileLongName[4];
j=1;
}
if(gc_LCM_Size==0)
{
tc_DisplayWord=24;
}
else
{
tc_DisplayWord=32;
}
for(i=5+gc_DisplaySongnameCount*j;i<5+tc_DisplayWord+gc_DisplaySongnameCount*j;i+=j)
{
tc_data=gc_FileLongName[i]&0x7F;
if((gc_FileLongName[i]>='A') &&(gc_FileLongName[i]<='Z'))
{
tc_data=gc_FileLongName[i]-'A'+13;
}
else if((gc_FileLongName[i]>='a') &&(gc_FileLongName[i]<='z'))
{
tc_data=gc_FileLongName[i]-'a'+39;
}
else if((gc_FileLongName[i]>='0') &&(gc_FileLongName[i]<='9'))
{
tc_data=gc_FileLongName[i]-'0';
}
else if(gc_FileLongName[i]==':')
{
tc_data=10;
}
else if(gc_FileLongName[i]=='-')
{
tc_data=11;
}
else if(gc_FileLongName[i]=='.')
{
tc_data=65;
}
else if(gc_FileLongName[i]=='?')
{
tc_data=66;
}
else if(gc_FileLongName[i]=='!')
{
tc_data=67;
}
else if(gc_FileLongName[i]=='%')
{
tc_data=68;
}
else if(gc_FileLongName[i]==',')
{
tc_data=69;
}
else if(gc_FileLongName[i]==0x27)
{
tc_data=70;
}
else if(gc_FileLongName[i]==';')
{
tc_data=71;
}
else if(gc_FileLongName[i]=='"')
{
tc_data=72;
}
else if(gc_FileLongName[i]=='<')
{
tc_data=73;
}
else if(gc_FileLongName[i]=='>')
{
tc_data=74;
}
else if(gc_FileLongName[i]=='^')
{
tc_data=75;
}
else if(gc_FileLongName[i]=='~')
{
tc_data=77;
}
else
{
tc_data=12;
}
LCM_ShowChar8x16_L2(tc_data,tc_column);
tc_column+=8;
}
gc_DisplaySongnameCount++;
if(gc_LCM_Size==0)
{
if((gc_DisplaySongnameCount+11)>tc_word)
{
gc_DisplaySongnameCount=0;
}
}
else
{
if((gc_DisplaySongnameCount+15)>tc_word)
{
gc_DisplaySongnameCount=0;
}
}
}
void LCM_ShowERROR(void)
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=18+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=34;
}
LCM_ClearScreen();
LCM_ShowChar12x32(15,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
tc_column+=12;
LCM_ShowChar12x32(23,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
}
/*void LCM_ShowName(void)
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=18+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=34;
}
LCM_ClearScreen();
LCM_ShowChar12x32(13,tc_column);
tc_column+=12;
LCM_ShowChar12x32(11,tc_column);
tc_column+=12;
LCM_ShowChar12x32(23,tc_column);
}*/
void LCM_ShowIRNum(void)
{
U8 i;
U8 tc_column;
U8 tc_ShowCount=4;
U8 tc_offset=0;
if(gb_ChannelSet==1) // Frequency
{
if(gc_LCM_Size==0)
{
tc_column=4+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=16;
}
}
else // SONG
{
if(gc_LCM_Size!=0)
{
gb_LCM_reverse=0;
tc_offset=16;
}
tc_column=tc_offset+(U8)gb_LCM_reverse*LCM_ReverseOffset;
LCM_ShowChar12x32(26,tc_column); // S
LCM_ShowChar12x32(23,tc_column+12); // O
LCM_ShowChar12x32(22,tc_column+24); // N
LCM_ShowChar12x32(16,tc_column+36); // G
LCM_ShowChar12x32(31,tc_column+48); // space
tc_column+=60;
if(((gc_NUMBER[2]==2)||(gc_NUMBER[2]==1))&&((gc_NUMBER[1]==0xFF)||(gc_NUMBER[0]==0xFF)))
{
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
if(gc_NUMBER[1]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
tc_column+=12;
if(gc_NUMBER[0]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
}
else
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
return;
}
else
{
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
if(gc_NUMBER[0]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
}
else
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
}
return;
}
else
{
if(gc_NUMBER[2]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
}
if(gc_NUMBER[1]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
}
if(gc_NUMBER[0]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
}
return;
}
if(gc_NUMBER[3]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[3],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[2]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[2]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[1]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[1]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[0]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[0]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
if(tc_ShowCount==1) // Frequency
{
LCM_ShowChar12x32(32,tc_column); // .
tc_column+=8;
}
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
tc_column+=12;
tc_ShowCount--;
}
for(i=0;i<tc_ShowCount;i++)
{
if(i==(tc_ShowCount-1)) // Frequency
{
LCM_ShowChar12x32(32,tc_column); // .
tc_column+=8;
}
LCM_ShowChar12x32(31,tc_column);
tc_column+=12;
}
LCM_ShowChar12x32(21,tc_column); // M
tc_column+=12;
LCM_ShowChar12x32(17,tc_column); // H
tc_column+=12;
LCM_ShowChar12x32(30,tc_column); // z
}
void LCM_ShowMediaType(void)
{
U8 i,j,k=0;
if(gb_Media_type==1)
{
k=50;
}
for(i=6;i<8;i++)
{
LCM_Set_PageColumn(i,0);
for(j=0;j<25;j++)
{
LCM_Send_Data(MediaTypeIcon25x16[k]);
k++;
}
}
}
void LCM_ShowEQIcon(void)
{
U8 i,j,k;
k=gc_PlayEQMode*30;
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i+6,54);
for(j=0;j<15;j++)
{
LCM_Send_Data(EQIcon128x64[k]);
k++;
}
}
}
void LCM_ShowBitRate(void)
{
gc_LCM_line=6;
LCM_ShowChar8x16(gw_DisplayBitRate/100,78);
LCM_ShowChar8x16(gw_DisplayBitRate%100/10,86);
LCM_ShowChar8x16(gw_DisplayBitRate%10,94);
gc_LCM_line=0;
}
void LCM_ShowBitRateIcon(void)
{
U8 i,j,k=0;
for(i=6;i<8;i++)
{
LCM_Set_PageColumn(i,104);
for(j=0;j<21;j++)
{
LCM_Send_Data(BitRateIcon128x64[k]);
k++;
}
}
}
void P_LCM_Write_CMD(U8 CMD)
{
XBYTE[0xB402]&=0xEF; // A0=0 : FM[12]=0
XBYTE[0xB402]&=0xBF; // CS=0 : FM[14]=0
XBYTE[0xB030]=CMD;
if((CMD&0x80)==0x80)
{
P_LCM_D7=1;
}
else
{
P_LCM_D7=0;
}
XBYTE[0xB402]&=0xDF; // WR=0 : FM[13]=0
XBYTE[0xB402]|=0x20; // WR=1 : FM[13]=1
XBYTE[0xB402]|=0x40; // CS=1 : FM[14]=1
XBYTE[0xB402]|=0x10; // A0=1 : FM[12]=1
}
void P_LCM_Write_DAT(U8 DAT)
{
XBYTE[0xB402]&=0xBF; // CS=0 : FM[14]=0
XBYTE[0xB030]=DAT;
if((DAT&0x80)==1)
{
P_LCM_D7=1;
}
else
{
P_LCM_D7=0;
}
XBYTE[0xB402]&=0xDF; // WR=0 : FM[13]=0
XBYTE[0xB402]|=0x20; // WR=1 : FM[13]=1
XBYTE[0xB402]|=0x40; // CS=1 : FM[14]=1
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -