本文主要是介绍stm32驱动1.44寸LCD屏幕显示中文字符包含可移植keil5工程代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.44寸LCD屏幕
之前的0.96寸的OLED屏幕坏掉了,现在重新买了一块1.44寸的LCD屏幕,感觉这次的质量比较好,还可以显示彩色的
用的IC是stm32f103vet6
接线方法是
供电要5V的,3.3V只会白屏
SCL接PB13
SDA接PB15
RES接PB12(复位,和stm32接同一个复位就行)
DC接PB10
那个CS片选完全可以不接就默认浮空吧
BL接GND的话是关闭屏幕,浮空或者接3.3V就是开启屏幕,那就不接默认浮空吧
将某宝卖家提供的工程移植到了自己的工程模板中,简单的使用了一下,明天整理好以后在评论地方放百度网盘的keil5工程
放一个例子显示的效果图
之后准备做个简单的dht11温湿度显示
这里贴一下lcd代码,会移植的就直接移植就行了
lcd.c
#include "lcd.h"
#include "stdlib.h"
#include "usart.h"
#include "delay.h" /****************************************************************************************************
//=======================================液晶屏数据线接线==========================================//
//CS 接PB11 //片选信号
//CLK 接PB13 //SPI时钟信号
//SDI(DIN) 接PB15 //SPI总线数据信号
//=======================================液晶屏控制线接线==========================================//
//LED 接PB9 //背光控制信号,高电平点亮
//RS(D/C) 接PB10 //寄存器/数据选择信号(RS=0数据总线发送的是指令;RS=1数据总线发送的是像素数据)
//RST 接PB12 //液晶屏复位信号,低电平复位
/
//==================================如何精简到只需要3个IO=======================================//
//1.CS信号可以精简,不作SPI复用片选可将CS接地常低,节省1个IO
//2.LED背光控制信号可以接高电平3.3V背光常亮,节省1个IO
//3.RST复位信号可以接到单片机的复位端,利用系统上电复位,节省1个IO
//==================================如何切换横竖屏显示=======================================//
//打开lcd.h头文件,修改宏#define USE_HORIZONTAL 值为0使用竖屏模式.1,使用横屏模式
//===========================如何切换模拟SPI总线驱动和硬件SPI总线驱动=========================//
//打开lcd.h头文件,修改宏#define USE_HARDWARE_SPI 值为0使用模拟SPI总线.1,使用硬件SPI总线
**************************************************************************************************/ //管理LCD重要参数
//默认为竖屏
_lcd_dev lcddev;//画笔颜色,背景颜色
u16 POINT_COLOR = 0x0000,BACK_COLOR = 0xFFFF;
u16 DeviceCode; /****************************************************************************
* 名 称:void SPIv_WriteData(u8 Data)
* 功 能:STM32_模拟SPI写一个字节数据底层函数
* 入口参数:Data
* 出口参数:无
* 说 明:STM32_模拟SPI读写一个字节数据底层函数
****************************************************************************/
void SPIv_WriteData(u8 Data)
{unsigned char i=0;for(i=8;i>0;i--){if(Data&0x80) LCD_SDA_SET; //输出数据else LCD_SDA_CLR;LCD_SCL_CLR; LCD_SCL_SET;Data<<=1; }
}/****************************************************************************
* 名 称:u8 SPI_WriteByte(SPI_TypeDef* SPIx,u8 Byte)
* 功 能:STM32_硬件SPI读写一个字节数据底层函数
* 入口参数:SPIx,Byte
* 出口参数:返回总线收到的数据
* 说 明:STM32_硬件SPI读写一个字节数据底层函数
****************************************************************************/
u8 SPI_WriteByte(SPI_TypeDef* SPIx,u8 Byte)
{while((SPIx->SR&SPI_I2S_FLAG_TXE)==RESET); //等待发送区空 SPIx->DR=Byte; //发送一个byte while((SPIx->SR&SPI_I2S_FLAG_RXNE)==RESET);//等待接收完一个byte return SPIx->DR; //返回收到的数据
} /****************************************************************************
* 名 称:void SPI_SetSpeed(SPI_TypeDef* SPIx,u8 SpeedSet)
* 功 能:设置SPI的速度
* 入口参数:SPIx,SpeedSet
* 出口参数:无
* 说 明:SpeedSet:1,高速;0,低速;
****************************************************************************/
void SPI_SetSpeed(SPI_TypeDef* SPIx,u8 SpeedSet)
{SPIx->CR1&=0XFFC7;if(SpeedSet==1)//高速{SPIx->CR1|=SPI_BaudRatePrescaler_2;//Fsck=Fpclk/2 }else//低速{SPIx->CR1|=SPI_BaudRatePrescaler_32; //Fsck=Fpclk/32}SPIx->CR1|=1<<6; //SPI设备使能
} /****************************************************************************
* 名 称:SPI2_Init(void)
* 功 能:STM32_SPI2硬件配置初始化
* 入口参数:无
* 出口参数:无
* 说 明:STM32_SPI2硬件配置初始化
****************************************************************************/
void SPI2_Init(void)
{SPI_InitTypeDef SPI_InitStructure;GPIO_InitTypeDef GPIO_InitStructure;//配置SPI2管脚RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO|RCC_APB2Periph_GPIOB, ENABLE);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_Init(GPIOB, &GPIO_InitStructure);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9|GPIO_Pin_10| GPIO_Pin_11| GPIO_Pin_12;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;GPIO_Init(GPIOB, &GPIO_InitStructure);//SPI2配置选项RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI2 ,ENABLE);SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;SPI_InitStructure.SPI_Mode = SPI_Mode_Master;SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;SPI_InitStructure.SPI_CRCPolynomial = 7;SPI_Init(SPI2, &SPI_InitStructure);//使能SPI2SPI_Cmd(SPI2, ENABLE);
}//******************************************************************
//功能: 向液晶屏总线写入写16位指令
//******************************************************************
void LCD_WR_REG(u16 data)
{ LCD_CS_CLR;LCD_RS_CLR;
#if USE_HARDWARE_SPI SPI_WriteByte(SPI2,data);
#elseSPIv_WriteData(data);
#endif LCD_CS_SET;
}//******************************************************************
//功能: 向液晶屏总线写入写8位数据
//******************************************************************
void LCD_WR_DATA(u8 data)
{LCD_CS_CLR;LCD_RS_SET;
#if USE_HARDWARE_SPI SPI_WriteByte(SPI2,data);
#elseSPIv_WriteData(data);
#endif LCD_CS_SET;}
//******************************************************************
//功能: 8位总线下如何写入一个16位数据
//******************************************************************
void LCD_WR_DATA_16Bit(u16 data)
{ LCD_CS_CLR;LCD_RS_SET;
#if USE_HARDWARE_SPI SPI_WriteByte(SPI2,data>>8);SPI_WriteByte(SPI2,data);
#elseSPIv_WriteData(data>>8);SPIv_WriteData(data);
#endif LCD_CS_SET;
}//******************************************************************
//功能: 写寄存器数据
//******************************************************************
void LCD_WriteReg(u16 LCD_Reg, u16 LCD_RegValue)
{ LCD_WR_REG(LCD_Reg); LCD_WR_DATA(LCD_RegValue);
} //******************************************************************
//开始写GRAM
//在给液晶屏传送RGB数据前,应该发送写GRAM指令
//******************************************************************
void LCD_WriteRAM_Prepare(void)
{LCD_WR_REG(lcddev.wramcmd);
} //******************************************************************
//在指定位置写入一个像素点数据
//******************************************************************
void LCD_DrawPoint(u16 x,u16 y)
{LCD_SetCursor(x,y);//设置光标位置 LCD_WR_DATA_16Bit(POINT_COLOR);
}//******************************************************************
//液晶屏IO初始化,液晶初始化前要调用此函数
//******************************************************************
void LCD_GPIOInit(void)
{GPIO_InitTypeDef GPIO_InitStructure;RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB ,ENABLE);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9| GPIO_Pin_10| GPIO_Pin_11| GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14| GPIO_Pin_15;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;GPIO_Init(GPIOB, &GPIO_InitStructure);
}//******************************************************************
//功能: LCD复位函数,液晶初始化前要调用此函数
//******************************************************************
void LCD_RESET(void)
{LCD_RST_CLR;delay_ms(100); LCD_RST_SET;delay_ms(50);
}//******************************************************************
//LCD初始化
//******************************************************************
void LCD_Init(void)
{
#if USE_HARDWARE_SPI //使用硬件SPISPI2_Init();
#else LCD_GPIOInit();//使用模拟SPI
#endif LCD_RESET(); //液晶屏复位//************* Start Initial Sequence **********// //开始初始化液晶屏LCD_WR_REG(0x11);//Sleep exit delay_ms (120); //ST7735R Frame RateLCD_WR_REG(0xB1); LCD_WR_DATA(0x01); LCD_WR_DATA(0x2C); LCD_WR_DATA(0x2D); LCD_WR_REG(0xB2); LCD_WR_DATA(0x01); LCD_WR_DATA(0x2C); LCD_WR_DATA(0x2D); LCD_WR_REG(0xB3); LCD_WR_DATA(0x01); LCD_WR_DATA(0x2C); LCD_WR_DATA(0x2D); LCD_WR_DATA(0x01); LCD_WR_DATA(0x2C); LCD_WR_DATA(0x2D); LCD_WR_REG(0xB4); //Column inversion LCD_WR_DATA(0x07); //ST7735R Power SequenceLCD_WR_REG(0xC0); LCD_WR_DATA(0xA2); LCD_WR_DATA(0x02); LCD_WR_DATA(0x84); LCD_WR_REG(0xC1); LCD_WR_DATA(0xC5); LCD_WR_REG(0xC2); LCD_WR_DATA(0x0A); LCD_WR_DATA(0x00); LCD_WR_REG(0xC3); LCD_WR_DATA(0x8A); LCD_WR_DATA(0x2A); LCD_WR_REG(0xC4); LCD_WR_DATA(0x8A); LCD_WR_DATA(0xEE); LCD_WR_REG(0xC5); //VCOM LCD_WR_DATA(0x0E); LCD_WR_REG(0x36); //MX, MY, RGB mode LCD_WR_DATA(0xC8); //ST7735R Gamma SequenceLCD_WR_REG(0xe0); LCD_WR_DATA(0x0f); LCD_WR_DATA(0x1a); LCD_WR_DATA(0x0f); LCD_WR_DATA(0x18); LCD_WR_DATA(0x2f); LCD_WR_DATA(0x28); LCD_WR_DATA(0x20); LCD_WR_DATA(0x22); LCD_WR_DATA(0x1f); LCD_WR_DATA(0x1b); LCD_WR_DATA(0x23); LCD_WR_DATA(0x37); LCD_WR_DATA(0x00); LCD_WR_DATA(0x07); LCD_WR_DATA(0x02); LCD_WR_DATA(0x10); LCD_WR_REG(0xe1); LCD_WR_DATA(0x0f); LCD_WR_DATA(0x1b); LCD_WR_DATA(0x0f); LCD_WR_DATA(0x17); LCD_WR_DATA(0x33); LCD_WR_DATA(0x2c); LCD_WR_DATA(0x29); LCD_WR_DATA(0x2e); LCD_WR_DATA(0x30); LCD_WR_DATA(0x30); LCD_WR_DATA(0x39); LCD_WR_DATA(0x3f); LCD_WR_DATA(0x00); LCD_WR_DATA(0x07); LCD_WR_DATA(0x03); LCD_WR_DATA(0x10); LCD_WR_REG(0x2a);LCD_WR_DATA(0x00);LCD_WR_DATA(0x00);LCD_WR_DATA(0x00);LCD_WR_DATA(0x7f);LCD_WR_REG(0x2b);LCD_WR_DATA(0x00);LCD_WR_DATA(0x00);LCD_WR_DATA(0x00);LCD_WR_DATA(0x9f);LCD_WR_REG(0xF0); //Enable test command LCD_WR_DATA(0x01); LCD_WR_REG(0xF6); //Disable ram power save mode LCD_WR_DATA(0x00); LCD_WR_REG(0x3A); //65k mode LCD_WR_DATA(0x05); LCD_WR_REG(0x29);//Display on LCD_SetParam();//设置LCD参数 LCD_LED_SET;//点亮背光 //LCD_Clear(WHITE);
}
//******************************************************************
//LCD全屏填充清屏函数
//******************************************************************
void LCD_Clear(u16 Color)
{u16 i,j; LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1); for(i=0;i<lcddev.width;i++){for(j=0;j<lcddev.height;j++)LCD_WR_DATA_16Bit(Color); //写入数据 }
} /*************************************************
功能:设置lcd显示窗口,在此区域写点数据自动换行
入口参数:xy起点和终点
*************************************************/
void LCD_SetWindows(u16 xStar, u16 yStar,u16 xEnd,u16 yEnd)
{
#if USE_HORIZONTAL==1 //使用横屏LCD_WR_REG(lcddev.setxcmd); LCD_WR_DATA(xStar>>8);LCD_WR_DATA(0x00FF&xStar+3); LCD_WR_DATA(xEnd>>8);LCD_WR_DATA(0x00FF&xEnd+3);LCD_WR_REG(lcddev.setycmd); LCD_WR_DATA(yStar>>8);LCD_WR_DATA(0x00FF&yStar+2); LCD_WR_DATA(yEnd>>8);LCD_WR_DATA(0x00FF&yEnd+2); #elseLCD_WR_REG(lcddev.setxcmd); LCD_WR_DATA(xStar>>8);LCD_WR_DATA(0x00FF&xStar+2); LCD_WR_DATA(xEnd>>8);LCD_WR_DATA(0x00FF&xEnd+2);LCD_WR_REG(lcddev.setycmd); LCD_WR_DATA(yStar>>8);LCD_WR_DATA(0x00FF&yStar+3); LCD_WR_DATA(yEnd>>8);LCD_WR_DATA(0x00FF&yEnd+3);
#endifLCD_WriteRAM_Prepare(); //开始写入GRAM
} /*************************************************
功能:设置光标位置
入口参数:xy坐标
*************************************************/
void LCD_SetCursor(u16 Xpos, u16 Ypos)
{ LCD_SetWindows(Xpos,Ypos,Xpos,Ypos);
} //设置LCD参数
//方便进行横竖屏模式切换
void LCD_SetParam(void)
{ lcddev.wramcmd=0x2C;
#if USE_HORIZONTAL==1 //使用横屏 lcddev.dir=1;//横屏lcddev.width=128;lcddev.height=128;lcddev.setxcmd=0x2A;lcddev.setycmd=0x2B; LCD_WriteReg(0x36,0xA8);#else//竖屏lcddev.dir=0;//竖屏 lcddev.width=128;lcddev.height=128;lcddev.setxcmd=0x2A;lcddev.setycmd=0x2B; LCD_WriteReg(0x36,0xC8);
#endif
}
lcd.h
#ifndef __LCD_H
#define __LCD_H
#include "sys.h"
#include "stdlib.h"//LCD重要参数集
typedef struct
{ u16 width; //LCD 宽度u16 height; //LCD 高度u16 id; //LCD IDu8 dir; //横屏还是竖屏控制:0,竖屏;1,横屏。 u16 wramcmd; //开始写gram指令u16 setxcmd; //设置x坐标指令u16 setycmd; //设置y坐标指令
}_lcd_dev; //LCD参数
extern _lcd_dev lcddev; //管理LCD重要参数
/用户配置区///
//支持横竖屏快速定义切换,支持8/16位模式切换
#define USE_HORIZONTAL 0 //定义是否使用横屏 0,不使用.1,使用.
//使用硬件SPI 还是模拟SPI作为测试
#define USE_HARDWARE_SPI 1 //1:Enable Hardware SPI;0:USE Soft SPI
//
//定义LCD的尺寸
#if USE_HORIZONTAL==1 //使用横屏
#define LCD_W 320
#define LCD_H 240
#else
#define LCD_W 240
#define LCD_H 320
#endif//TFTLCD部分外要调用的函数
extern u16 POINT_COLOR;//默认红色
extern u16 BACK_COLOR; //背景颜色.默认为白色
//-----------------LCD端口定义----------------
//QDtech全系列模块采用了三极管控制背光亮灭,用户也可以接PWM调节背光亮度
#define LCD_LED GPIO_Pin_9 //PB9 连接至TFT -LED
//接口定义在Lcd_Driver.h内定义,请根据接线修改并修改相应IO初始化LCD_GPIO_Init()
#define LCD_CTRL GPIOB //定义TFT数据端口
#define LCD_RS GPIO_Pin_10 //PB10连接至TFT --RS
#define LCD_CS GPIO_Pin_11 //PB11 连接至TFT --CS
#define LCD_RST GPIO_Pin_12 //PB12连接至TFT --RST
#define LCD_SCL GPIO_Pin_13 //PB13连接至TFT -- CLK
#define LCD_SDA GPIO_Pin_15 //PB15连接至TFT - SDI//
//液晶控制口置1操作语句宏定义
#define LCD_CS_SET LCD_CTRL->BSRR=LCD_CS
#define LCD_RS_SET LCD_CTRL->BSRR=LCD_RS
#define LCD_SDA_SET LCD_CTRL->BSRR=LCD_SDA
#define LCD_SCL_SET LCD_CTRL->BSRR=LCD_SCL
#define LCD_RST_SET LCD_CTRL->BSRR=LCD_RST
#define LCD_LED_SET LCD_CTRL->BSRR=LCD_LED //液晶控制口置0操作语句宏定义
#define LCD_CS_CLR LCD_CTRL->BRR=LCD_CS
#define LCD_RS_CLR LCD_CTRL->BRR=LCD_RS
#define LCD_SDA_CLR LCD_CTRL->BRR=LCD_SDA
#define LCD_SCL_CLR LCD_CTRL->BRR=LCD_SCL
#define LCD_RST_CLR LCD_CTRL->BRR=LCD_RST
#define LCD_LED_CLR LCD_CTRL->BRR=LCD_LED //画笔颜色
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40 //棕色
#define BRRED 0XFC07 //棕红色
#define GRAY 0X8430 //灰色
//GUI颜色#define DARKBLUE 0X01CF //深蓝色
#define LIGHTBLUE 0X7D7C //浅蓝色
#define GRAYBLUE 0X5458 //灰蓝色
//以上三色为PANEL的颜色 #define LIGHTGREEN 0X841F //浅绿色
//#define LIGHTGRAY 0XEF5B //浅灰色(PANNEL)
#define LGRAY 0XC618 //浅灰色(PANNEL),窗体背景色#define LGRAYBLUE 0XA651 //浅灰蓝色(中间层颜色)
#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)extern u16 BACK_COLOR, POINT_COLOR ; void LCD_Init(void);
void LCD_DisplayOn(void);
void LCD_DisplayOff(void);
void LCD_Clear(u16 Color);
void LCD_SetCursor(u16 Xpos, u16 Ypos);
void LCD_DrawPoint(u16 x,u16 y);//画点
u16 LCD_ReadPoint(u16 x,u16 y); //读点
void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2);
void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2);
void LCD_SetWindows(u16 xStar, u16 yStar,u16 xEnd,u16 yEnd);
void LCD_DrawPoint_16Bit(u16 color);
u16 LCD_RD_DATA(void);//读取LCD数据
void LCD_WriteReg(u16 LCD_Reg, u16 LCD_RegValue);
void LCD_WR_DATA(u8 data);
void LCD_WR_DATA_16Bit(u16 data);
u16 LCD_ReadReg(u8 LCD_Reg);
void LCD_WriteRAM_Prepare(void);
void LCD_WriteRAM(u16 RGB_Code);
u16 LCD_ReadRAM(void);
u16 LCD_BGR2RGB(u16 c);
void LCD_SetParam(void);#endif
gui.c
#include "lcd.h"
#include "string.h"
#include "font.h"
#include "delay.h"
#include "gui.h"//******************************************************************
//函数名: GUI_DrawPoint
//作者: xiao冯@全动电子
//日期: 2013-02-22
//功能: GUI描绘一个点
//输入参数:x:光标位置x坐标
// y:光标位置y坐标
// color:要填充的颜色
//返回值: 无
//修改记录:无
//******************************************************************
void GUI_DrawPoint(u16 x,u16 y,u16 color)
{LCD_SetCursor(x,y);//设置光标位置 LCD_WR_DATA_16Bit(color);
}//******************************************************************
//功能: 在指定区域内填充颜色
//输入参数:sx:指定区域开始点x坐标
// sy:指定区域开始点y坐标
// ex:指定区域结束点x坐标
// ey:指定区域结束点y坐标
// color:要填充的颜色
//******************************************************************
void LCD_Fill(u16 sx,u16 sy,u16 ex,u16 ey,u16 color)
{ u16 i,j; u16 width=ex-sx+1; //得到填充的宽度u16 height=ey-sy+1; //高度LCD_SetWindows(sx,sy,ex-1,ey-1);//设置显示窗口for(i=0;i<height;i++){for(j=0;j<width;j++)LCD_WR_DATA_16Bit(color); //写入数据 }LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口设置为全屏
}//******************************************************************
//功能: GUI画线
//输入参数:x1,y1:起点坐标
// x2,y2:终点坐标
//******************************************************************
void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2)
{u16 t; int xerr=0,yerr=0,delta_x,delta_y,distance; int incx,incy,uRow,uCol; delta_x=x2-x1; //计算坐标增量 delta_y=y2-y1; uRow=x1; uCol=y1; if(delta_x>0)incx=1; //设置单步方向 else if(delta_x==0)incx=0;//垂直线 else {incx=-1;delta_x=-delta_x;} if(delta_y>0)incy=1; else if(delta_y==0)incy=0;//水平线 else{incy=-1;delta_y=-delta_y;} if( delta_x>delta_y)distance=delta_x; //选取基本增量坐标轴 else distance=delta_y; for(t=0;t<=distance+1;t++ )//画线输出 { LCD_DrawPoint(uRow,uCol);//画点 xerr+=delta_x ; yerr+=delta_y ; if(xerr>distance) { xerr-=distance; uRow+=incx; } if(yerr>distance) { yerr-=distance; uCol+=incy; } }
} //******************************************************************
//功能: GUI画矩形(非填充)
//输入参数:(x1,y1),(x2,y2):矩形的对角坐标
//******************************************************************
void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2)
{LCD_DrawLine(x1,y1,x2,y1);LCD_DrawLine(x1,y1,x1,y2);LCD_DrawLine(x1,y2,x2,y2);LCD_DrawLine(x2,y1,x2,y2);
} //******************************************************************
//功能: GUI画矩形(填充)
//输入参数:(x1,y1),(x2,y2):矩形的对角坐标
//******************************************************************
void LCD_DrawFillRectangle(u16 x1, u16 y1, u16 x2, u16 y2)
{LCD_Fill(x1,y1,x2,y2,POINT_COLOR);}//******************************************************************
//功能: 8对称性画圆算法(内部调用)
//输入参数:(xc,yc) :圆中心坐标
// (x,y):光标相对于圆心的坐标
// c:填充的颜色
//******************************************************************
void _draw_circle_8(int xc, int yc, int x, int y, u16 c)
{GUI_DrawPoint(xc + x, yc + y, c);GUI_DrawPoint(xc - x, yc + y, c);GUI_DrawPoint(xc + x, yc - y, c);GUI_DrawPoint(xc - x, yc - y, c);GUI_DrawPoint(xc + y, yc + x, c);GUI_DrawPoint(xc - y, yc + x, c);GUI_DrawPoint(xc + y, yc - x, c);GUI_DrawPoint(xc - y, yc - x, c);
}//******************************************************************
//功能: 在指定位置画一个指定大小的圆(填充)
//输入参数:(xc,yc) :圆中心坐标
// c:填充的颜色
// r:圆半径
// fill:填充判断标志,1-填充,0-不填充
//******************************************************************
void gui_circle(int xc, int yc,u16 c,int r, int fill)
{int x = 0, y = r, yi, d;d = 3 - 2 * r;if (fill) {// 如果填充(画实心圆)while (x <= y) {for (yi = x; yi <= y; yi++)_draw_circle_8(xc, yc, x, yi, c);if (d < 0) {d = d + 4 * x + 6;} else {d = d + 4 * (x - y) + 10;y--;}x++;}} else {// 如果不填充(画空心圆)while (x <= y) {_draw_circle_8(xc, yc, x, y, c);if (d < 0) {d = d + 4 * x + 6;} else {d = d + 4 * (x - y) + 10;y--;}x++;}}
}//******************************************************************
//功能: 显示单个英文字符
//输入参数:(x,y):字符显示位置起始坐标
// fc:前置画笔颜色
// bc:背景颜色
// num:数值(0-94)
// size:字体大小
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void LCD_ShowChar(u16 x,u16 y,u16 fc, u16 bc, u8 num,u8 size,u8 mode)
{ u8 temp;u8 pos,t;u16 colortemp=POINT_COLOR; num=num-' ';//得到偏移后的值LCD_SetWindows(x,y,x+size/2-1,y+size-1);//设置单个文字显示窗口if(!mode) //非叠加方式{for(pos=0;pos<size;pos++){if(size==12)temp=asc2_1206[num][pos];//调用1206字体else temp=asc2_1608[num][pos]; //调用1608字体for(t=0;t<size/2;t++){ if(temp&0x01)LCD_WR_DATA(fc); else LCD_WR_DATA(bc); temp>>=1; }} }else//叠加方式{for(pos=0;pos<size;pos++){if(size==12)temp=asc2_1206[num][pos];//调用1206字体else temp=asc2_1608[num][pos]; //调用1608字体for(t=0;t<size/2;t++){ POINT_COLOR=fc; if(temp&0x01)LCD_DrawPoint(x+t,y+pos);//画一个点 temp>>=1; }}}POINT_COLOR=colortemp; LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口为全屏
} //******************************************************************
//功能: 显示单个英文字符
//输入参数:(x,y):字符显示位置起始坐标
// fc:前置画笔颜色
// bc:背景颜色
// num:数值(0-94)
// size:字体大小
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void LCD_ShowNum2412(u16 x,u16 y,u16 fc, u16 bc,u8 *p ,u8 size,u8 mode)
{ u16 temp;u8 pos,t;u16 colortemp=POINT_COLOR; u16 x0=x;u16 y0=y; u8 num=0;while((*p<='~')&&(*p>=' '))//判断是不是非法字符!{ if(x>(lcddev.width-1)||y>(lcddev.height-1)) return; num=*p;if(':'==num) //特殊字符":"num=10; else if('.'==num)//特殊字符"."num=11; else //纯数字 num=num-'0'; x0=x;for(pos=0;pos<48;pos++){temp=asc2_2412[num][pos];for(t=0;t<8;t++){ POINT_COLOR=fc; if(temp&0x80)LCD_DrawPoint(x,y);//画一个点 //else LCD_WR_DATA_16Bit(bc); temp<<=1; x++;if((x-x0)==12){x=x0;y++;break;}}}if(num<10)x+=16; //人为控制字距,使得排版更好看,原值为12elsex+=8; //人为控制字距,使得排版更好看,原值为12y=y0;p++;} POINT_COLOR=colortemp;
} //******************************************************************
//功能: 显示英文字符串
//输入参数:x,y :起点坐标
// size:字体大小
// *p:字符串起始地址
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void LCD_ShowString(u16 x,u16 y,u8 size,u8 *p,u8 mode)
{ while((*p<='~')&&(*p>=' '))//判断是不是非法字符!{ if(x>(lcddev.width-1)||y>(lcddev.height-1)) return; LCD_ShowChar(x,y,POINT_COLOR,BACK_COLOR,*p,size,mode);x+=size/2;p++;}
} //******************************************************************
//功能: 求m的n次方(gui内部调用)
//输入参数:m:乘数
// n:幂
//返回值: m的n次方
//******************************************************************
u32 mypow(u8 m,u8 n)
{u32 result=1; while(n--)result*=m; return result;
}//******************************************************************
//功能: 显示单个数字变量值
//输入参数:x,y :起点坐标
// len :指定显示数字的位数
// size:字体大小(12,16)
// color:颜色
// num:数值(0~4294967295)
//******************************************************************
void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len,u8 size)
{ u8 t,temp;u8 enshow=0; for(t=0;t<len;t++){temp=(num/mypow(10,len-t-1))%10;if(enshow==0&&t<(len-1)){if(temp==0){LCD_ShowChar(x+(size/2)*t,y,POINT_COLOR,BACK_COLOR,' ',size,1);continue;}else enshow=1; }LCD_ShowChar(x+(size/2)*t,y,POINT_COLOR,BACK_COLOR,temp+'0',size,1); }
} //******************************************************************
//功能: 显示单个16X16中文字体
//输入参数:x,y :起点坐标
// fc:前置画笔颜色
// bc:背景颜色
// s:字符串地址
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void GUI_DrawFont16(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode)
{u8 i,j;u16 k;u16 HZnum;u16 x0=x;HZnum=sizeof(tfont16)/sizeof(typFNT_GB16); //自动统计汉字数目for (k=0;k<HZnum;k++) {if ((tfont16[k].Index[0]==*(s))&&(tfont16[k].Index[1]==*(s+1))){ LCD_SetWindows(x,y,x+16-1,y+16-1);for(i=0;i<16*2;i++){for(j=0;j<8;j++){ if(!mode) //非叠加方式{if(tfont16[k].Msk[i]&(0x80>>j)) LCD_WR_DATA_16Bit(fc);else LCD_WR_DATA_16Bit(bc);}else{POINT_COLOR=fc;if(tfont16[k].Msk[i]&(0x80>>j)) LCD_DrawPoint(x,y);//画一个点x++;if((x-x0)==16){x=x0;y++;break;}}}}} continue; //查找到对应点阵字库立即退出,防止多个汉字重复取模带来影响}LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口为全屏
} //******************************************************************
//功能: 显示单个24X24中文字体
//输入参数:x,y :起点坐标
// fc:前置画笔颜色
// bc:背景颜色
// s:字符串地址
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void GUI_DrawFont24(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode)
{u8 i,j;u16 k;u16 HZnum;u16 x0=x;HZnum=sizeof(tfont24)/sizeof(typFNT_GB24); //自动统计汉字数目for (k=0;k<HZnum;k++) {if ((tfont24[k].Index[0]==*(s))&&(tfont24[k].Index[1]==*(s+1))){ LCD_SetWindows(x,y,x+24-1,y+24-1);for(i=0;i<24*3;i++){for(j=0;j<8;j++){if(!mode) //非叠加方式{if(tfont24[k].Msk[i]&(0x80>>j)) LCD_WR_DATA_16Bit(fc);else LCD_WR_DATA_16Bit(bc);}else{POINT_COLOR=fc;if(tfont24[k].Msk[i]&(0x80>>j)) LCD_DrawPoint(x,y);//画一个点x++;if((x-x0)==24){x=x0;y++;break;}}}}} continue; //查找到对应点阵字库立即退出,防止多个汉字重复取模带来影响}LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口为全屏
}//******************************************************************
//功能: 显示单个32X32中文字体
//输入参数:x,y :起点坐标
// fc:前置画笔颜色
// bc:背景颜色
// s:字符串地址
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void GUI_DrawFont32(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode)
{u8 i,j;u16 k;u16 HZnum;u16 x0=x;HZnum=sizeof(tfont32)/sizeof(typFNT_GB32); //自动统计汉字数目for (k=0;k<HZnum;k++) {if ((tfont32[k].Index[0]==*(s))&&(tfont32[k].Index[1]==*(s+1))){ LCD_SetWindows(x,y,x+32-1,y+32-1);for(i=0;i<32*4;i++){for(j=0;j<8;j++){if(!mode) //非叠加方式{if(tfont32[k].Msk[i]&(0x80>>j)) LCD_WR_DATA_16Bit(fc);else LCD_WR_DATA_16Bit(bc);}else{POINT_COLOR=fc;if(tfont32[k].Msk[i]&(0x80>>j)) LCD_DrawPoint(x,y);//画一个点x++;if((x-x0)==32){x=x0;y++;break;}}}}} continue; //查找到对应点阵字库立即退出,防止多个汉字重复取模带来影响}LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口为全屏
} //******************************************************************
//功能: 显示一个字符串,包含中英文显示
//输入参数:x,y :起点坐标
// fc:前置画笔颜色
// bc:背景颜色
// str :字符串
// size:字体大小
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void Show_Str(u16 x, u16 y, u16 fc, u16 bc, u8 *str,u8 size,u8 mode)
{ u16 x0=x; u8 bHz=0; //字符或者中文 while(*str!=0)//数据未结束{ if(!bHz){if(x>(lcddev.width-size/2)||y>(lcddev.height-size)) return; if(*str>0x80)bHz=1;//中文 else //字符{ if(*str==0x0D)//换行符号{ y+=size;x=x0;str++; } else{if(size==12||size==16){ LCD_ShowChar(x,y,fc,bc,*str,size,mode);x+=size/2; //字符,为全字的一半 }else//字库中没有集成16X32的英文字体,用8X16代替{LCD_ShowChar(x,y,fc,bc,*str,16,mode);x+=8; //字符,为全字的一半 }} str++; }}else//中文 { if(x>(lcddev.width-size)||y>(lcddev.height-size)) return; bHz=0;//有汉字库 if(size==32)GUI_DrawFont32(x,y,fc,bc,str,mode); else if(size==24)GUI_DrawFont24(x,y,fc,bc,str,mode); elseGUI_DrawFont16(x,y,fc,bc,str,mode);str+=2; x+=size;//下一个汉字偏移 } }
}//******************************************************************
//功能: 居中显示一个字符串,包含中英文显示
//输入参数:x,y :起点坐标
// fc:前置画笔颜色
// bc:背景颜色
// str :字符串
// size:字体大小
// mode:模式 0,填充模式;1,叠加模式
//******************************************************************
void Gui_StrCenter(u16 x, u16 y, u16 fc, u16 bc, u8 *str,u8 size,u8 mode)
{u16 len=strlen((const char *)str);u16 x1=(lcddev.width-len*8)/2;Show_Str(x+x1,y,fc,bc,str,size,mode);
} //******************************************************************
//功能: 显示一副16位BMP图像
//输入参数:x,y :起点坐标
// *p :图像数组起始地址
//******************************************************************
void Gui_Drawbmp16(u16 x,u16 y,const unsigned char *p) //显示40*40 QQ图片
{int i; unsigned char picH,picL; LCD_SetWindows(x,y,x+40-1,y+40-1);//窗口设置for(i=0;i<40*40;i++){ picL=*(p+i*2); //数据低位在前picH=*(p+i*2+1); LCD_WR_DATA_16Bit(picH<<8|picL); } LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复显示窗口为全屏 }
gui.h
#ifndef __GUI_H__
#define __GUI_H__void GUI_DrawPoint(u16 x,u16 y,u16 color);
void LCD_Fill(u16 sx,u16 sy,u16 ex,u16 ey,u16 color);
void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2);
void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2);
void Draw_Circle(u16 x0,u16 y0,u16 fc,u8 r);
void LCD_ShowChar(u16 x,u16 y,u16 fc, u16 bc, u8 num,u8 size,u8 mode);
void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len,u8 size);
void LCD_Show2Num(u16 x,u16 y,u16 num,u8 len,u8 size,u8 mode);
void LCD_ShowString(u16 x,u16 y,u8 size,u8 *p,u8 mode);
void GUI_DrawFont16(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode);
void GUI_DrawFont24(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode);
void GUI_DrawFont32(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode);
void Show_Str(u16 x, u16 y, u16 fc, u16 bc, u8 *str,u8 size,u8 mode);
void Gui_Drawbmp16(u16 x,u16 y,const unsigned char *p); //显示40*40 QQ图片
void gui_circle(int xc, int yc,u16 c,int r, int fill);
void Gui_StrCenter(u16 x, u16 y, u16 fc, u16 bc, u8 *str,u8 size,u8 mode);
void LCD_DrawFillRectangle(u16 x1, u16 y1, u16 x2, u16 y2);
void LCD_ShowNum2412(u16 x,u16 y,u16 fc, u16 bc,u8 *p ,u8 size,u8 mode);
#endif
font.h
#ifndef __FONT_H
#define __FONT_H
//常用ASCII表
//偏移量32
//ASCII字符集
//偏移量32
//大小:12*6
const unsigned char asc2_1206[95][12]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x00,0x04,0x00,0x00},/*"!",1*/
{0x00,0x14,0x0A,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/
{0x00,0x00,0x14,0x14,0x3F,0x14,0x0A,0x3F,0x0A,0x0A,0x00,0x00},/*"#",3*/
{0x00,0x04,0x1E,0x15,0x05,0x06,0x0C,0x14,0x15,0x0F,0x04,0x00},/*"$",4*/
{0x00,0x00,0x12,0x15,0x0D,0x0A,0x14,0x2C,0x2A,0x12,0x00,0x00},/*"%",5*/
{0x00,0x00,0x04,0x0A,0x0A,0x1E,0x15,0x15,0x09,0x36,0x00,0x00},/*"&",6*/
{0x00,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0x00},/*"(",8*/
{0x00,0x02,0x04,0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x02,0x00},/*")",9*/
{0x00,0x00,0x00,0x04,0x15,0x0E,0x0E,0x15,0x04,0x00,0x00,0x00},/*"*",10*/
{0x00,0x00,0x04,0x04,0x04,0x1F,0x04,0x04,0x04,0x00,0x00,0x00},/*"+",11*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01},/*",",12*/
{0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00},/*".",14*/
{0x00,0x10,0x08,0x08,0x08,0x04,0x04,0x02,0x02,0x02,0x01,0x00},/*"/",15*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00,0x00},/*"0",16*/
{0x00,0x00,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x11,0x11,0x08,0x04,0x02,0x01,0x1F,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0E,0x11,0x10,0x0C,0x10,0x10,0x11,0x0E,0x00,0x00},/*"3",19*/
{0x00,0x00,0x08,0x0C,0x0A,0x0A,0x09,0x1E,0x08,0x18,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x01,0x01,0x0F,0x10,0x10,0x11,0x0E,0x00,0x00},/*"5",21*/
{0x00,0x00,0x0E,0x09,0x01,0x0F,0x11,0x11,0x11,0x0E,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1F,0x09,0x08,0x04,0x04,0x04,0x04,0x04,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x11,0x11,0x0E,0x11,0x11,0x11,0x0E,0x00,0x00},/*"8",24*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x1E,0x10,0x12,0x0E,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x04,0x00},/*";",27*/
{0x00,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x00,0x00},/*"<",28*/
{0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x1F,0x00,0x00,0x00,0x00},/*"=",29*/
{0x00,0x02,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x02,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x11,0x11,0x08,0x04,0x04,0x00,0x04,0x00,0x00},/*"?",31*/
{0x00,0x00,0x0E,0x11,0x19,0x15,0x15,0x1D,0x01,0x1E,0x00,0x00},/*"@",32*/
{0x00,0x00,0x04,0x04,0x0C,0x0A,0x0A,0x1E,0x12,0x33,0x00,0x00},/*"A",33*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x12,0x12,0x12,0x0F,0x00,0x00},/*"B",34*/
{0x00,0x00,0x1E,0x11,0x01,0x01,0x01,0x01,0x11,0x0E,0x00,0x00},/*"C",35*/
{0x00,0x00,0x0F,0x12,0x12,0x12,0x12,0x12,0x12,0x0F,0x00,0x00},/*"D",36*/
{0x00,0x00,0x1F,0x12,0x0A,0x0E,0x0A,0x02,0x12,0x1F,0x00,0x00},/*"E",37*/
{0x00,0x00,0x1F,0x12,0x0A,0x0E,0x0A,0x02,0x02,0x07,0x00,0x00},/*"F",38*/
{0x00,0x00,0x1C,0x12,0x01,0x01,0x39,0x11,0x12,0x0C,0x00,0x00},/*"G",39*/
{0x00,0x00,0x33,0x12,0x12,0x1E,0x12,0x12,0x12,0x33,0x00,0x00},/*"H",40*/
{0x00,0x00,0x1F,0x04,0x04,0x04,0x04,0x04,0x04,0x1F,0x00,0x00},/*"I",41*/
{0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x09,0x07,0x00},/*"J",42*/
{0x00,0x00,0x37,0x12,0x0A,0x06,0x0A,0x0A,0x12,0x37,0x00,0x00},/*"K",43*/
{0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x02,0x22,0x3F,0x00,0x00},/*"L",44*/
{0x00,0x00,0x1B,0x1B,0x1B,0x1B,0x15,0x15,0x15,0x15,0x00,0x00},/*"M",45*/
{0x00,0x00,0x3B,0x12,0x16,0x16,0x1A,0x1A,0x12,0x17,0x00,0x00},/*"N",46*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00,0x00},/*"O",47*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x02,0x02,0x02,0x07,0x00,0x00},/*"P",48*/
{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x17,0x19,0x0E,0x18,0x00},/*"Q",49*/
{0x00,0x00,0x0F,0x12,0x12,0x0E,0x0A,0x12,0x12,0x37,0x00,0x00},/*"R",50*/
{0x00,0x00,0x1E,0x11,0x01,0x06,0x08,0x10,0x11,0x0F,0x00,0x00},/*"S",51*/
{0x00,0x00,0x1F,0x15,0x04,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"T",52*/
{0x00,0x00,0x33,0x12,0x12,0x12,0x12,0x12,0x12,0x0C,0x00,0x00},/*"U",53*/
{0x00,0x00,0x33,0x12,0x12,0x0A,0x0A,0x0C,0x04,0x04,0x00,0x00},/*"V",54*/
{0x00,0x00,0x15,0x15,0x15,0x0E,0x0A,0x0A,0x0A,0x0A,0x00,0x00},/*"W",55*/
{0x00,0x00,0x1B,0x0A,0x0A,0x04,0x04,0x0A,0x0A,0x1B,0x00,0x00},/*"X",56*/
{0x00,0x00,0x1B,0x0A,0x0A,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"Y",57*/
{0x00,0x00,0x1F,0x09,0x08,0x04,0x04,0x02,0x12,0x1F,0x00,0x00},/*"Z",58*/
{0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x1C,0x00},/*"[",59*/
{0x00,0x02,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x10,0x00,0x00},/*"\",60*/
{0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x0E,0x00},/*"]",61*/
{0x00,0x04,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F},/*"_",63*/
{0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x1C,0x12,0x3C,0x00,0x00},/*"a",65*/
{0x00,0x00,0x03,0x02,0x02,0x0E,0x12,0x12,0x12,0x0E,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x00,0x00,0x1C,0x12,0x02,0x02,0x1C,0x00,0x00},/*"c",67*/
{0x00,0x00,0x18,0x10,0x10,0x1C,0x12,0x12,0x12,0x3C,0x00,0x00},/*"d",68*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x1E,0x02,0x1C,0x00,0x00},/*"e",69*/
{0x00,0x00,0x38,0x04,0x04,0x1E,0x04,0x04,0x04,0x1E,0x00,0x00},/*"f",70*/
{0x00,0x00,0x00,0x00,0x00,0x3C,0x12,0x0C,0x02,0x1E,0x22,0x1C},/*"g",71*/
{0x00,0x00,0x03,0x02,0x02,0x0E,0x12,0x12,0x12,0x37,0x00,0x00},/*"h",72*/
{0x00,0x00,0x04,0x00,0x00,0x06,0x04,0x04,0x04,0x0E,0x00,0x00},/*"i",73*/
{0x00,0x00,0x08,0x00,0x00,0x0C,0x08,0x08,0x08,0x08,0x08,0x07},/*"j",74*/
{0x00,0x00,0x03,0x02,0x02,0x3A,0x0A,0x0E,0x12,0x37,0x00,0x00},/*"k",75*/
{0x00,0x00,0x07,0x04,0x04,0x04,0x04,0x04,0x04,0x1F,0x00,0x00},/*"l",76*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x15,0x15,0x15,0x15,0x00,0x00},/*"m",77*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x12,0x12,0x12,0x37,0x00,0x00},/*"n",78*/
{0x00,0x00,0x00,0x00,0x00,0x0C,0x12,0x12,0x12,0x0C,0x00,0x00},/*"o",79*/
{0x00,0x00,0x00,0x00,0x00,0x0F,0x12,0x12,0x12,0x0E,0x02,0x07},/*"p",80*/
{0x00,0x00,0x00,0x00,0x00,0x1C,0x12,0x12,0x12,0x1C,0x10,0x38},/*"q",81*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x06,0x02,0x02,0x07,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0x00,0x00,0x1E,0x02,0x0C,0x10,0x1E,0x00,0x00},/*"s",83*/
{0x00,0x00,0x00,0x04,0x04,0x0E,0x04,0x04,0x04,0x18,0x00,0x00},/*"t",84*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x12,0x12,0x12,0x3C,0x00,0x00},/*"u",85*/
{0x00,0x00,0x00,0x00,0x00,0x37,0x12,0x0A,0x0C,0x04,0x00,0x00},/*"v",86*/
{0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x0E,0x0A,0x0A,0x00,0x00},/*"w",87*/
{0x00,0x00,0x00,0x00,0x00,0x1B,0x0A,0x04,0x0A,0x1B,0x00,0x00},/*"x",88*/
{0x00,0x00,0x00,0x00,0x00,0x37,0x12,0x0A,0x0C,0x04,0x04,0x03},/*"y",89*/
{0x00,0x00,0x00,0x00,0x00,0x1E,0x08,0x04,0x04,0x1E,0x00,0x00},/*"z",90*/
{0x00,0x18,0x08,0x08,0x08,0x04,0x08,0x08,0x08,0x08,0x18,0x00},/*"{",91*/
{0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},/*"|",92*/
{0x00,0x06,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x06,0x00},/*"}",93*/
{0x02,0x25,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} /*"~",94*/
};
const unsigned char asc2_1608[95][16]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x18,0x18,0x00,0x00},/*"!",1*/
{0x00,0x48,0x6C,0x24,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/
{0x00,0x00,0x00,0x24,0x24,0x24,0x7F,0x12,0x12,0x12,0x7F,0x12,0x12,0x12,0x00,0x00},/*"#",3*/
{0x00,0x00,0x08,0x1C,0x2A,0x2A,0x0A,0x0C,0x18,0x28,0x28,0x2A,0x2A,0x1C,0x08,0x08},/*"$",4*/
{0x00,0x00,0x00,0x22,0x25,0x15,0x15,0x15,0x2A,0x58,0x54,0x54,0x54,0x22,0x00,0x00},/*"%",5*/
{0x00,0x00,0x00,0x0C,0x12,0x12,0x12,0x0A,0x76,0x25,0x29,0x11,0x91,0x6E,0x00,0x00},/*"&",6*/
{0x00,0x06,0x06,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00},/*"(",8*/
{0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00},/*")",9*/
{0x00,0x00,0x00,0x00,0x08,0x08,0x6B,0x1C,0x1C,0x6B,0x08,0x08,0x00,0x00,0x00,0x00},/*"*",10*/
{0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x7F,0x08,0x08,0x08,0x08,0x00,0x00,0x00},/*"+",11*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x04,0x03},/*",",12*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x00},/*".",14*/
{0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x00},/*"/",15*/
{0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"0",16*/
{0x00,0x00,0x00,0x08,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"1",17*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x20,0x20,0x10,0x08,0x04,0x42,0x7E,0x00,0x00},/*"2",18*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x20,0x40,0x40,0x42,0x22,0x1C,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0x20,0x30,0x28,0x24,0x24,0x22,0x22,0x7E,0x20,0x20,0x78,0x00,0x00},/*"4",20*/
{0x00,0x00,0x00,0x7E,0x02,0x02,0x02,0x1A,0x26,0x40,0x40,0x42,0x22,0x1C,0x00,0x00},/*"5",21*/
{0x00,0x00,0x00,0x38,0x24,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"6",22*/
{0x00,0x00,0x00,0x7E,0x22,0x22,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00},/*"7",23*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00},/*"8",24*/
{0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x64,0x58,0x40,0x40,0x24,0x1C,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x04},/*";",27*/
{0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00},/*"<",28*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00},/*"=",29*/
{0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00},/*">",30*/
{0x00,0x00,0x00,0x3C,0x42,0x42,0x46,0x40,0x20,0x10,0x10,0x00,0x18,0x18,0x00,0x00},/*"?",31*/
{0x00,0x00,0x00,0x1C,0x22,0x5A,0x55,0x55,0x55,0x55,0x2D,0x42,0x22,0x1C,0x00,0x00},/*"@",32*/
{0x00,0x00,0x00,0x08,0x08,0x18,0x14,0x14,0x24,0x3C,0x22,0x42,0x42,0xE7,0x00,0x00},/*"A",33*/
{0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x1E,0x22,0x42,0x42,0x42,0x22,0x1F,0x00,0x00},/*"B",34*/
{0x00,0x00,0x00,0x7C,0x42,0x42,0x01,0x01,0x01,0x01,0x01,0x42,0x22,0x1C,0x00,0x00},/*"C",35*/
{0x00,0x00,0x00,0x1F,0x22,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1F,0x00,0x00},/*"D",36*/
{0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x42,0x42,0x3F,0x00,0x00},/*"E",37*/
{0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x02,0x02,0x07,0x00,0x00},/*"F",38*/
{0x00,0x00,0x00,0x3C,0x22,0x22,0x01,0x01,0x01,0x71,0x21,0x22,0x22,0x1C,0x00,0x00},/*"G",39*/
{0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"H",40*/
{0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"I",41*/
{0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x0F},/*"J",42*/
{0x00,0x00,0x00,0x77,0x22,0x12,0x0A,0x0E,0x0A,0x12,0x12,0x22,0x22,0x77,0x00,0x00},/*"K",43*/
{0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x7F,0x00,0x00},/*"L",44*/
{0x00,0x00,0x00,0x77,0x36,0x36,0x36,0x36,0x2A,0x2A,0x2A,0x2A,0x2A,0x6B,0x00,0x00},/*"M",45*/
{0x00,0x00,0x00,0xE3,0x46,0x46,0x4A,0x4A,0x52,0x52,0x52,0x62,0x62,0x47,0x00,0x00},/*"N",46*/
{0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x1C,0x00,0x00},/*"O",47*/
{0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x42,0x3E,0x02,0x02,0x02,0x02,0x07,0x00,0x00},/*"P",48*/
{0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x4D,0x53,0x32,0x1C,0x60,0x00},/*"Q",49*/
{0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x3E,0x12,0x12,0x22,0x22,0x42,0xC7,0x00,0x00},/*"R",50*/
{0x00,0x00,0x00,0x7C,0x42,0x42,0x02,0x04,0x18,0x20,0x40,0x42,0x42,0x3E,0x00,0x00},/*"S",51*/
{0x00,0x00,0x00,0x7F,0x49,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00},/*"T",52*/
{0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"U",53*/
{0x00,0x00,0x00,0xE7,0x42,0x42,0x22,0x24,0x24,0x14,0x14,0x18,0x08,0x08,0x00,0x00},/*"V",54*/
{0x00,0x00,0x00,0x6B,0x49,0x49,0x49,0x49,0x55,0x55,0x36,0x22,0x22,0x22,0x00,0x00},/*"W",55*/
{0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00},/*"X",56*/
{0x00,0x00,0x00,0x77,0x22,0x22,0x14,0x14,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00},/*"Y",57*/
{0x00,0x00,0x00,0x7E,0x21,0x20,0x10,0x10,0x08,0x04,0x04,0x42,0x42,0x3F,0x00,0x00},/*"Z",58*/
{0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00},/*"[",59*/
{0x00,0x00,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x40},/*"\",60*/
{0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00},/*"]",61*/
{0x00,0x38,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},/*"_",63*/
{0x00,0x06,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x78,0x44,0x42,0x42,0xFC,0x00,0x00},/*"a",65*/
{0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x26,0x1A,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x02,0x02,0x02,0x44,0x38,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x60,0x40,0x40,0x40,0x78,0x44,0x42,0x42,0x42,0x64,0xD8,0x00,0x00},/*"d",68*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x02,0x02,0x42,0x3C,0x00,0x00},/*"e",69*/
{0x00,0x00,0x00,0xF0,0x88,0x08,0x08,0x7E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"f",70*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x22,0x22,0x1C,0x02,0x3C,0x42,0x42,0x3C},/*"g",71*/
{0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x3A,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"h",72*/
{0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x1E},/*"j",74*/
{0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x72,0x12,0x0A,0x16,0x12,0x22,0x77,0x00,0x00},/*"k",75*/
{0x00,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00},/*"l",76*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x92,0x92,0x92,0x92,0x92,0xB7,0x00,0x00},/*"m",77*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"n",78*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"o",79*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x26,0x42,0x42,0x42,0x22,0x1E,0x02,0x07},/*"p",80*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x44,0x78,0x40,0xE0},/*"q",81*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x4C,0x04,0x04,0x04,0x04,0x1F,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x02,0x3C,0x40,0x42,0x3E,0x00,0x00},/*"s",83*/
{0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x3E,0x08,0x08,0x08,0x08,0x08,0x30,0x00,0x00},/*"t",84*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x42,0x42,0x42,0x42,0x62,0xDC,0x00,0x00},/*"u",85*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x08,0x08,0x00,0x00},/*"v",86*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEB,0x49,0x49,0x55,0x55,0x22,0x22,0x00,0x00},/*"w",87*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x24,0x18,0x18,0x18,0x24,0x6E,0x00,0x00},/*"x",88*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x18,0x08,0x08,0x07},/*"y",89*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x22,0x10,0x08,0x08,0x44,0x7E,0x00,0x00},/*"z",90*/
{0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0xC0,0x00},/*"{",91*/
{0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},/*"|",92*/
{0x00,0x06,0x08,0x08,0x08,0x08,0x08,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x06,0x00},/*"}",93*/
{0x0C,0x32,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/
};
const unsigned char asc2_2412[12][48]={
#if 1
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x1F,0xC0,0x6F,0xD0,0x77,0xB0,0x70,0x30,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x20,0x10,0x70,0x30,0x70,0x30,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x67,0xD0,0x6F,0xE0,0x1F,0xE0,0x1F,0xE0},/*"0",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x78,0x00,0x36,0x00,0x2E,0x00,0x0E,0x00,
0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x0E,0x00,
0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x04,0x00},/*"1",1*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x7F,0xE0,0x7F,0xE0,0x3F,0xD0,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x1F,0xD0,0x1F,0xE0,0x2F,0xE0,0x77,0xE0,
0x70,0x00,0x70,0x00,0x70,0x00,0x60,0x00,0x6F,0xF0,0x5F,0xF0,0x3F,0xF0,0x3F,0xF0},/*"2",2*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x7F,0xF0,0x7F,0xE0,0x3F,0xD0,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x3F,0xB0,0x7F,0xD0,0x7F,0xD0,0x3F,0xB0,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x3F,0xD0,0x7F,0xE0,0x7F,0xF0,0x3F,0xF0},/*"3",3*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x10,0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x37,0xB0,0x0F,0xD0,0x0F,0xD0,0x07,0xB0,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x10},/*"4",4*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x5F,0xF0,0x6F,0xF0,0x77,0xF0,0x70,0x00,
0x70,0x00,0x70,0x00,0x70,0x00,0x3F,0x80,0x1F,0xC0,0x1F,0xC0,0x0F,0xB0,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x3F,0xD0,0x7F,0xD0,0x7F,0xE0,0x3F,0xE0},/*"5",5*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x1F,0xF0,0x6F,0xF0,0x77,0xF0,0x70,0x00,
0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x77,0xC0,0x2F,0xC0,0x6F,0xD0,0x77,0xB0,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x67,0xD0,0x6F,0xE0,0x1F,0xE0,0x1F,0xE0},/*"6",6*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x7F,0xE0,0x7F,0xD0,0x3F,0x90,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x10,0x00,0x10,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x10},/*"7",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x1F,0xC0,0x6F,0xD0,0x77,0xB0,0x70,0x30,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x77,0xB0,0x2F,0xD0,0x6F,0xF0,0x77,0xB0,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x67,0xD0,0x6F,0xE0,0x1F,0xE0,0x1F,0xC0},/*"8",8*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x1F,0xC0,0x6F,0xD0,0x77,0xB0,0x70,0x30,
0x70,0x30,0x70,0x30,0x70,0x30,0x70,0x30,0x6F,0xB0,0x0F,0xD0,0x0F,0xF0,0x0F,0xB0,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x3F,0xD0,0x7F,0xE0,0x7F,0xE0,0x3F,0xC0},/*"9",9*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x60,0x00,0x60,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x20,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*":",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3C,0x00,0x3C,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",0*/
#endif
};typedef struct
{unsigned char Index[2]; char Msk[32];
}typFNT_GB16;
//字体取模:宋体常规小四
const typFNT_GB16 tfont16[]=
{
"系",0x00,0x00,0x00,0x0C,0x3F,0xF8,0x03,0x00,0x06,0x38,0x0C,0x70,0x1F,0xC0,0x03,0x8C,
0x0E,0x0C,0x3F,0xFE,0x0D,0xB6,0x0D,0x98,0x19,0x9C,0x31,0x8C,0x31,0x86,0x67,0x86,/*0*/
"统",0x00,0x00,0x00,0x00,0x18,0x30,0x1B,0xFF,0x30,0x60,0x36,0xCC,0x6C,0xCC,0x7D,0x86,
0x19,0xFE,0x18,0xDB,0x30,0xD8,0x7F,0xD8,0x70,0xDB,0x01,0x9B,0x1F,0x9B,0x77,0x1F,/*1*/
"监",0x00,0x00,0x00,0x00,0x06,0xC0,0x36,0xFF,0x36,0xC0,0x37,0x80,0x37,0xB0,0x37,0x18,
0x06,0x0C,0x00,0x00,0x3F,0xFE,0x36,0x66,0x36,0x66,0x36,0x66,0x36,0x66,0x7F,0xFF,/*2*/
"控",0x00,0x00,0x00,0x00,0x30,0x60,0x30,0x60,0x37,0xFF,0x7E,0xFB,0x37,0x9E,0x33,0x8C,
0x3F,0x06,0x38,0x00,0x31,0xFC,0x70,0x60,0x30,0x60,0x30,0x60,0x30,0x60,0x7F,0xFF,/*3*/
"℃",0xC0,0x00,0x23,0xE8,0x2C,0x18,0xD8,0x08,0x10,0x08,0x30,0x00,0x30,0x00,0x30,0x00,
0x30,0x00,0x30,0x00,0x30,0x00,0x10,0x00,0x18,0x08,0x0C,0x10,0x03,0xE0,0x00,0x00,/*0*/
};
typedef struct
{unsigned char Index[2]; char Msk[72];
}typFNT_GB24;
//字体取模:宋体常规小四
const typFNT_GB24 tfont24[]=
{
"温",0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x0C,0x7F,0xF0,0x04,0x40,0x20,0x04,
0x40,0x20,0x01,0x40,0x20,0x02,0x7F,0xE0,0x62,0x40,0x20,0x32,0x40,0x20,0x12,0x40,
0x20,0x04,0x7F,0xE0,0x04,0x00,0x00,0x05,0x00,0x10,0x04,0xFF,0xF8,0x08,0x89,0x10,
0x78,0x89,0x10,0x18,0x89,0x10,0x18,0x89,0x10,0x18,0x89,0x10,0x18,0x89,0x10,0x18,
0x89,0x16,0x07,0x76,0xE8,0x00,0x00,0x00,/*0*/
"湿",0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x10,0x08,0x7F,0xF8,0x0C,0x60,0x10,0x04,
0x60,0x10,0x01,0x60,0x10,0x42,0x7F,0xF0,0x32,0x60,0x10,0x1A,0x60,0x10,0x12,0x7F,
0xF0,0x04,0x69,0x00,0x04,0x08,0x80,0x05,0x08,0x8C,0x08,0x88,0x8C,0x18,0xC8,0x98,
0x38,0x48,0x90,0x18,0x68,0xA0,0x10,0x48,0xC0,0x10,0x08,0x80,0x30,0x08,0x80,0x10,
0x08,0x8C,0x03,0xF7,0x70,0x00,0x00,0x00,/*1*/
"度",0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x08,0x00,0x00,0x0C,0x08,0x0F,0xFF,0xFC,0x08,
0x40,0x00,0x08,0x30,0xC0,0x08,0x20,0x88,0x08,0x20,0x9C,0x0F,0xFF,0xE0,0x08,0x20,
0x80,0x08,0x20,0x80,0x08,0x3F,0x80,0x08,0x00,0x00,0x19,0xFF,0xE0,0x18,0x20,0xC0,
0x10,0x20,0x80,0x10,0x11,0x80,0x10,0x0B,0x00,0x20,0x06,0x00,0x20,0x1B,0x80,0x40,
0x60,0xFE,0x47,0x80,0x18,0x00,0x00,0x00,/*2*/
"电",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,
0x10,0x00,0x0F,0xFF,0xF0,0x08,0x10,0x20,0x08,0x10,0x20,0x08,0x10,0x20,0x08,0x10,
0x20,0x0F,0xFF,0xE0,0x08,0x10,0x20,0x08,0x10,0x20,0x08,0x10,0x20,0x08,0x10,0x20,
0x0F,0xFF,0xE0,0x08,0x10,0x00,0x00,0x10,0x08,0x00,0x10,0x08,0x00,0x10,0x04,0x00,
0x18,0x0C,0x00,0x0F,0xF8,0x00,0x00,0x00,/*3*/
"压",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0F,0xFF,0xFC,0x0C,0x00,0x00,0x0C,
0x0C,0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x0C,0x0C,
0x00,0x0D,0xFF,0xF0,0x0C,0x0C,0x00,0x0C,0x0C,0x00,0x08,0x0C,0x80,0x08,0x0C,0x40,
0x08,0x0C,0x60,0x08,0x0C,0x30,0x10,0x0C,0x20,0x10,0x0C,0x00,0x20,0x0C,0x0C,0x27,
0xF3,0xF0,0x40,0x00,0x00,0x00,0x00,0x00,/*4*/
"流",0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x06,0x00,0x08,0x02,0x08,0x04,0xFF,0xFC,0x06,
0x04,0x00,0x00,0x04,0x00,0x01,0x08,0x40,0x41,0x10,0x20,0x31,0x20,0x30,0x12,0x7F,
0xD0,0x12,0x00,0x10,0x04,0x64,0x60,0x04,0x64,0x40,0x04,0x64,0x40,0x08,0x64,0x40,
0x78,0x64,0x40,0x18,0x44,0x40,0x18,0x44,0x44,0x18,0xC4,0x44,0x18,0x84,0x44,0x19,
0x04,0x7E,0x06,0x04,0x00,0x00,0x00,0x00,/*5*/
"℃",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x12,0x1F,0x80,0x12,
0x30,0x68,0x12,0x60,0x18,0x0C,0xC0,0x18,0x00,0x80,0x08,0x01,0x80,0x08,0x01,0x80,
0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x00,0x80,0x00,
0x00,0xC0,0x00,0x00,0xC0,0x10,0x00,0x60,0x20,0x00,0x38,0xC0,0x00,0x0F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*,6*/
":",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x0C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*7*/
"%",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x18,0x08,
0x80,0x30,0x08,0x80,0x60,0x08,0x80,0xC0,0x08,0x81,0x80,0x08,0x81,0x00,0x08,0x82,
0x00,0x05,0x04,0x00,0x02,0x08,0x00,0x00,0x11,0xE0,0x00,0x21,0x10,0x00,0x41,0x10,
0x00,0x83,0x10,0x01,0x03,0x10,0x02,0x01,0x10,0x04,0x01,0x10,0x08,0x00,0xE0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*0*/
"V",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC1,0xF0,0x03,
0x00,0x40,0x03,0x00,0x40,0x01,0x00,0x80,0x01,0x80,0x80,0x01,0x81,0x00,0x00,0xC1,
0x00,0x00,0xC3,0x00,0x00,0x62,0x00,0x00,0x62,0x00,0x00,0x24,0x00,0x00,0x34,0x00,
0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*0*/
"A",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x00,0x00,0x18,0x00,0x00,0x1C,0x00,0x00,0x2C,0x00,0x00,0x24,0x00,0x00,0x66,
0x00,0x00,0x46,0x00,0x00,0xC3,0x00,0x00,0x83,0x00,0x00,0xFF,0x00,0x01,0x01,0x80,
0x01,0x01,0x80,0x02,0x00,0xC0,0x02,0x00,0xC0,0x0F,0x83,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*1*/
};
typedef struct
{unsigned char Index[2]; char Msk[128];
}typFNT_GB32;
//字体取模:宋体常规小四
const typFNT_GB32 tfont32[]=
{
"字",0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0xC0,0x00,
0x00,0x01,0xC0,0xC0,0x00,0x01,0x07,0xC0,0x00,0x01,0xFF,0x00,0x02,0x1F,0xFE,0x00,
0x07,0xF0,0x1C,0x00,0x07,0xC0,0x70,0x00,0x0F,0x00,0xE0,0x00,0x0E,0x03,0xF0,0x00,
0x1C,0x0F,0xF0,0x00,0x3C,0x0F,0x70,0x00,0x3C,0x00,0xE0,0x00,0x18,0x00,0xC0,0x00,
0x00,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x20,0x00,
0x00,0x00,0x37,0x00,0x00,0x01,0xFF,0x00,0x00,0x7F,0xF8,0x00,0x07,0xF8,0x30,0x00,
0x1F,0x80,0x30,0x00,0x00,0x80,0x30,0x00,0x00,0xC0,0x30,0x00,0x00,0x60,0x60,0x00,
0x00,0x18,0xE0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,/*0*/
};
#endif
这篇关于stm32驱动1.44寸LCD屏幕显示中文字符包含可移植keil5工程代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!