📄 uilcdnew.c
字号:
/******************************************************************************
* Copyright (c) 2006 Primax Corporation,Ltd. All rights reserved.
*
* Author: Junny Fu
*
* Description:
*
* Revision History:
* Date Author Description
******************************************************************************/
#define __Fax
#include "standard.h"
#include "Nucleus.h"
#include "Uilcdnew.h"
#include "Usbpanel.h"
#include "menu.h"
#include "UI_execute.h"
extern UIMaintain gUIMain;
extern NU_MAILBOX UI_MailBox;
//char L_arrow = 'a';
//char R_arrow = 'a';
API_RET DisplayLCD(Uint8 line, char * string, Uint8 aligntype,Bool arrow)
{
Uint8 xoffset,numchar;
char* tempbuf;
Uint8 i,j;
Uint32 k;
Uint32 UI_ExeCmd[4];
numchar = strlen(string);
switch(aligntype)
{
case LEFT:
LCDStringOut(0, line, string, numchar);
break;
case MIDDLE:
if(numchar <15||line == 0||gUIMain.UIstate == SCAN_PROCESSING||gUIMain.UIstate == STANDBY)
{
xoffset = (LCD_LINE_MAX-numchar)/2;
LCDStringOut(xoffset, line, string, numchar);
}
else
{
UI_ExeCmd[0] = disp_special;
UI_ExeCmd[1] = arrow;
// TaskMsgSend(UI_EXe_msgQue_id, &UI_execmd);
NU_Send_To_Mailbox(&UI_MailBox,(void *)UI_ExeCmd,NU_SUSPEND);
NU_Sleep(20);
return(API_OK);
/* modify by shaohua
xoffset = 1;
j = numchar - 12;
for(i=0 ; i<=j ; i++)
{
strcpy((string+numchar+i)," ");
tempbuf = string + i;
LCDStringOut(xoffset, line, tempbuf, numchar);
if(arrow)
{
#ifdef NEWPANELDRIVER
LCDCharOut(0, 1, 0xBD);
LCDCharOut(15, 1, 0xBC);
#else
LCDCharOut(0, 1, 0x7F);
LCDCharOut(15, 1, 0x7E);
#endif
}
NU_Sleep(200);
}
LCDStringOut(xoffset, line, string, numchar);
*/ }
if(arrow)
{
#ifdef NEWPANELDRIVER
LCDCharOut(0, 1, 0xBD);
LCDCharOut(15, 1, 0xBC);
#else
LCDCharOut(0, 1, 0x7F);
LCDCharOut(15, 1, 0x7E);
#endif
}
break;
case RIGHT:
xoffset = LCD_LINE_MAX-numchar;
LCDStringOut(xoffset, line, string, numchar);
break;
default:
break;
}
//PRINTF("call DisplayLCD \n");
return(API_OK);
}
API_RET LCDStringOut(Uint8 col,Uint8 row,char* s, Uint8 charnum)
{
Uint8 rowCnt, colCnt;
if(UsbPanelLCDDim(&rowCnt, &colCnt) == API_OK)
{
if(row < rowCnt)
{
UsbPanelLCDToDDRamPos(row, col);
//charnum = strlen(s); //modify by shaohua
UsbPanelLCDWriteMultiData((Uint8*)s, charnum);
}
}
return(API_OK);
}
API_RET LCDCharOut(Uint8 col, Uint8 row, char c)
{
Uint8 rowCnt, colCnt;
if(UsbPanelLCDDim(&rowCnt, &colCnt) == API_OK)
{
if(row < rowCnt)
{
UsbPanelLCDToDDRamPos(row, col);
UsbPanelLCDWriteData(c);
}
}
return(API_OK);
}
API_RET LCDCursorPos(Uint8 col, Uint8 row)
{
Uint8 rowCnt, colCnt;
if(UsbPanelLCDDim(&rowCnt, &colCnt) == API_OK)
{
if(row < rowCnt)
{
UsbPanelLCDToDDRamPos(row, col);
// UsbPanelLCDCursorMode(TRUE);
}
}
return(API_OK);
}
API_RET LCDDisplayClear()
{
return UsbPanelLCDClrDisp();
}
API_RET LCDInit()
{
return UsbPanelInit();
}
API_RET LCDCursorOff()
{
return UsbPanelLCDCursorMode(FALSE);
}
API_RET LCDCursorOn()
{
return UsbPanelLCDCursorMode(TRUE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -