📄 hallcm.lst
字号:
byCurChar = *(byData+m);
if(byCurChar == 0x00){ //string terminate
break;
}
//if((byCurChar > '~')||(byCurChar < ' ')) break;
if((byCurChar > 'Z') && (byCurChar != '['))
{
if(byCurChar > 'z' || byCurChar < 'a')
byCurChar = '-';
else
byCurChar -= 32;
}
byCharData = nAsciiDot + (byCurChar - 0x20)*16;//Got the dot map
if(byX>120)//next page
{
break;
}
_halLCMWrite(byX, byY, byCharData, 8);
byCharData = nAsciiDot + (byCurChar - 0x20)*16 + 8;//Got the dot map
_halLCMWrite(byX, byY+1, byCharData, 8);
byX += 8;//Move Column
m++;
}
}
#if 0
void halLCMWriteDataW(BYTE byXAddr, BYTE byYAddr, WORD* wData)
{
BYTE byData[LFN_WORD_MAX+1];
BYTE byCount = 0;
WORD *wPtData = wData;
while(*wPtData != 0)
{
if(*wPtData < 255)
{
byData[byCount++] = *wPtData;
}
wPtData++;
}
halLCMWriteData(byXAddr, byYAddr, byData, byCount);
}
#endif
#if 0
void halLCMICon(BYTE byXAddr, BYTE byIconID)
{
BYTE *byData = NULL;
switch(byIconID)
{
#if 0
case ICON_ID_USB:
byXLen = 32;
byData = nUSBIcon;
break;
case ICON_ID_SD:
byXLen = 32;
C51 COMPILER V8.01 HALLCM 04/17/2008 09:54:55 PAGE 6
byData = nSDIcon;
break;
#endif
case ICON_ID_PLAY:
byData = nPlayIcon;
break;
case ICON_ID_PAUSE:
byData = nPauseIcon;
break;
case ICON_ID_SPEAKER:
byData = nSpeakerIcon;
break;
case ICON_ID_ATH:
byData = nAthIcon;
break;
default:
return;
}
// if(byData != NULL)
// {
halLCMSPIInit();
halLCMSPISend(0x80 | byXAddr, FALSE);
halLCMSPISend(0x45, FALSE);
for(n = 0; n < 7; n++)
{
halLCMSPISend(*byData, TRUE);
byData++;
}
// }
}
#endif
void halLCMClear(BYTE byStart, BYTE byEnd) //range 0 - 3 line
{
#if 0
BYTE data i;
while(byStart <= byEnd)
{
halLCMSPIInit();
halLCMSPISend(0xb0+byStart, FALSE);//Page address
halLCMSPISend(0x10, FALSE);//Column address, high 4bits
halLCMSPISend(0x00, FALSE);//Column address, low 4bits;
for(i = 0; i < 128; i++)
{
halLCMSPISend(0x00, TRUE);
}
byStart++;
}
#else
byStart = 3 - byStart;
byEnd = 3 - byEnd;
//halSetSplc502b(byStart, byEnd, 0x00);
halSetSplc502b(byEnd, byStart, 0x00);
#endif
return;
}
//FONT Enlarge: 8*16 -> 16*32
C51 COMPILER V8.01 HALLCM 04/17/2008 09:54:55 PAGE 7
static BYTE FontBuf[4][16];
static void _halLCMFontConv(BYTE *bpFont)
{
BYTE bTmp;
BYTE i;
BYTE j;
BYTE k;
WORD data wTmp;
BYTE * data bpTmp = bpFont;
BYTE * data bpTarget = FontBuf[0];
for(k=0; k<2; k++){
for(i=0; i<8; i++){
bTmp = *bpTmp;
wTmp = 0x00;
for(j=0; j<8; j++){
wTmp <<= 2;
if(bTmp&0x80){
wTmp |= 0x03;
}
bTmp <<= 1;
}
FontBuf[(k<<1)+0][(i<<1)+1] = FontBuf[(k<<1)+0][(i<<1)+0] = (BYTE)(wTmp>>8);
FontBuf[(k<<1)+1][(i<<1)+1] = FontBuf[(k<<1)+1][(i<<1)+0] = (BYTE)(wTmp&0xff);
bpTmp++;
}
}
return;
}
#if 0
void halFontTest(void)
{
static BYTE CharIdx = 0;
BYTE *bpCharData;
BYTE i;
BYTE byX, byY;
halLCMClear(0, 3);
bpCharData = nAsciiDot + CharIdx*16;//Got the dot map
CharIdx ++;
if(CharIdx >= ASCII_NUM)
CharIdx = 0;
_halLCMFontConv(bpCharData);
byX = 8;//Column
for(i=0; i< 4; i++){
_halLCMWrite(byX, i, FontBuf[i], 16);//Page i: from 0 to 3
}
return;
}
#endif
//Page address is default to zero.
void halLCMWriteBig(BYTE byXAddr, BYTE* byData, BYTE byLen)
C51 COMPILER V8.01 HALLCM 04/17/2008 09:54:55 PAGE 8
{
BYTE data i;
BYTE data m;
BYTE data byX;
BYTE * byCharData;
BYTE data byCurChar;
m = 0;
byX = byXAddr;
//byY = 0;
// if(byData == NULL) return;
while(m < byLen)
{
byCurChar = *(byData+m);
if(byCurChar == 0x00){ //string terminate
break;
}
//if((byCurChar > '~')||(byCurChar < ' ')) break;
if(byCurChar > 'Z')
{
if(byCurChar > 'z' || byCurChar < 'a')
byCurChar = '-';
else
byCurChar -= 32;
}
if(byX>120)//next page
{
break;
}
byCharData = nAsciiDot + (byCurChar - 0x20)*16;//Got the dot map
_halLCMFontConv(byCharData);
for(i=0; i< 4; i++){
_halLCMWrite(byX, i, FontBuf[i], 16);//Page i: from 0 to 3
}
byX += 16;//Move Column
m++;
}
return;
}
#endif
474
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = ---- ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -