📄 lcdlib.c
字号:
[file head]:
#include "LCD_320240.h"
#include "uart_lib.h"
#include "44b.h"
#include "LCDlib.h"
#include "hanzi.h"
#include "GUIbasic.h"
#define BIT_A0 (0x1 << 7)
#define BIT_nWR (0x1 << 6)
#define BIT_nRD (0x1 << 5)
#define DELAY_TIME 2
static const BYTE SYSTAB[8] = {
0x30, // 0011 0000 B: 1, W/S: 0, M2: 0, M1: 0, M0: 0
0x87, // 1000 0111 WF: 1, FX: 7字符宽度8点阵
0x0f, // 0000 1111 FY: 16字符垂直大小16点阵
0x27, // 0010 0111 C/R: 39 每行显示的字符数
0x36, // 0100 0010 TC/R: 66
0xEF, // 1110 1111 L/F: 240
0x28, // 0010 1000 APL: 40
0x00 // 0000 0000 APH: 0
};
#define BasePart1 0x00//0x0000为第一显示区首地址
#define BasePart2 0x40//0x4000为第二显示区首地址
#define BasePart3 0x80//0x8000为第三显示区首地址
#define BasePart4 0x00
static const BYTE SCRTAB[10] = {
0x00, // 0000 0000 SAD1L: 0x00
BasePart1, // 0000 0000
... ...
[file tail]:
... ...
)
{
WLCDData(ASCII16x8[data-0x20][i]);
Delay(10);
}
}
/*字符串显示输出*/
void DrawSting16X16( UINT16 rowfirst,UINT16 colfirst, char *p)
{
UINT16 q,qq;
UINT16 row,col;
int i;
row=rowfirst;
col=colfirst;
i=0;
while(p[i]!='\0')
{
if(p[i]&amt;0x80)
{
q=p[i];
i++;
qq=p[i];
q=(q-0xB0)*94+(qq-0xA1); //取出汉字内码
Lcd_printfHZ(row,col,q);
col+=2;
if(col==40)
{
col=0;
row++;
}
}
else
{
Lcd_printfchar(row,col,p[i]); //输出单个字符
col++;
if(col==40)
{
col=0;
row++;
}
}
i++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -