***AD多通道DMA采集 与多路LCD 的示波制作 **
本文展示了STM32 AD 多路采集的 LCD 波形 显示 :
内容涉及 :
内容涉及对AD多通道DMA采集与存储调用
AD采样点的构造体封装
AD 的处理以及 LCD波形输出 模仿示波器的原理
LCD触摸画板的控制
SRAM 内存扩展管理
FatFs 文件系统移植
SPI函数移植过程
SPI字节数据模拟输出独写 缓存读写
USART串口的识别
IO口输入输出
按键的外部中断处理
32位数据通讯,字符串通讯,单字符通讯
完整代码 : 源代码代码
stm32多通道AD采集与蓝牙显示
stm32蓝牙传输多通道ad示波器独立模式
蓝牙传输部分:
我在淘宝购买了 蓝牙从机HC06
根据PC端 串口分别对两个模块进行设置,
AT+VERSION? //查看版本信息
AT+ORGL //恢复默认状态
AT+ADDR? //查看蓝牙地址
AT+PSWD? //查看配对码
AT+UART? //查看串口参数
其中一块:发送AT+ROLE=M//设置为主//返回OK+ROLE:M//
另一块:发送AT+ROLE=S//返回 ok+ROLE:S
设置STM32 为主机 从机为PC端口,并用手机进行验证,下图为手机端口对送机模式 的调试
完成对于 蓝牙模块的调试,图中主机在STM32 s
文章目录
- 前言
- 一、 编程要点
- 二、使用步骤
- (注意)Keil 配置状态
- 建立主程序 main.c
- 建立ADC采集驱动文件ADC_book.h
- 建立ADC采集程序ADC_book.c
- 建立波形显示的LCD驱动文件XPT2046_LCD_GridDiagram_book.h
- 建立波形显示的LCD程序文件XPT2046_LCD_GridDiagram_book.c
- 建立XPT2046驱动文件XPT2046_LCD_Device_book.h
- 建立XPT2046程序文件XPT2046_LCD_Device_book.c
- 建立XPT2046驱动文件XPT2046_LCD_book.h
- 建立XPT2046驱动文件XPT2046_LCD_book.c
- 建立XPT2046驱动文件XPT2046_LCD_Function_book.h
- 建立XPT2046驱动文件XPT2046_LCD_Function_book.c
- 建立 LCD驱动 管理文件LCD_book.h
- 建立 LCD驱动 管理文件LCD_book.c
- 建立 LCD 绘制函数文件LCD_Draw_book.h
- 建立 LCD 绘制文件LCD_Draw_book.c
- 建立 LCD页面绘制 文件LCD_PageHtml_book.h
- 建立 LCD页面绘制 文件LCD_PageHtml_book.c
- 建立 LCD 文字库 内存管理文件fonts.h
- 建立 LCD 文字库 内存管理文件fonts.c
前言
STM32f103 系列有 3 个 ADC,精度为 12 位,每个 ADC 最多有 16 个外部通道。其中ADC1 和 ADC2 都有 16 个外部通道,ADC3 根据 CPU 引脚的不同通道数也不同,一般都有8 个外部通道。ADC 的模式非常多,功能非常强大,具体的我们在功能框图中分析每个部分的功能。触摸检测的主体是型号为 XPT2046 的芯片,它接收触摸屏的 X+/X-/Y+/Y-信号进行处理,把触摸信息使用 SPI接口输出到 STM32等控制器,注意,由于控制 XPT2046 芯片的并不是 STM32 专用的硬件 SPI 接口,所以在编写程序时,需要使用软件模拟 SPI 时序与触摸芯片进行通讯。
ADC 输入范围为:VREF- ≤ VIN ≤ VREF+。由 VREF-、VREF+ 、VDDA 、VSSA、这四个外部引脚决定。 我们在设计原理图的时候一般把VSSA和VREF-接地,把VREF+和VDDA 接3V3,得到ADC的输入电压范围为:0~3.3V。如果我们想让输入的电压范围变宽,去到可以测试负电压或者更高的正电压,我们可以在外部加一个电压调理电路,把需要转换的电压抬升或者降压到 0~3.3V,这样 ADC 就可以测量了。 输入通道:
我们确定好 ADC 输入电压之后,那么电压怎么输入到 ADC?这里我们引入通道的概念,STM32 的 ADC 多达 18 个通道,其中外部的 16 个通道就是框图中的 ADCx_IN0、ADCx_IN1...ADCx_IN5。这 16 个通道对应着不同的 IO 口,具体是哪一个 IO 口可以从手册查询到。其中ADC1/2/3还有内部通道:ADC1的通道16连接到了芯片内部的温度传感器, Vrefint 连接到了通道 17。ADC2 的模拟通道 16 和 17 连接到了内部的 VSS。ADC3 的模拟通道 9、14、15、16 和 17 连接到了内部的 VSS。
规则通道:顾名思意,规则通道就是很规矩的意思,我们平时一般使用的就是这个通道,或者应该说我们用到的都是这个通道,没有什么特别要注意的可讲。
注入通道
注入,可以理解为插入,插队的意思,是一种不安分的通道。它是一种在规则通道转换的时候强行插入要转换的一种。如果在规则通道转换过程中,有注入通道插队,那么就要先转换完注入通道,等注入通道转换完成后,再回到规则通道的转换流程。这点跟中断程序很像,都是不安分的主。所以,注入通道只有在规则通道存在时才会出现。
转换顺序
规则序列规则序列寄存器有 3 个,分别为 SQR3、SQR2、SQR1。SQR3 控制着规则序列中的第一个到第六个转换,对应的位为:SQ1[4:0]~SQ6[4:0],第一次转换的是位 4:0 SQ1[4:0],如果通道 16 想第一次转换,那么在 SQ1[4:0]写 16 即可。SQR2 控制着规则序列中的第 7 到第12 个转换,对应的位为:SQ7[4:0]~SQ12[4:0],如果通道 1 想第 8 个转换,则 SQ8[4:0]写 1即可。SQR1 控制着规则序列中的第 13 到第 16 个转换,对应位为:SQ13[4:0]~SQ16[4:0],如果通道 6 想第 10 个转换,则 SQ10[4:0]写 6 即可。具体使用多少个通道,由 SQR1 的位 L[3:0]决定,最多 16 个通道
注入序列
注入序列寄存器 JSQR 只有一个,最多支持 4 个通道,具体多少个由 JSQR 的 JL[2:0]决定。如果 JL的 值小于 4 的话,则 JSQR 跟 SQR决定转换顺序的设置不一样,第一次转换的不是 JSQR1[4:0],而是 JCQRx[4:0] ,x = (4-JL),跟 SQR 刚好相反。如果 JL=00(1 个转换),那么转换的顺序是从 JSQR4[4:0]开始,而不是从 JSQR1[4:0]开始,这个要注意,编程的时候不要搞错。当 JL 等于 4 时,跟 SQR 一样。
触发源
通道选好了,转换的顺序也设置好了,那接下来就该开始转换了。ADC 转换可以由ADC 控制寄存器 2: ADC_CR2 的 ADON 这个位来控制,写 1 的时候开始转换,写 0 的时候停止转换,这个是最简单也是最好理解的开启 ADC 转换的控制方式,理解起来没啥技术含量。除了这种庶民式的控制方法,ADC 还支持触发转换,这个触发包括内部定时器触发和外部 IO 触发。触发源有很多,具体选择哪一种触发源,由 ADC 控制寄存器 2:ADC_CR2 的 EXTSEL[2:0]和 JEXTSEL[2:0]位来控制。EXTSEL[2:0]用于选择规则通道的触发源,JEXTSEL[2:0]用于选择注入通道的触发源。选定好触发源之后,触发源是否要激活,则由ADC 控制寄存器 2:ADC_CR2 的 EXTTRIG 和 JEXTTRIG 这两位来激活。其中 ADC3 的规则转换和注入转换的触发源与 ADC1/2 的有所不同,在框图上已经表示出来。
转换时间
ADC转换时间: ─ STM32F103xx增强型产品:时钟为56MHz时为1μs(时钟为72MHz为1.17μs)
─ STM32F101xx基本型产品:时钟为28MHz时为1μs(时钟为36MHz为1.55μs)
─ STM32F102xxUSB型产品:时钟为48MHz时为1.2μs
─ STM32F105xx和STM32F107xx产品:时钟为56MHz时为1μs(时钟为72MHz为1.17μs)
ADC 时钟ADC 输入时钟 ADC_CLK 由 PCLK2 经过分频产生,最大是 14M,分频因子由 RCC 时钟配置寄存器 RCC_CFGR 的位 15:14 DCPRE[1:0]设置,可以是 2/4/6/8 分频,注意这里没有 1 分频。一般我们设置 PCLK2=HCLK=72M。采样时间ADC 使用若干个 ADC_CLK 周期对输入的电压进行采样,采样的周期数可通过 ADC 采样时间寄存器 ADC_SMPR1 和 ADC_SMPR2 中的 SMP[2:0]位设置,ADC_SMPR2 控制的是通道 0~9,ADC_SMPR1 控制的是通道 10~17。每个通道可以分别用不同的时间采样。其 中采样周期最小是 1.5 个,即如果我们要达到最快的采样,那么应该设置采样周期为 1.5 个周期,这里说的周期就是 1/ADC_CLK。
ADC 的转换时间跟 ADC 的输入时钟和采样时间有关,公式为:Tconv = 采样时间 + 12.5 个周期。当 ADCLK = 14MHZ (最高),采样时间设置为 1.5 周期(最快),那么总的转换时间(最短)Tconv = 1.5 周期 + 12.5 周期 = 14 周期 = 1us。一般我们设置 PCLK2=72M,经过 ADC 预分频器能分频到最大的时钟只能是 12M,采样周期设置为 1.5 个周期,算出最短的转换时间为 1.17us,这个才是最常用的。
数据寄存器
一切准备就绪后,ADC 转换后的数据根据转换组的不同,规则组的数据放在 ADC_DR寄存器,注入组的数据放在 JDRx。
规则数据寄存器
ADC 规则组数据寄存器 ADC_DR 只有一个,是一个 32 位的寄存器,低 16 位在单 ADC时使用,高 16 位是在 ADC1 中双模式下保存 ADC2 转换的规则数据,双模式就是 ADC1 和ADC2 同时使用。在单模式下,ADC1/2/3 都不使用高 16 位。因为 ADC 的精度是 12 位,无论 ADC_DR 的高 16 或者低 16 位都放不满,只能左对齐或者右对齐,具体是以哪一种方式 存放,由 ADC_CR2 的 11 位 ALIGN 设置。规则通道可以有 16 个这么多,可规则数据寄存器只有一个,如果使用多通道转换,那转换的数据就全部都挤在了 DR 里面,前一个时间点转换的通道数据,就会被下一个时间点的另外一个通道转换的数据覆盖掉,所以当通道转换完成后就应该把数据取走,或者开启 DMA 模式,把数据传输到内存里面,不然就会造成数据的覆盖。最常用的做法就是开启 DMA 传输。
注入数据寄存器
ADC 注入组最多有 4 个通道,刚好注入数据寄存器也有 4 个,每个通道对应着自己的寄存器,不会跟规则寄存器那样产生数据覆盖的问题。ADC_JDRx 是 32 位的,低 16 位有效,高 16 位保留,数据同样分为左对齐和右对齐,具体是以哪一种方式存放,由ADC_CR2 的 11 位 ALIGN 设置。
一、 编程要点
1) 初始 ADC 用到的 GPIO;2) 设置 ADC 的工作参数并初始化;
3) 设置 ADC 工作时钟;
4) 设置 ADC 转换通道顺序及采样时间;
5) 配置 DMA 工作参数;;
6) 使能 ADC
7) 读取 ADC 采集的数据。
ADC 转换结果数据使用中断方式读取,这里没有使用 DMA 进行数据传输。
ADC 的工作参数具体如下:
打开 ADC 外设时钟;因为只是使用一个 ADC,所有模式配置为独立模式;
多通道采集,开启扫描模式;需要不断的采集外部的模拟数据,所有使能连续转换模式;
不使用外部触发转换信号;
转换结果右对齐;
设置需要转换的通道的个数,最后调用 ADC_Init()函数把这些参数写入 ADC 的寄存器完成配置。
因为是多通道采集,所以调用 ADC_RegularChannelConfig()函数设置每个通道的转换顺序和采样实际。
DMA的工作参数具体如下:
我们是把ADC采集到的数据通过 DMA传输到存储器上, 则外设地址为 ADC 的数据寄存器;
存储器的地址是我们定义的用来存放 ADC 数据的数组 的地址;传输方向为外设到存储器;
缓冲区大小等于等于我们定义的存储 ADC 数据的数组 大小;
所有通道转换的数据都放在一个数据寄存器中,则外设地址不变;采集存储的数据 有多个,则存储器地址递增;
外设和存储器单位均为两个字节;开启循环传输模式;只有 一个 DMA 通道工作,优先级随便设置;
禁用存储器到存储器模式,最后最后调用 DMA_Init()函数把这些参数写入 DMA 的寄存器完成配置。
完成配置之后则使能 ADC 和 DMA,开启软件触发,让 ADC 开始采集数据。
二、使用步骤
(注意)Keil 配置状态
我的博客这里有项目配置 设计;
点击链接
(https://blog.youkuaiyun.com/u012651389/article/details/119189949)
(注意)蓝牙 配置状态
建立主程序 main.c
代码如下 :
/*******************************************************************************
* @file GPIO/JTAG_Remap/main.c
* @author MCD Application Team
* @version V3.5.0
* @date 08-April-2011
* @brief Main program body
******************************************************************************
* @attention
*
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "PROJ_book.h"
//SD卡及flash的根目录
#define SD_ROOT "0:"
#define FLASH_ROOT "1:"
/* 资源在SD卡中的路径 */
#define RESOURCE_DIR "0:/srcdata"
/* 资源烧录到的FLASH基地址(目录地址) */
#define RESOURCE_BASE_ADDR (4096)
/* 存储在FLASH中的资源目录大小 */
#define CATALOG_SIZE (8*1024)
/* 生成的烧录信息文件名 */
#define BURN_INFO_NAME "burn_info.txt"
/* 完整烧录信息文件名*/
#define BURN_INFO_NAME_FULL (RESOURCE_DIR "/" BURN_INFO_NAME)
/* 记录忽略的文件名 */
#define IGNORE_NAME "ignore.txt"
/* 完整忽略文件名*/
#define IGNORE_NAME_FULL (RESOURCE_DIR "/" IGNORE_NAME)
extern char src_dir[];
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program.
* @param None
* @retval None
*/
void delay(int x);
void fn_LED_Flash_Init(void);
void fn_usart_show_Init(void);
void fn_DMA_show_Init(void);
void fn_I2C_EE_Init(void);
void fn_I2C_EE_Soft_Init(void);
void fn_SPI_FLASH_Soft_Init(void);
void fn_FatFs_Document_Init(void);
void fn_SRAM_Init(void);
void fn_LCD_Init(void);
void fn_XPT2046_Init(void);
void fn_Adc_Init(void);
#define countof(a) (sizeof(a) / sizeof(*(a)))
#define _I2C_BufferSize (countof(writeData)-1)
static uint8_t writeData[_I2C_PageSize]={4,5,6,7,8,9,10,11};
static uint8_t writeData2[_I2C_PageSize]={24,25,26,27,28,29,30,31};
static uint8_t ReadData[_I2C_BufferSize]={0};
#define _SPI_BufferSize SPI_PAGE_SIZE //(countof(write_SPI_Data)-1)
static uint8_t write_SPI_Data[_SPI_BufferSize]={0};
static uint8_t Read_SPI_Data[_SPI_BufferSize]={0};
int main(void)
{
int16_t sAD_X, sAD_Y ;
//*************系统接口初始化**************
fn_RCC_Init(); //CPU 倍频
fn_Led_Init(); //LED 输出初始化
fn_Key_Init(); //按键 输入初始化
//*************串口通讯系统初始化**************
fn_USART_Init(); //串口输出初始化
printf("\n\n\r\n********** IC系统开始运行 **********\r\n");
fn_Systick_Delay_Handler_set(10,_Systick_ms);
//*************功能系统初始化*******************
// fn_LED_Flash_Init(); //RGB 输出测试
fn_usart_show_Init(); //串口输出测试
fn_EXTI_GPIO_Config(); //外部中断入口
//*************数据系统初始化**************
// fn_DMA_show_Init(); //初始化DMA数据链路
// fn_I2C_EE_Init(); //初始化硬件I2C数据链路
// fn_I2C_EE_Soft_Init(); //初始化软件I2C数据链路
// Display_Char_test();
fn_LCD_Init();
// fn_SPI_FLASH_Soft_Init(); //SPI测试通讯
// fn_FatFs_Document_Init(); //FatFs文件读取测试
// fn_SRAM_Init(); //SRAM文件读取测试
fn_Adc_Init(); //ADC 采集
//*************LCD系统初始化**************
fn_XPT2046_Init();
fn_Lcd_Page_Init();
fn_Systick_Delay_Handler_set(10,_Systick_ms);
Count_Modle_flag = 3;
while(1){
fn_key_Check();
if(bkey_change == 1){
bkey_change = 0;
switch(Count_Modle_flag){
case 0:
fn_Lcd_Page1();
break;
case 1:
fn_Lcd_Page2();
break;
case 2:
fn_Lcd_Page3();
//触摸检测函数,本函数至少10ms调用一次
break;
case 3:
fn_Lcd_Page4();
//ADC检测函数,本函数至少10ms调用一次
break;
default:
break;
}
}
else{
switch(Count_Modle_flag){
case 0:
break;
case 1:
break;
case 2:
XPT2046_TouchEvenHandler();
break;
case 3:
ADC_get_value();
break;
default:
break;
}
}
}
}
//======================================================================
//======================================================================
void fn_LED_Flash_Init(void){
uint16_t count_Init = 2;
printf("\n ---> LED开始运行 \n");
while(count_Init-->0){
fn_LED_ALL_OFF();
__R_OUT__;
fn_Systick_Delay(500,_Systick_ms);
fn_LED_ALL_OFF();
__G_OUT__;
fn_Systick_Delay(500,_Systick_ms);
fn_LED_ALL_OFF();
__B_OUT__;
fn_Systick_Delay(500,_Systick_ms);
fn_LED_ALL_OFF();
__R_OUT__;
}
}
//======================================================================
//======================================================================
void fn_usart_show_Init(void){
fn_Usart_Send_Byte(_DEBUG_USARTx,'\r');
printf("-->串口通信指测试完毕 \n");
fn_Usart_SendString(_DEBUG_USARTx," : wangqi \n");
}
//======================================================================
//======================================================================
void fn_DMA_show_Init(void){
printf("\n ---> DMA开始运行 \n");
_DMA_ROM_TO_RAM(Map_BUFFER_SIZE ,aSRC_Cont_Buffer , aDST_Buffer);
_DMA_RAM_TO_USART(Map_BUFFER_SIZE ,USART_Source_ADDR , aDST_Buffer);
printf("---> DMA运行完毕 \n");
}
//======================================================================
//======================================================================
void fn_I2C_EE_Init(void){
printf("\n-->I2C_函数写入开始 \n");
_I2C_EE_Init();
I2C_Write_fun(writeData ,EEP_Firstpage ,_I2C_BufferSize);
I2C_Read_fun(ReadData ,EEP_Firstpage ,_I2C_BufferSize);
printf("--->I2C_函数写入完毕\n\r");
}
//======================================================================
//======================================================================
void fn_I2C_EE_Soft_Init(void){
printf("\n-->I2C_软件函数写入开始 \n");
I2C_Soft_Init();
I2C_Soft_Write_fun(writeData2 ,EEP_Firstpage ,_I2C_BufferSize);
I2C_Soft_Read_fun(ReadData ,EEP_Firstpage ,_I2C_BufferSize);
printf("\n--->I2C_软件函数写入完毕\n\r");
}
//======================================================================
//======================================================================
void fn_SPI_FLASH_Soft_Init(void){
uint16_t i,FlashID;
printf("-->SPI通信指测试开始 \n");
SPI_FLASH_Init();
FlashID = SPI_Read_ID() ;
if(FlashID == _SPI_FLASH_ID){
printf("-->SPI 0x%x \n",FlashID);
}
SPI_Erase_Sector(0); //清除一个页的空间
printf("\n\n-->SPI清空开始 \n");
SPI_Read_Data(Read_SPI_Data , 0, SPI_PAGE_SIZE);
SPI_Show_Data(Read_SPI_Data , SPI_PAGE_SIZE);
printf("\n\n-->SPI清空完成 \n");
for(i=0 ; i < _SPI_BufferSize ; i++){
write_SPI_Data[i] = 0xA7;
}
SPI_Show_Data(write_SPI_Data , SPI_PAGE_SIZE);
SPI_BufferWrite_Data(write_SPI_Data ,0x000000,_SPI_BufferSize);
printf("\n\n-->SPI输入完成 \n");
SPI_Read_Data(Read_SPI_Data , 0x000000, _SPI_BufferSize);
SPI_Show_Data(Read_SPI_Data , _SPI_BufferSize);
printf("-->SPI通信指测试完毕 \n");
}
//======================================================================
//======================================================================
void fn_FatFs_Document_Init(void){
/*----------------------- 格式化测试 -----------------*/
FatFs_equipment_flash("1:");
/*----------------------- 文件系统读写测试 -------------------*/
FatFs_document_Text(FileTest_ADDR_Buffer_Document, "Wangqi加油!\n" );
/*----------------------- 文件具体内容识别 -------------------*/
file_check(FileTest_ADDR_Buffer_Document);
/*----------------------- 文件目录更改测试 -------------------*/
FatFs_document_set_content(FileTest_ADDR_Buffer_Document , FileTest_ADDR_Buffer_path , FileTest_ADDR_Buffer_NewDocument2);
/*----------------------- 文件具体内容识别 -------------------*/
file_check(FileTest_ADDR_Buffer_NewDocument2);
/*----------------------- 文件目录查找识别 -------------------*/
Scan_file_Check("1:");
/*----------------------- 完成操作 -------------------*/
FatFs_Close_flash("1:");
}
//======================================================================
//======================================================================
void fn_SRAM_Init(void){ //SRAM文件读取测试
printf("********** SRAM_扩展内存测试 ********** \n");
printf("-->外部SRAM_内存函数初始化开始 \n");
SRAM_Init();
printf("\n-->外部SRAM_内存函数测试开始 \n");
SRAM_Test();
printf("\n-->外部SRAM_内存函数写入开始 \n");
SRAM_Write();
}
//======================================================================
//======================================================================
void fn_LCD_Init(void){ //LCD运行测试
__IO int16_t int_check;
fn_Systick_Delay(500,_Systick_ms);
int_check = (__IO int16_t)ILI9341_Init();
Display_LCD_clear();
switch(int_check){
case 0x05:
printf("\n-->LCD 运行正常");
Lcd_display_String(" LCD 运行正常");
break;
default:
printf("\n-->LCD 运行异常");
Lcd_display_String(" LCD 运行异常");
}
}
//======================================================================
//======================================================================
void fn_XPT2046_Init(void){ //XPT2046运行测试
printf("\n-->LCD 触摸初始化");
Lcd_display_String(" LCD 触摸初始化");
XPT2046_GPIO_Init();
// while(XPT2046_Touch_Calibrate_Page() == 0){;}
Lcd_display_String(" LCD 触摸初始化ok");
}
//======================================================================
//======================================================================
void fn_Adc_Init(void){
ADCx_Init();
}
//======================================================================
//======================================================================
void delay(int x){
int y = 0xFFFFF;
while((x--)>0){
while((y--)>0){
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
}
}
}
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
建立ADC采集驱动文件ADC_book.h
代码如下 :
#ifndef __ADC_BOOK_H
#define __ADC_BOOK_H
#include "stm32f10x.h"
// ADC GPIO宏定义
// 注意:用作ADC采集的IO必须没有复用,否则采集电压会有影响// ADC 编号选择
// 可以是 ADC1/2,如果使用ADC3,中断相关的要改成ADC3的
#define ADC_GPIO_APBxClock_FUN RCC_APB2PeriphClockCmd
#define ADC_GPIO_CLK RCC_APB2Periph_GPIOC
#define ADC_PORT GPIOC
// ADC 编号选择
// 可以是 ADC1/2,如果使用ADC3,中断相关的要改成ADC3的
#define ADC_APBxClock_FUN RCC_APB2PeriphClockCmd
#define ADC_X ADC1 //ADC2
#define ADC_CLK RCC_APB2Periph_ADC1//RCC_APB2Periph_ADC2
#define __ADC_DMA_Mode__ //使能标志位
#ifdef __ADC_DMA_Mode__
#define ADC_DMA_CLK RCC_AHBPeriph_DMA1
#define ADC_DMA_CHANEL DMA1_Channel1
#endif
//ADC 中断相关宏定义
#define ADC_IRQ ADC1_2_IRQn
#define ADC_IRQHandler ADC1_2_IRQHandler
//多通道设置
//转换通道的个数
#define __ADC_More_Mode__ //使能标志位
#ifdef __ADC_More_Mode__
#define NOFCHANEL 6
#define ADC_PIN GPIO_Pin_1
#define ADC_CHANNEL ADC_Channel_11
#define ADC_PIN1 GPIO_Pin_0
#define ADC_CHANNEL1 ADC_Channel_10
#define ADC_PIN2 GPIO_Pin_2
#define ADC_CHANNEL2 ADC_Channel_12
#define ADC_PIN3 GPIO_Pin_3
#define ADC_CHANNEL3 ADC_Channel_13
#define ADC_PIN4 GPIO_Pin_4
#define ADC_CHANNEL4 ADC_Channel_14
#define ADC_PIN5 GPIO_Pin_5
#define ADC_CHANNEL5 ADC_Channel_15
#else
#define ADC_PIN GPIO_Pin_1
//ADC 通道宏定义
#define ADC_CHANNEL ADC_Channel_11
#endif
typedef union {
struct{
unsigned char BIT0:1;unsigned char BIT1:1;unsigned char BIT2:1;unsigned char BIT3:1;
unsigned char BIT4:1;unsigned char BIT5:1;unsigned char BIT6:1;unsigned char BIT7:1;
//unsigned char BIT8:1;unsigned char BIT9:1;unsigned char BIT10:1;unsigned char BIT11:1;
//unsigned char BIT12:1;unsigned char BIT13:1;unsigned char BIT14:1;unsigned char BIT15:1;
}DATA_BIT;
uint8_t DATA_BYTE;
}Per_adc_type;
extern volatile Per_adc_type adc_flag;
#define badc_10ms adc_flag.DATA_BIT.BIT0
extern volatile uint16_t Count_Adc_flag;
//-----------AD多通道采集-------
#ifdef __ADC_More_Mode__
extern volatile uint16_t ADC_More_ConvertedValue[NOFCHANEL];
extern volatile float ADC_More_ConvertedValueLocal[NOFCHANEL];
//-----------AD多通道采集-------
#else
//-----------AD单独通道采集-------
extern volatile uint16_t ADC_ConvertedValue;
extern volatile float ADC_ConvertedValueLocal;
#endif
//-----------AD通道采集-------
void ADCx_Init(void);
void ADC_get_value(void);
#endif
建立ADC采集程序ADC_book.c
代码如下 :
#include "ADC_book.h"
#include "XPT2046_LCD_GridDiagram_book.h"
volatile Per_adc_type adc_flag;
volatile uint16_t Count_Adc_flag;
//-----------AD多通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
__IO uint16_t ADC_More_ConvertedValue[NOFCHANEL]={0,0,0,0,0,0};
__IO uint16_t ADC_More_ConvertedValue_Show[NOFCHANEL]={0,0,0,0,0,0};
__IO float ADC_More_ConvertedValueLocal[NOFCHANEL];
#else
//-----------AD单独通道采集-------
__IO uint16_t ADC_ConvertedValue;
__IO float ADC_ConvertedValueLocal;
#endif
//-----------AD通道采集-------
/**
* @brief ADC GPIO 初始化
* @param 无
* @retval 无
*/
static void ADCx_GPIO_Config(void){
GPIO_InitTypeDef GPIO_InitStructure;
// 打开ADC IO 端口时钟
ADC_GPIO_APBxClock_FUN (ADC_GPIO_CLK , ENABLE);
//配置 ADC IO 端口的模式
// 必须为模拟输入
//-----------AD多通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
GPIO_InitStructure.GPIO_Pin = ADC_PIN |
ADC_PIN1|
ADC_PIN2|
ADC_PIN3|
ADC_PIN4|
ADC_PIN5;
#else
//-----------AD单独通道采集-------
GPIO_InitStructure.GPIO_Pin = ADC_PIN;
#endif
//-----------AD多通道采集-------
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
//初始化 ADDC_IO
GPIO_Init(ADC_PORT , &GPIO_InitStructure );
}
/**
* @brief 配置ADC DMA 工作模式
* @param
* @retval
*/
static void ADCx_DMA_Config(void){
DMA_InitTypeDef DMA_InitStructure;
//打开DMA时钟
RCC_AHBPeriphClockCmd(ADC_DMA_CLK , ENABLE);
//复位DMA 控制器
DMA_DeInit(ADC_DMA_CHANEL);
//配置DMA初始化结构体
// 外设基址为:ADC 数据寄存器地址
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(&(ADC_X->DR));
// 存储器地址,实际上就是一个内部SRAM的变量
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
DMA_InitStructure.DMA_MemoryBaseAddr = (u32)ADC_More_ConvertedValue;
#else
//-----------AD单通道采集-------
DMA_InitStructure.DMA_MemoryBaseAddr = (32)&ADC_ConvertedValue;
#endif
//-----------AD通道采集-------
// 数据源来自外设
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
// 缓冲区大小为1,缓冲区的大小应该等于存储器的大小
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
DMA_InitStructure.DMA_BufferSize = NOFCHANEL ;
// 外设寄存器只有一个,地址不用递增
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
// 存储器地址固定
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
#else
//-----------AD单独通道采集-------
DMA_InitStructure.DMA_BufferSize = 1 ;
// 外设寄存器只有一个,地址不用递增
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
// 存储器地址固定
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
#endif
//-----------AD通道采集-------
// 外设数据大小为半字,即两个字节
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
// 存储器数据大小也为半字,跟外设数据大小相同
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
// 循环传输模式
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
// DMA 传输通道优先级为高,当使用一个DMA通道时,优先级设置不影响
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
// 禁止存储器到存储器模式,因为是从外设到存储器
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
// 初始化DMA
DMA_Init(ADC_DMA_CHANEL,&DMA_InitStructure);
// 使能 DMA 通道
DMA_Cmd(ADC_DMA_CHANEL , ENABLE);
}
/**
* @brief 配置ADC 工作模式
* @param
* @retval
*/
static void ADCx_Mode_Config(void){
ADC_InitTypeDef ADC_InitStructure;
//打开ADC时钟
ADC_APBxClock_FUN (ADC_CLK , ENABLE);
//--------DMA模式-----
#ifdef __ADC_DMA_Mode__
ADCx_DMA_Config();
#endif
//--------DMA模式-----
//ADC 模式配置
// 只使用一个ADC,属于单模式
ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
扫描模式
ADC_InitStructure.ADC_ScanConvMode = ENABLE;
#else
//-----------AD单通道采集-------
// 只使用一个ADC , 属于独立模式
ADC_InitStructure.ADC_ScanConvMode = DISABLE;
#endif
//-----------AD通道采集-------
//连续转换模式
ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
// 不用外部触发转换 ,软件开启即可
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
//转换结果右侧对齐
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
//转换通道6个
ADC_InitStructure.ADC_NbrOfChannel = NOFCHANEL;
#else
//-----------AD单通道采集-------
//转换通道1个
ADC_InitStructure.ADC_NbrOfChannel = 1;
#endif
//-----------AD通道采集-------
//初始化ADC
ADC_Init(ADC_X , &ADC_InitStructure);
//配置ADC时钟为PCLCK2的8分频 为9HZ
RCC_ADCCLKConfig(RCC_PCLK2_Div8);
//配置ADC转换通道转换顺序和采样时间
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL , 1 , ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL1 , 2 , ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL2 , 3 , ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL3 , 4 , ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL4 , 5 , ADC_SampleTime_55Cycles5);
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL5 , 6 , ADC_SampleTime_55Cycles5);
#else
//-----------AD单通道采集-------
ADC_RegularChannelConfig(ADC_X , ADC_CHANNEL , 1 , ADC_SampleTime_55Cycles5);
#endif
//-----------AD通道采集-------
//--------DMA模式-----
#ifdef __ADC_DMA_Mode__
// 使能ADC DMA 请求
ADC_DMACmd(ADC_X, ENABLE);
#else
//ADC 转换结束产生中断,在中断服务程序中读取转换值
ADC_ITConfig(ADC_X , ADC_IT_EOC , ENABLE);
// 使能ADC DMA 请求
ADC_DMACmd(ADC_X, ENABLE);
#endif
//--------DMA模式-----
//开启ADC 并开始转换
ADC_Cmd(ADC_X , ENABLE);
// 初始化ADC 校准寄存器
ADC_ResetCalibration(ADC_X);
// 等待校准寄存器初始化完成
while(ADC_GetResetCalibrationStatus(ADC_X));
//ADC_采集校准
ADC_StartCalibration(ADC_X);
//等待校准完成
while(ADC_GetCalibrationStatus(ADC_X));
//由于没有采用外部触发 ,所以使用软件ADC转换
ADC_SoftwareStartConvCmd(ADC_X , ENABLE);
}
static void ADC_NVIC_Config(void){
NVIC_InitTypeDef NVIC_InitStructure;
//优先级分组
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
//配置中断优先级
NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQ;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
void ADC_IRQHandler(void){
if( ADC_GetITStatus(ADC_X , ADC_IT_EOC )==SET ){
//读取ADC的转换值
//--------DMA模式-----
#ifdef __ADC_DMA_Mode__
#else
ADC_ConvertedValue = ADC_GetConversionValue(ADC_X);
#endif
//--------DMA模式-----
}
ADC_ClearITPendingBit(ADC_X , ADC_IT_EOC);
}
/**********************END OF FILE**********************/
/**
* @brief ADC初始化
* @param 无
* @retval 无
*/
void ADCx_Init(void){
//--------DMA模式-----
#ifdef __ADC_DMA_Mode__
ADCx_GPIO_Config();
ADCx_Mode_Config();
#else
ADCx_GPIO_Config();
ADCx_Mode_Config();
ADC_NVIC_Config(); // DMA 模式不需要对中断进行处理
#endif
//--------DMA模式-----
}
void ADC_get_value(void){
uint8_t i = 0;
if(badc_10ms==0){return;}
badc_10ms = 0;
//-----------AD通道采集-------
#ifdef __ADC_More_Mode__
//-----------AD多通道采集-------
for( i=0;i<NOFCHANEL ; i++){
ADC_More_ConvertedValue_Show[i]= (float)ADC_More_ConvertedValue[i]/4096*3.3;
ADC_More_ConvertedValueLocal[i]= (float)ADC_More_ConvertedValue[i];
}
for( i=0;i<NOFCHANEL ; i++){
ADC_More_ConvertedValueLocal[i]= (float)ADC_More_ConvertedValue[i]/4096*3.3;
printf("The current AD value %d = 0x%04X %f V\n",i,ADC_More_ConvertedValue[i],ADC_More_ConvertedValueLocal[i]);
}
printf("\r\n\r\n");
#else
//-----------AD单通道采集-------
ADC_ConvertedValueLocal = (float)ADC_ConvertedValue/4096*3.3;
printf("\r\n The current AD value = 0x%04X \r\n",ADC_ConvertedValue);
printf("\r\n The current AD value = %f V \r\n",ADC_ConvertedValueLocal);
printf("\r\n\r\n");
#endif
//-----------AD通道采集-------
GDScream_Data_show(ADC_More_ConvertedValue,NOFCHANEL);
}
建立波形显示的LCD驱动文件XPT2046_LCD_GridDiagram_book.h
代码如下 :
#ifndef __XPT2046_LCD_GRIDDIAGRAM_BOOK__
#define __XPT2046_LCD_GRIDDIAGRAM_BOOK__
#include "stm32f10x.h"
#include "XPT2046_LCD_Function_book.h"
#include "XPT2046_LCD_book.h"
#include "LCD_book.h"
#include "LCD_Draw_book.h"
#include "XPT2046_LCD_Device_book.h"
#include "ADC_book.h"
#include "USART_book.h"
//======================================================形式是默认还是定制化=====================================================
/**
模式0: . 模式1: . 模式2: . 模式3:
A . A . A . A
| . | . | . |
Y . X . Y . X
0 . 1 . 2 . 3
<--- X0 o . <----Y1 o . o 2X---> . o 3Y--->
------------------------------------------------------------
模式4: . 模式5: . 模式6: . 模式7:
<--- X4 o . <--- Y5 o . o 6X---> . o 7Y--->
4 . 5 . 6 . 7
Y . X . Y . X
| . | . | . |
V . V . V . V
---------------------------------------------------------
LCD屏示例
|---------|-----------------------------|
| AD测试 | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
|---------|-----------------------------|
屏幕正面(宽240,高320)270 50 -2
**/
///******************************* XPT2046 触摸屏参数定义 ***************************/
#define XPT2046_GDCHANNEL_X ILI9341_MORE_PIXEL //通道Y+的选择控制字
#define XPT2046_GDCHANNEL_Y ILI9341_LESS_PIXEL //通道X+的选择控制字
#define LCD_GDWork_X_LENGTH 270
#define LCD_GDNwork_Y_LENGTH 238
#define LCD_GDControl_X_Start 0
#define LCD_GDControl_Y_Start 0
#define LCD_GDControl_X_LENGTH (XPT2046_GDCHANNEL_X - LCD_GDWork_X_LENGTH - 2)
#define LCD_GDControl_Y_LENGTH XPT2046_GDCHANNEL_Y
#define LCD_GDSCAN_X_Start (LCD_GDControl_X_LENGTH+1)
#define LCD_GDSCAN_Y_Start 1
#define LCD_GDSCAN_X_LENGTH LCD_GDWork_X_LENGTH
#define LCD_GDSCAN_Y_LENGTH LCD_GDNwork_Y_LENGTH
#define LCD_GDSCAN_X_End (XPT2046_GDCHANNEL_X-1)
#define LCD_GDSCAN_Y_End (XPT2046_GDCHANNEL_Y-1)
#define Center_lineNum 6
#define GDBUTTON_NUM 3
typedef struct{
int16_t value_x_before ;
int16_t value_x_now ;
int16_t value_y_before ;
int16_t value_y_now ;
uint32_t para_color;
uint16_t data_value;
void (*draw_point)(void *draw_pot); //按键描绘函数
}AD_Point;
void GDScream_Data_show(u32 *data_value , uint16_t data_num);
#endif
建立波形显示的LCD程序文件XPT2046_LCD_GridDiagram_book.c
代码如下 :
/**
******************************************************************************
* @file palette.c
* @author fire
* @version V1.0
* @date
* @brief 触摸画板应用函数
******************************************************************************
* @attention
*
******************************************************************************
*/
#include "XPT2046_LCD_GridDiagram_book.h"
#include <stdio.h>
#include <string.h>
Touch_Button GDbutton[GDBUTTON_NUM];
static void GDTouch_Button_Init(void);
static void Draw_btn_GDcontrol_Button(void *btn);
static void Btn_command_GDcontrol_Button(void);
static void GDControl_Text_Init(void);
static void GDScream_show_Init(void);
static void GDScream_Line_Init(void);
static void GDScream_Data_show_init(void);
static void Draw_point(void * draw_pot);
/**
* @brief Palette_Init 画板初始化
* @param 无
* @retval 无
*/
#define _LCD_GDSCAN_MODE LCD_SCAN_MODE_3
void GridDiagram_Init(void){
uint16_t datax , datay;
ILI9341_GramScan(_LCD_GDSCAN_MODE);
//初始化画板颜色
LCD_SetBackColor(CL_GREY2);
ILI9341_Clear(0,0,XPT2046_GDCHANNEL_X+1,XPT2046_GDCHANNEL_Y+1);
LCD_SetColors(CL_YELLOW , CL_WHITE);
ILI9341_DrawRectangle(1,1,LCD_GDControl_X_LENGTH-1,LCD_GDControl_Y_LENGTH-1,0,1);
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(LCD_GDControl_X_Start ,
LCD_GDControl_Y_Start ,
LCD_GDControl_X_LENGTH,
LCD_GDControl_Y_LENGTH,0,1);
LCD_SetColors(CL_BLACK , CL_WHITE);
ILI9341_DrawRectangle(LCD_GDSCAN_X_Start,
LCD_GDSCAN_Y_Start,
LCD_GDSCAN_X_LENGTH,
LCD_GDSCAN_Y_LENGTH,1,1);
GDScream_Line_Init();
GDScream_Data_show_init();
//初始化按钮
GDTouch_Button_Init();
GDControl_Text_Init();
//对属性物件进行刷新
GDScream_show_Init();
}
/**
* @brief GDTouch_Button_Init 画板初始化
* @param 无
* @retval 无
*/
static void GDTouch_Button_Init(void){
uint8_t i ;
for(i = 0 ;i<=GDBUTTON_NUM ;i++ ){
GDbutton[i].start_x = BUTTON_START_X+3;
GDbutton[i].end_x = GDbutton[i].start_x+COLOR_BLOCK_WIDTH ;
GDbutton[i].start_y = (COLOR_BLOCK_HEIGHT + 20)*(i+1);
GDbutton[i].end_y = GDbutton[i].start_y + COLOR_BLOCK_HEIGHT ;
GDbutton[i].touch_flag = 0;
GDbutton[i].draw_btn = Draw_btn_GDcontrol_Button ;
GDbutton[i].btn_command = Btn_command_GDcontrol_Button ;
}
GDbutton[0].para = CL_GREY; //构建按钮的属性
GDbutton[1].para = CL_GREY; //构建按钮的属性
GDbutton[2].para = CL_GREY; //构建按钮的属性
//描绘按钮
for(i=0 ;i<GDBUTTON_NUM ;i++ ){
GDbutton[i].draw_btn(&GDbutton[i]);
}
}
/**
* @brief Draw_btn_GDcontrol_Button 画板初始化
* @param 无
* @retval 无
*/
static void Draw_btn_GDcontrol_Button(void *btn){
Touch_Button *ptr = (Touch_Button *)btn;
//释放按键
if( ptr->touch_flag == 0){
//背景为功能键的颜色
LCD_SetColors(ptr->para , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,1,1);
//白色背景边框
LCD_SetColors(CL_BOX_BORDER1 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,0,2);
}else{//按键按下
//白色背景
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,1,1);
//白色背景边框
LCD_SetColors(CL_BOX_BORDER2 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,0,2);
}
}
/**
* @brief Btn_command_GDcontrol_Button 画板初始化
* @param 无
* @retval 无
*/
static void Btn_command_GDcontrol_Button(void){
;
}
/**
* @brief Draw_btn_GDcontrol_Button 画板初始化
* @param 无
* @retval 无
*/
static void GDControl_Text_Init(void){
LCD_SetColors(CL_RED,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( LCD_GDControl_X_Start +2, LCD_GDControl_Y_Start + 5, "AD检查");
LCD_SetColors(CL_BLACK,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( LCD_GDControl_X_Start +2, LCD_GDControl_Y_Start + 25, " 王琪");
}
/**
* @brief Draw_btn_GDcontrol_Button 画板初始化
* @param 无
* @retval 无
*/
static void GDScream_Line_Init(void){
uint8_t i ;
uint16_t center_linexstart , center_lineystart ,center_linexend , center_lineyend;
uint16_t center_linespace ;
center_linexstart = LCD_GDSCAN_X_Start ;
center_lineystart = XPT2046_GDCHANNEL_Y / 2;
center_linexend = LCD_GDSCAN_X_End;
center_lineyend = center_lineystart ;
center_linespace = (XPT2046_GDCHANNEL_Y - 2 )/Center_lineNum ;
LCD_SetColors(CL_RED , CL_WHITE);
ILI9341_DrawLine( center_linexstart ,center_lineystart ,center_linexend ,center_lineyend,1 );
LCD_SetColors(CL_YELLOW , CL_WHITE);
ILI9341_DrawLine( center_linexstart ,center_lineystart + center_linespace ,center_linexend ,center_lineyend + center_linespace,1 );
ILI9341_DrawLine( center_linexstart ,center_lineystart - center_linespace ,center_linexend ,center_lineyend - center_linespace,1 );
LCD_SetColors(CL_BLUE , CL_WHITE);
ILI9341_DrawLine( center_linexstart ,center_lineystart + (center_linespace*2) ,center_linexend ,center_lineystart + (center_linespace*2),1 );
ILI9341_DrawLine( center_linexstart ,center_lineystart - (center_linespace*2) ,center_linexend ,center_lineystart - (center_linespace*2),1 );
}
/**
* @brief Draw_btn_GDcontrol_Button 画板初始化
* @param 无
* @retval 无
*/
static void GDScream_show_Init(void){
uint8_t i ;
for( i=0 ; i< (GDBUTTON_NUM); i++ ) {
GDbutton[i].draw_btn(&GDbutton[i]);
}
}
//===============================================关于屏幕画点的程序函数==============================================
// 屏幕正面(宽320,高240)
// 270 个像素
// 238 / 6 38
// 500MS 一个数字
// 像素间隔 Dx = 2 = 135 个数字
// 可以测试85S 的数据
// 4096 12 AD 每个像素高度为 20 *38 = 760 大约 0.6V 精度为0.02V
// 设定变量 :uint16 data_value / DX = 2 DY = 1 HX= 1 HY = 20 , uint16 data_value_before data_value_now ,
#define DX 1
#define DY 1
#define HX 1
#define HY 20
__IO int16_t data_value_x_before = -1; //之前的状态点
__IO int16_t data_value_x_now = -1; // 现在的状态点
__IO int16_t data_value_y_before = -1;
__IO int16_t data_value_y_now = -1;
AD_Point ad_point[NOFCHANEL]; //采样数据模块
static void GDScream_Data_show_init(void){ //显示数据AD的样式初始化
uint8_t i=0 ;
data_value_x_before = -1 ;
data_value_x_now = -1;
data_value_y_before = -1 ;
data_value_y_now = -1;
for( i=0;i<NOFCHANEL ;i++ ){
ad_point[i].value_x_before =data_value_x_before;
ad_point[i].value_x_now = data_value_x_now;
ad_point[i].value_y_before = data_value_y_before ;
ad_point[i].value_y_now = data_value_y_now;
ad_point[i].draw_point = Draw_point;
}
ad_point[0].para_color = CL_WHITE;
ad_point[1].para_color = CL_GREEN;
ad_point[2].para_color = CL_GREY3;
ad_point[3].para_color = CL_YELLOW;
ad_point[4].para_color = CL_BLUE;
ad_point[5].para_color = CL_MAGENTA;
}
static void Draw_point(void *draw_pot){ //AD模块采样点的绘制功能
AD_Point *ptr_point = (AD_Point *)draw_pot;
if((ptr_point->value_x_before) == -1){
ILI9341_SetPointPixel(ptr_point->value_x_now,ptr_point->value_y_now,1);
}else{
ILI9341_DrawLine(ptr_point->value_x_before,ptr_point->value_y_before,ptr_point->value_x_now,ptr_point->value_y_now,1);
}
}
void GDScream_Data_show(u32 *data_value , uint16_t data_num){ //GD显示
uint8_t i=0 , j=0 ;
char cStr [ 100 ];
char * pStr = 0;
__IO float ADC_ValueLocal;
__IO int16_t data_value_x , data_value_y ;
for(i=0 ; i<data_num;i++){
ad_point[i].data_value = (int16_t) data_value[i]; //对数据进行模块存储,将采集到的数据一一存入采样点的实时存储寄存器
}
LCD_SetColors(CL_WHITE , CL_WHITE);
if((data_value_x_now<0)||(data_value_x_now > LCD_GDSCAN_X_End-2)){ // 如果是第一次进入最左端存储点就刷新程序
LCD_SetColors(CL_BLACK , CL_WHITE);
ILI9341_DrawRectangle(LCD_GDSCAN_X_Start,
LCD_GDSCAN_Y_Start,
LCD_GDSCAN_X_LENGTH,
LCD_GDSCAN_Y_LENGTH,1,1);
GDScream_Line_Init();
GDScream_Data_show_init();
}
if(data_value_x_before == -1){ //说明是第一次 如果是初始化第一次需要在最左端绘制描绘点
for(i=0 ;i<data_num ;i++ ){
data_value_x = LCD_GDSCAN_X_Start;
data_value_y = LCD_GDSCAN_Y_End -(ad_point[i].data_value/ HY) ;
data_value_x_now = data_value_x ;
data_value_y_now = data_value_y ;
ad_point[i].value_x_now = data_value_x_now;
ad_point[i].value_y_now = data_value_y_now;
LCD_SetColors(ad_point[i].para_color , ad_point[i].para_color);
ad_point[i].draw_point(&ad_point[i]);
//ILI9341_SetPointPixel(ad_point[i].data_value_x_now,ad_point[i].data_value_y_now,1);
data_value_x_before = data_value_x ;
data_value_y_before = data_value_y ;
ad_point[i].value_x_before = data_value_x_before;
ad_point[i].value_y_before = data_value_y_before;
}
}
else {
for(j=0 ;j<data_num ;j++ ){ //正常绘制注意当前数据与之前数据的切换
data_value_x = data_value_x_before+DX ;
data_value_y = LCD_GDSCAN_Y_End -(ad_point[j].data_value/ HY) ;
data_value_x_now = data_value_x ;
data_value_y_now = data_value_y ;
ad_point[j].value_x_now = data_value_x_now;
ad_point[j].value_y_now = data_value_y_now;
LCD_SetColors(ad_point[j].para_color , ad_point[j].para_color);
ad_point[j].draw_point(&ad_point[j]);
//ILI9341_DrawLine(ad_point[j].data_value_x_before,ad_point[j].data_value_y_before,ad_point[j].data_value_x_now,ad_point[j].data_value_y_now,1);
data_value_x_before = data_value_x_now ;
data_value_y_before = data_value_y_now ;
ad_point[j].value_x_before = data_value_x_before;
ad_point[j].value_y_before = data_value_y_before;
}
}
ADC_ValueLocal =(float)ad_point[0].data_value/4096*3.3;
sprintf ( cStr, "0x%04X",ad_point[0].data_value );
LCD_SetColors(CL_MAGENTA,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( LCD_GDControl_X_Start+2 , LCD_GDControl_Y_LENGTH - 50, cStr);
sprintf ( cStr, "%.3fV",ADC_ValueLocal );
LCD_SetColors(CL_RED,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( LCD_GDControl_X_Start +2, LCD_GDControl_Y_LENGTH - 30, cStr);
}
建立XPT2046驱动文件XPT2046_LCD_Device_book.h
代码如下 :
#ifndef __XPT2046_LCD_DEVICE_BOOK_H__
#define __XPT2046_LCD_DEVICE_BOOK_H__
#include "stm32f10x.h"
#include "XPT2046_LCD_Function_book.h"
#include "XPT2046_LCD_book.h"
#include "LCD_book.h"
#include "LCD_Draw_book.h"
#include "USART_book.h"
//======================================================颜色参数=====================================================
/*
LCD 颜色代码,CL_是Color的简写
16Bit由高位至低位, RRRR RGGG GGGB BBBB
下面的RGB 宏将24位的RGB值转换为16位格式。
启动windows的画笔程序,点击编辑颜色,选择自定义颜色,可以获得的RGB值。
推荐使用迷你取色器软件获得你看到的界面颜色。
*/
#define LCD_RGB_565 1
#if LCD_RGB_565
#define RGB(Rh,Gh,Bh) (((Rh&0xf8)<<8)|((Gh&0xfc)<<3)|((Bh&0xf8)>>3))
#else
#define RGB(RGB) ((((RGB&0xf80000)) | ((RGB&0x00fc00)<<3)| ((RGB&0x0000f8)<<5))>>8)
#endif
enum{
CL_WHITE = RGB(255,255,255), /* 白色 */
CL_BLACK = RGB( 0, 0, 0), /* 黑色 */
CL_RED = RGB(255, 0, 0), /* 红色 */
CL_GREEN = RGB( 0,255, 0), /* 绿色 */
CL_BLUE = RGB( 0, 0,255), /* 蓝色 */
CL_YELLOW = RGB(255,255, 0), /* 黄色 */
CL_GREY = RGB( 98, 98, 98), /* 深灰色 */
CL_GREY1 = RGB( 150, 150, 150), /* 浅灰色 */
CL_GREY2 = RGB( 180, 180, 180), /* 浅灰色 */
CL_GREY3 = RGB( 200, 200, 200), /* 最浅灰色 */
CL_GREY4 = RGB( 230, 230, 230), /* 最浅灰色 */
CL_BUTTON_GREY = RGB( 195, 195, 195), /* WINDOWS 按钮表面灰色 */
CL_MAGENTA = RGB(255, 0, 255), /* 红紫色,洋红色 */
CL_CYAN = RGB( 0, 255, 255), /* 蓝绿色,青色 */
CL_BLUE1 = RGB( 0, 0, 240), /* 深蓝色 */
CL_BLUE2 = RGB( 0, 0, 128), /* 深蓝色 */
CL_BLUE3 = RGB( 68, 68, 255), /* 浅蓝色1 */
CL_BLUE4 = RGB( 0, 64, 128), /* 浅蓝色1 */
/* UI 界面 Windows控件常用色 */
CL_BTN_FACE = RGB(236, 233, 216), /* 按钮表面颜色(灰) */
CL_BOX_BORDER1 = RGB(172, 168,153), /* 分组框主线颜色 */
CL_BOX_BORDER2 = RGB(255, 255,255), /* 分组框阴影线颜色 */
CL_MASK = 0x7FFF /* RGB565颜色掩码,用于文字背景透明 */
};
//======================================================形式是默认还是定制化=====================================================
typedef enum{
Type_default = 0,
Type_particularly ,
Type_especially, //橡皮
}Type_Style_Device;
//======================================================按键按钮的参数=====================================================
typedef struct{
uint16_t start_x; //按键的x起始坐标
uint16_t start_y; //按键的y起始坐标
uint16_t end_x; //按键的x结束坐标
uint16_t end_y; //按键的y结束坐标
uint32_t para; //颜色按钮中表示选择的颜色,笔迹形状按钮中表示选择的画刷
uint8_t touch_flag; //按键按下的标志
void (*draw_btn)(void * btn); //按键描绘函数
void (*btn_command)(void * btn); //按键功能执行函数,例如切换颜色、画刷
}Touch_Button;
//======================================================按键画图功能的参数=====================================================
typedef enum{
LINE_SING_PIXCEL = 0 ,//单像素线
LINE_2_PIXCEL, //2像素线
LINE_4_PIXCEL, //4像素线
LINE_6_PIXCEL, //6像素线
LINE_8_PIXCEL, //8像素线
LINE_16_PIXCEL, //16像素线
LINE_20_PIXCEL, //20像素线
LINE_WITH_CIRCLE, //珠子连线
RUBBER, //橡皮
Draw_CLEAR,
}SHAPE;
/*画刷参数*/
typedef struct
{
uint32_t color; //颜色参数
SHAPE shape; // 形状参数
}Brush_Style;
extern Brush_Style brush;
//======================================================功能参数=====================================================
void Palette_Init(
uint8_t _LCD_GramScan_Mode ,//屏幕方向
uint16_t _Page_Color , //画板颜色
uint16_t _Brush_Color //画笔颜色
);
void Touch_Button_Down(uint16_t x,uint16_t y);
void Touch_Button_Up(uint16_t x,uint16_t y);
void Draw_Trail(int16_t pre_x,int16_t pre_y,int16_t x,int16_t y,Brush_Style* brush);
//======================================================功能参数=====================================================
#define COLOR_BLOCK_WIDTH 40 //默认按钮的大小
#define COLOR_BLOCK_HEIGHT 28 //默认按钮的高度
#define BUTTON_NUM 18 //默认按钮的数量
#define PALETTE_START_Y 0 //默认按钮的排列顺序
#define PALETTE_END_Y LCD_Y_LENGTH //该参数定义再LCD_BOOK 中扩展变量
#define PALETT_Left 1
#if PALETT_Left //按钮栏在左边
#define BUTTON_START_X 0
#define PALETTE_START_X (COLOR_BLOCK_WIDTH*2+1)
#define PALETTE_END_X LCD_X_LENGTH
#else //按钮栏在右边,(存在触摸按键时也会的bug仅用于测试触摸屏左边界)
#define BUTTON_START_X (LCD_X_LENGTH-2*COLOR_BLOCK_WIDTH)
#define PALETTE_START_X 0
#define PALETTE_END_X (LCD_X_LENGTH-2*COLOR_BLOCK_WIDTH)
#endif
#endif /* __XPT2046_LCD_DEVICE_BOOK_H__ */
建立XPT2046程序文件XPT2046_LCD_Device_book.c
代码如下 :
/**
******************************************************************************
* @file palette.c
* @author fire
* @version V1.0
* @date
* @brief 触摸画板应用函数
******************************************************************************
* @attention
*
******************************************************************************
*/
#include "XPT2046_LCD_Device_book.h"
//按钮的结构体数组
Touch_Button button[BUTTON_NUM];
//画笔参数
Brush_Style brush;
static void Touch_Button_Init(void);
static void Draw_Color_Button(void *btn);
static void Draw_Shape_Button(void *btn);
static void Draw_RUBBER_Button(void *btn);
static void Draw_Clear_Button(void *btn);
static void Command_Select_Color(void *btn);
static void Command_Select_Brush(void *btn);
static void Command_RUBBER_Palette(void *btn);
static void Command_Clear_Palette(void *btn);
/**
* @brief Palette_Init 画板初始化
* @param 无
* @retval 无
*/
void Palette_Init(
uint8_t _LCD_GramScan_Mode ,//屏幕方向
uint16_t _Page_Color , //画板颜色
uint16_t _Brush_Color //画笔颜色
){
uint8_t i ;
ILI9341_GramScan(_LCD_GramScan_Mode);
//初始化画板颜色
LCD_SetBackColor(_Page_Color);
ILI9341_Clear(0,0,LCD_X_LENGTH,LCD_Y_LENGTH);
LCD_SetColors(GB888(0xEAC599) , CL_WHITE);
ILI9341_DrawRectangle(0,
0,
LCD_X_LENGTH-(PALETTE_END_X-PALETTE_START_X),
LCD_Y_LENGTH,1,1);
//初始化按钮
Touch_Button_Init();
//描绘按钮
for(i=0 ;i<BUTTON_NUM ;i++ ){
button[i].draw_btn(&button[i]);
}
//初始化画笔
brush.color = _Brush_Color;
brush.shape = LINE_SING_PIXCEL ;//单像素线
//初始化文本颜色
LCD_SetTextColor(brush.color);
}
/**
* @brief Touch_Button_Init 初始化按钮参数
* @param 无
* #define COLOR_BLOCK_WIDTH 40 //默认按钮的大小
* #define COLOR_BLOCK_HEIGHT 28 //默认按钮的高度
*
* @retval 无
*/
static void Touch_Button_Init(void){
int i;
//第一列
for(i = 0 ;i<=8 ;i++ ){
button[i].start_x = BUTTON_START_X;
button[i].end_x = button[i].start_x+COLOR_BLOCK_WIDTH ;
button[i].start_y = COLOR_BLOCK_HEIGHT*(i+1);
button[i].end_y = button[i].start_y + COLOR_BLOCK_HEIGHT;
button[i].touch_flag = 0;
button[i].draw_btn = Draw_Color_Button ;
button[i].btn_command = Command_Select_Color ;
}
button[0].para = CL_BLACK; //构建按钮的属性
button[1].para = CL_YELLOW;
button[2].para = CL_BLUE ;
button[3].para = CL_CYAN;
button[4].para = CL_RED;
button[5].para = CL_MAGENTA;
button[6].para = CL_GREEN;
button[7].para = CL_GREY1;
button[8].para = CL_WHITE;
/*第二列,主要为画刷按钮*/
for(i = 0 ;i<7 ;i++ ){
button[i+9].start_x = BUTTON_START_X + COLOR_BLOCK_WIDTH;
button[i+9].end_x = button[i+9].start_x + COLOR_BLOCK_WIDTH ;
button[i+9].start_y = COLOR_BLOCK_HEIGHT*(i+1);
button[i+9].end_y = button[i+9].start_y + COLOR_BLOCK_HEIGHT;
button[i+9].touch_flag = 0;
button[i+9].draw_btn = Draw_Shape_Button ;
button[i+9].btn_command = Command_Select_Brush ;
}
button[9].para = LINE_SING_PIXCEL;
button[10].para = LINE_2_PIXCEL;
button[11].para = LINE_4_PIXCEL;
button[12].para = LINE_6_PIXCEL;
button[13].para = LINE_8_PIXCEL;
button[14].para = LINE_16_PIXCEL;
button[15].para = LINE_20_PIXCEL;
button[16].start_x = BUTTON_START_X + COLOR_BLOCK_WIDTH;
button[16].end_x = button[16].start_x + COLOR_BLOCK_WIDTH ;
button[16].start_y = COLOR_BLOCK_HEIGHT*(7+1);
button[16].end_y = button[16].start_y + COLOR_BLOCK_HEIGHT;
button[16].touch_flag = 0;
button[16].draw_btn = Draw_RUBBER_Button ;
button[16].btn_command = Command_RUBBER_Palette ;
button[16].para = RUBBER;
button[17].start_x = BUTTON_START_X + COLOR_BLOCK_WIDTH;
button[17].end_x = button[17].start_x + COLOR_BLOCK_WIDTH ;
button[17].start_y = COLOR_BLOCK_HEIGHT*(8+1);
button[17].end_y = button[17].start_y + COLOR_BLOCK_HEIGHT;
button[17].touch_flag = 0;
button[17].draw_btn = Draw_Clear_Button ;
button[17].btn_command = Command_Clear_Palette ;
button[17].para = Draw_CLEAR;
}
//==================================按钮触摸识别函数=====================================
//=====================================================================================
/**
* @brief Touch_Button_Down 按键被按下时调用的函数,由触摸屏调用
* @param x 触摸位置的x坐标
* @param y 触摸位置的y坐标
* @retval 无
*/
void Touch_Button_Down(uint16_t x,uint16_t y){
uint8_t i ;
for(i=0 ;i<BUTTON_NUM ;i++ ){
//触摸到了按钮
if((x>=button[i].start_x)&&(y>=button[i].start_y)&&(x<=button[i].end_x)&&(y<=button[i].end_y)){
if(button[i].touch_flag == 0){ /*原本的状态为没有按下,则更新状态*/
button[i].touch_flag = 1; /* 改变按下标志 */
button[i].draw_btn(&button[i]); /*重绘按钮*/
}
}
else{ /* 触摸移出了按键的范围且之前有按下按钮 */
if(button[i].touch_flag == 1){ /* 触摸移出了按键的范围且之前有按下按钮 */
button[i].touch_flag = 0; /* 清除按下标志,判断为误操作*/
button[i].draw_btn(&button[i]); /*重绘按钮*/
}
}
}
}
/**
* @brief Touch_Button_Up 按键被释放时调用的函数,由触摸屏调用
* @param x 触摸最后释放时的x坐标
* @param y 触摸最后释放时的y坐标
* @retval 无
*/
void Touch_Button_Up(uint16_t x,uint16_t y){
uint8_t i ;
for(i=0 ;i<BUTTON_NUM ;i++ ){
if((x>=button[i].start_x)&&(y>=button[i].start_y)&&(x<=button[i].end_x)&&(y<=button[i].end_y)){
button[i].touch_flag = 0; /* 清除按下标志,判断为误操作*/
button[i].draw_btn(&button[i]); /*重绘按钮*/
button[i].btn_command(&button[i]); /*执行按键的功能命令*/
break;//安照按键顺序优先级执行
}
}
}
//==================================按钮的动作函数=====================================
//=====================================================================================
/**
* @brief Draw_Color_Button 颜色按钮的描绘函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Draw_Color_Button(void *btn){
Touch_Button *ptr = (Touch_Button *)btn;
//释放按键
if( ptr->touch_flag == 0){
//背景为功能键的颜色
LCD_SetColors(ptr->para , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,1,1);
//白色背景边框
LCD_SetColors(CL_BOX_BORDER1 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,0,2);
}else{//按键按下
//白色背景
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,1,1);
//白色背景边框
LCD_SetColors(CL_BOX_BORDER2 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x , ptr->start_y,\
ptr->end_x - ptr->start_x,\
ptr->end_y - ptr->start_y,0,2);
}
}
/**
* @brief Draw_Shape_Button 笔刷按钮的描绘函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Draw_Shape_Button(void *btn){
Touch_Button *ptr = (Touch_Button *)btn;
uint16_t i;
//背景颜色 没按下去的时候为灰色 按下去是后为白色
if(ptr->touch_flag == 0){
LCD_SetColors(CL_BUTTON_GREY , CL_WHITE);
ILI9341_DrawRectangle( ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
//显示文字的背景颜色
LCD_SetColors(CL_BLUE4 , CL_BUTTON_GREY);
ILI9341_DrawRectangle(ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,0,1);
}
else{
LCD_SetColors(CL_WHITE,CL_WHITE);
ILI9341_DrawRectangle( ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
/*显示文字时的背景颜色*/
LCD_SetColors(CL_BLUE4,CL_WHITE);
ILI9341_DrawRectangle( ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,0,1);
}
LCD_SetColors(CL_BLACK , CL_WHITE);
// 根据画刷形状描绘按钮图案
switch(ptr->para){
case LINE_SING_PIXCEL:
LCD_SetColors(CL_BLACK , CL_WHITE);
ILI9341_DrawLine(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,1);
break;
case LINE_2_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
1);
break;
case LINE_4_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
2);
break;
case LINE_6_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
3);
break;
case LINE_8_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
4);
break;
case LINE_16_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
8 );
break;
case LINE_20_PIXCEL:
LCD_DrawUniLineCircle(ptr->start_x+20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,ptr->end_x-20,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
10);
break;
case LINE_WITH_CIRCLE:
LCD_SetColors(CL_BLACK,CL_WHITE);
ILI9341_DrawLine(ptr->start_x+5,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
ptr->end_x-5,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,1);
for(i=0;i<((ptr->end_x - ptr->start_x-10)/10);i++){
ILI9341_DrawCircle( ptr->start_x+5+i*10,
ptr->start_y+(ptr->end_y-ptr->start_y)/2,
3,1,1);
}
break;
}
}
/**
* @brief Draw_RUBBER_Button 清屏按钮的描绘函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Draw_RUBBER_Button(void *btn){
Touch_Button *ptr = (Touch_Button *) btn;
//释放按键
if(ptr->touch_flag == 0){
LCD_SetColors(CL_BUTTON_GREY,CL_WHITE);
ILI9341_DrawRectangle( ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
LCD_SetColors(CL_RED , CL_BUTTON_GREY);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( ptr->start_x + (ptr->end_x - ptr->start_x - 16*2)/2,
ptr->start_y +(ptr->end_y - ptr->start_y - 16)/2,"橡皮");
}
else{ //按键按下
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
LCD_SetColors(CL_RED,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( ptr->start_x + (ptr->end_x - ptr->start_x - 16*2 )/2,
ptr->start_y+ ((ptr->end_y - ptr->start_y-16)/2),"橡皮");
}
//按钮边框
LCD_SetColors(CL_BLUE4 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,0,1);
}
/**
* @brief Draw_Clear_Button 清屏按钮的描绘函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Draw_Clear_Button(void *btn){
Touch_Button *ptr = (Touch_Button *) btn;
//释放按键
if(ptr->touch_flag == 0){
LCD_SetColors(CL_BUTTON_GREY,CL_WHITE);
ILI9341_DrawRectangle( ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
LCD_SetColors(CL_RED , CL_BUTTON_GREY);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( ptr->start_x + (ptr->end_x - ptr->start_x - 16*2)/2,
ptr->start_y +(ptr->end_y - ptr->start_y - 16)/2,"清屏");
}
else{ //按键按下
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,1,1);
LCD_SetColors(CL_RED,CL_WHITE);
/*选择字体,使用中英文显示时,尽量把英文选择成8*16的字体,
*中文字体大小是16*16的,需要其它字体请自行制作字模*/
/*这个函数只对英文字体起作用*/
LCD_SetFont(&Font8x16);
ILI9341_DispString_EN_CH( ptr->start_x + (ptr->end_x - ptr->start_x - 16*2 )/2,
ptr->start_y+ ((ptr->end_y - ptr->start_y-16)/2),"清屏");
}
//按钮边框
LCD_SetColors(CL_BLUE4 , CL_WHITE);
ILI9341_DrawRectangle(ptr->start_x,
ptr->start_y,
ptr->end_x - ptr->start_x,
ptr->end_y - ptr->start_y,0,1);
}
//==================================按钮的指令函数=====================================
//=====================================================================================
/**
* @brief Command_Select_Color 切换画刷颜色,颜色按键的功能执行函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Command_Select_Color(void *btn){
Touch_Button *ptr = (Touch_Button *)btn;
brush.color = ptr->para;
LCD_SetColors (brush.color , CL_WHITE );
}
/**
* @brief Command_Select_Brush 切换画刷颜色,画刷按键的功能执行函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Command_Select_Brush(void *btn){
Touch_Button *ptr = (Touch_Button *)btn;
brush.shape = (SHAPE)ptr->para;
LCD_SetColors(brush.color , CL_WHITE);
}
/**
* @brief Command_RUBBER_Palette 切换画刷颜色,清屏按键的功能执行函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Command_RUBBER_Palette(void *btn){
brush.color = CL_WHITE;
brush.shape = LINE_6_PIXCEL;
LCD_SetColors(brush.color , CL_WHITE);
}
/**
* @brief Command_Select_Brush 切换画刷颜色,清屏按键的功能执行函数
* @param btn Touch_Button 类型的按键参数
* @retval 无
*/
static void Command_Clear_Palette(void *btn){
LCD_SetColors(CL_WHITE , CL_WHITE);
ILI9341_DrawRectangle(PALETTE_START_X,
PALETTE_START_Y,
PALETTE_END_X-(PALETTE_START_X+1),
PALETTE_END_Y-PALETTE_START_Y ,1,1);
}
//==================================按钮的动作函数=====================================
//=====================================================================================
/**
* @brief Draw_Trail 在画板区域描绘触摸轨迹
* @param pre_x 上一点的x坐标
* @param pre_y 上一点的y坐标
* @param x 最新一点的x坐标
* @param y 最新一点的y坐标
* @param brush 画刷参数
* @retval 无
*/
void Draw_Trail(
int16_t pre_x,int16_t pre_y,
int16_t x,int16_t y,
Brush_Style* brush
){
//设置画板区域为活动窗口
/*触摸位置在画板区域*/
if((x > PALETTE_START_X)&&(pre_x > PALETTE_START_X)){
switch( brush->shape ){ // 根据画刷的不同绘画不同的轨迹
//描绘1像素宽度的轨迹线
case LINE_SING_PIXCEL:
if((pre_x < 0)&&(pre_y<0)){ //新的笔记
ILI9341_SetPointPixel(x,y,1);
}else{
ILI9341_DrawLine(pre_x,pre_y,x,y,1);
}
break;
case LINE_2_PIXCEL:
if(((x-1) < PALETTE_START_X )|| ((y-1) < PALETTE_START_X))
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,1);
break;
case LINE_4_PIXCEL:
if(x-2<PALETTE_START_X||pre_x-2<PALETTE_START_X) //画板左边界
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,2);
break;
case LINE_6_PIXCEL:
if(x-3<PALETTE_START_X||pre_x-3<PALETTE_START_X) //画板左边界
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,3);
break;
case LINE_8_PIXCEL:
if(x-4<PALETTE_START_X||pre_x-4<PALETTE_START_X) //画板左边界
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,4);
break;
case LINE_16_PIXCEL:
if(x-8<PALETTE_START_X||pre_x-8<PALETTE_START_X) //画板左边界
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,8);
break;
case LINE_20_PIXCEL:
if(x-10<PALETTE_START_X ||pre_x-10<PALETTE_START_X) //画板左边界
break;
LCD_DrawUniLineCircle(pre_x,pre_y,x,y,10);
break;
/*描绘带珠子的单像素线*/
case LINE_WITH_CIRCLE:
if(x-3<PALETTE_START_X||pre_x-3<PALETTE_START_X) //画板左边界
break;
if(pre_x< 0 || pre_y< 0){//新的笔迹
ILI9341_SetPointPixel(x,y,1);
}
else{ //继续上一次的笔迹
ILI9341_DrawLine(pre_x,pre_y,x,y,1);
ILI9341_DrawCircle(x,y,3,1,1);
}
break;
/*橡皮功能*/
case RUBBER:
if(x-20<PALETTE_START_X || //画板左边界
x+20>LCD_X_LENGTH || x-20<0 || //液晶左右边界
y+20>LCD_Y_LENGTH || y-20<0) //液晶上下边界
break;
// if(x>PALETTE_START_X+20)
{ LCD_SetColors(CL_WHITE,CL_WHITE);
ILI9341_DrawRectangle( x-40/2,y-40/2,40,40,1,1);
}
break;
}
}
}
/* ------------------------------------------end of file---------------------------------------- */
建立XPT2046驱动文件XPT2046_LCD_book.h
代码如下 :
#ifndef __XPT2046_LCD_BOOK_H__
#define __XPT2046_LCD_BOOK_H__
#include "stm32f10x.h"
/******************************* XPT2046 触摸屏触摸信号指示引脚定义(不使用中断) ***************************/
#define XPT2046_PENIRQ_GPIO_CLK RCC_APB2Periph_GPIOF
#define XPT2046_PENIRQ_GPIO_PORT GPIOF
#define XPT2046_PENIRQ_GPIO_PIN GPIO_Pin_9
/******************************* XPT2046 触摸屏模拟SPI引脚定义 ***************************/
#define XPT2046_SPI_GPIO_CLK RCC_APB2Periph_GPIOF| RCC_APB2Periph_GPIOG
#define XPT2046_SPI_CS_PIN GPIO_Pin_10
#define XPT2046_SPI_CS_PORT GPIOF
#define XPT2046_SPI_CLK_PIN GPIO_Pin_7
#define XPT2046_SPI_CLK_PORT GPIOG
#define XPT2046_SPI_MOSI_PIN GPIO_Pin_11
#define XPT2046_SPI_MOSI_PORT GPIOF
#define XPT2046_SPI_MISO_PIN GPIO_Pin_6
#define XPT2046_SPI_MISO_PORT GPIOF
#define XPT2046_CS_DISABLE() GPIO_SetBits ( XPT2046_SPI_CS_PORT, XPT2046_SPI_CS_PIN )
#define XPT2046_CS_ENABLE() GPIO_ResetBits ( XPT2046_SPI_CS_PORT, XPT2046_SPI_CS_PIN )
#define XPT2046_CLK_HIGH() GPIO_SetBits ( XPT2046_SPI_CLK_PORT, XPT2046_SPI_CLK_PIN )
#define XPT2046_CLK_LOW() GPIO_ResetBits ( XPT2046_SPI_CLK_PORT, XPT2046_SPI_CLK_PIN )
#define XPT2046_MOSI_1() GPIO_SetBits ( XPT2046_SPI_MOSI_PORT, XPT2046_SPI_MOSI_PIN )
#define XPT2046_MOSI_0() GPIO_ResetBits ( XPT2046_SPI_MOSI_PORT, XPT2046_SPI_MOSI_PIN )
#define XPT2046_MISO() GPIO_ReadInputDataBit ( XPT2046_SPI_MISO_PORT, XPT2046_SPI_MISO_PIN )
/******************************* XPT2046 触摸屏参数定义 ***************************/
#define XPT2046_CHANNEL_X 0x90 //通道Y+的选择控制字
#define XPT2046_CHANNEL_Y 0xd0 //通道X+的选择控制字
void XPT2046_ReadAdc_XY ( int16_t * sX_Ad, int16_t * sY_Ad );
#endif /* __BSP_TOUCH_H */
建立XPT2046驱动文件XPT2046_LCD_book.c
代码如下 :
#include "XPT2046_LCD_book.h"
#include "LCD_Draw_book.h"
#include "USART_book.h"
#include "SPI_book.h"
//======================================================================
======================== 模拟SPI通讯 ===============================
//======================================================================
/**
* @brief XPT2046_GPIO_Init 初始化函数
* @param 无
* @retval 无
*/
void XPT2046_GPIO_Init(void){
GPIO_InitTypeDef GPIO_InitStructure;
/* 开启GPIO时钟 */
RCC_APB2PeriphClockCmd ( XPT2046_SPI_GPIO_CLK|XPT2046_PENIRQ_GPIO_CLK, ENABLE );
/* 模拟SPI GPIO初始化 */
GPIO_InitStructure.GPIO_Pin=XPT2046_SPI_CLK_PIN;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_10MHz ;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_Init(XPT2046_SPI_CLK_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = XPT2046_SPI_MOSI_PIN;
GPIO_Init(XPT2046_SPI_MOSI_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = XPT2046_SPI_MISO_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(XPT2046_SPI_MISO_PORT, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = XPT2046_SPI_CS_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(XPT2046_SPI_CS_PORT, &GPIO_InitStructure);
/* 拉低片选,选择XPT2046 */
XPT2046_CS_ENABLE();
//触摸屏触摸信号指示引脚,不使用中断
GPIO_InitStructure.GPIO_Pin = XPT2046_PENIRQ_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; // 上拉输入
GPIO_Init(XPT2046_PENIRQ_GPIO_PORT, &GPIO_InitStructure);
}
/**
* @brief 用于 XPT2046 的简单微秒级延时函数
* @param nCount :延时计数值,单位为微妙
* @retval 无
*/
static void XPT2046_DelayUS ( __IO uint32_t ulCount ){
uint32_t i;
for ( i = 0; i < ulCount; i ++ ) {
uint8_t uc = 12; //设置值为12,大约延1微秒
while ( uc -- ); //延1微秒
}
}
/**
* @brief XPT2046 的写入命令
* @param ucCmd :命令
* 该参数为以下值之一:
* @arg 0x90 :通道Y+的选择控制字
* @arg 0xd0 :通道X+的选择控制字
* @retval 无
*/
static void XPT2046_WriteCMD(uint8_t ucCmd){
uint8_t i ;
//片选开始
XPT2046_CS_ENABLE();//引脚的出示状态
XPT2046_MOSI_0();
XPT2046_CLK_LOW();
//产生8个时钟发送数据
for(i=0 ;i<8 ;i++ ){
//指令要提前准备好
((ucCmd &(0x80>>i)) ==0 ) ? XPT2046_MOSI_0() : XPT2046_MOSI_1();
XPT2046_DelayUS(5);
XPT2046_CLK_HIGH();//时钟准备
XPT2046_DelayUS(5);
XPT2046_CLK_LOW();
}
}
/**
* @brief XPT2046 的读取命令
* @param 无
* @retval 读取到的数据
*/
//读取函数 AD 为12位的
static uint16_t XPT2046_ReadCMD(void){
uint8_t i ;
uint16_t usTemp = 0;
XPT2046_MOSI_0();
XPT2046_CLK_HIGH();
for ( i=0;i<12;i++ ){
usTemp<<=1;
XPT2046_CLK_LOW();
(XPT2046_MISO() == Bit_SET )?(usTemp |= 0x01):(usTemp |= 0x00);
XPT2046_CLK_HIGH();
}
XPT2046_CS_DISABLE();
return usTemp;
}
/**
* @brief 对 XPT2046 选择一个模拟通道后,
* 启动ADC,并返回ADC采样结果
* @param ucChannel
* 该参数为以下值之一:
* @arg 0x90 :通道Y+的选择控制字
* @arg 0xd0 :通道X+的选择控制字
* @retval 该通道的ADC采样结果
*/
static uint16_t XPT2046_ReadAdc( uint8_t ucChannel ){
XPT2046_WriteCMD(ucChannel);
return XPT2046_ReadCMD();
}
/**
* @brief 读取 XPT2046 的X通道和Y通道的AD值(12 bit,最大是4096)
* @param sX_Ad :存放X通道AD值的地址
* @param sY_Ad :存放Y通道AD值的地址
* @retval 无
*/
void XPT2046_ReadAdc_XY ( int16_t * sX_Ad, int16_t * sY_Ad ){
*sX_Ad = XPT2046_ReadAdc(XPT2046_CHANNEL_X);
XPT2046_DelayUS(1);
*sY_Ad = XPT2046_ReadAdc (XPT2046_CHANNEL_Y);
//#ifdef _USEUSARTSHOW //#endif
printf("触摸点 X: 0x%x Y:0x%x \n" ,*sX_Ad ,*sY_Ad );
//#endif
}
建立XPT2046驱动文件XPT2046_LCD_Function_book.h
代码如下 :
#ifndef __XPT2046_LCD_FUNCTION_BOOK_H__
#define __XPT2046_LCD_FUNCTION_BOOK_H__
#include "stm32f10x.h"
typedef union {
struct{
unsigned char BIT0:1;unsigned char BIT1:1;unsigned char BIT2:1;unsigned char BIT3:1;
unsigned char BIT4:1;unsigned char BIT5:1;unsigned char BIT6:1;unsigned char BIT7:1;
//unsigned char BIT8:1;unsigned char BIT9:1;unsigned char BIT10:1;unsigned char BIT11:1;
//unsigned char BIT12:1;unsigned char BIT13:1;unsigned char BIT14:1;unsigned char BIT15:1;
}DATA_BIT;
uint8_t DATA_BYTE;
}Per_XPT2046_LCD_type;
/*******************************触摸状态机相关*************************************/
typedef enum
{
XPT2046_STATE_RELEASE = 0, //触摸释放
XPT2046_STATE_WAITING, //触摸按下
XPT2046_STATE_PRESSED, //触摸按下
}enumTouchState ;
#define TOUCH_NOT 0
#define TOUCH_PRESSED 1
#define TOUCH_NOT_PRESSED 2
//触摸消抖阈值
#define DURIATION_TIME 3
//触屏信号有效电平
#define XPT2046_PENIRQ_ActiveLevel 0
#define XPT2046_PENIRQ_Read() GPIO_ReadInputDataBit ( XPT2046_PENIRQ_GPIO_PORT, XPT2046_PENIRQ_GPIO_PIN )
/// 声明 XPT2046 相关的外部全局变量
extern volatile uint8_t ucXPT2046_TouchFlag;
extern volatile Per_XPT2046_LCD_type XPT2046_LCD_flag;
#define bXPT2046_LCD_10ms XPT2046_LCD_flag.DATA_BIT.BIT0
/*******************************触摸坐标判断 *************************************/
typedef struct{ //液晶坐标结构体
/*负数值表示无新数据*/
int16_t x; //记录最新的触摸参数值
int16_t y;
/*用于记录连续触摸时(长按)的上一次触摸位置*/
int16_t pre_x;
int16_t pre_y;
} strType_XPT2046_Coordinate;
typedef struct{ //校准因子结构体
float An, //注:sizeof(long double) = 8
Bn,
Cn,
Dn,
En,
Fn,
Divider;
} strType_XPT2046_Calibration;
typedef struct{ //校准系数结构体(最终使用)
float dX_X,
dX_Y,
dX,
dY_X,
dY_Y,
dY;
} strType_XPT2046_TouchPara;
/// 声明 XPT2046 相关的外部全局变量
extern strType_XPT2046_TouchPara strXPT2046_TouchPara[];
// 触摸校验4点校验点
extern strType_XPT2046_Coordinate strCrossCoordinate[4];
extern strType_XPT2046_Coordinate strScreenSample[4];
//======================================================================
======================== 触摸状态机制通讯 ==========================
//======================================================================
/** 状态机制
* @brief 触摸屏检测状态机
* @retval 触摸状态
* 该返回值为以下值之一:
* @arg TOUCH_PRESSED :触摸按下
* @arg TOUCH_NOT_PRESSED :无触摸
*/
uint8_t XPT2046_TouchDetect(void);
uint8_t XPT2046_ReadAdc_Smooth_XY ( strType_XPT2046_Coordinate * pScreenCoordinate );
/**
* @brief XPT2046 触摸屏校准初始化
* @param LCD_Mode:指定要校正哪种液晶扫描模式的参数
* @note 本函数调用后会把液晶模式设置为LCD_Mode
* @retval 校准结果
* 该返回值为以下值之一:
* @arg 1 :校准成功
* @arg 0 :校准失败
*/
void XPT2046_Touch_Calibrate_SetStand4Pint(void);
/**
* @brief XPT2046 触摸屏校准
* @param LCD_Mode:指定要校正哪种液晶扫描模式的参数
* @note 本函数调用后会把液晶模式设置为LCD_Mode
* @retval 校准结果
* 该返回值为以下值之一:
* @arg 1 :校准成功
* @arg 0 :校准失败
*/
uint8_t XPT2046_Touch_Calibrate ( uint8_t LCD_Mode );
/**
* @brief 获取 XPT2046 触摸点(校准后)的坐标
* @param pDisplayCoordinate :该指针存放获取到的触摸点坐标
* @param pTouchPara:坐标校准系数
* @retval 获取情况
* 该返回值为以下值之一:
* @arg 1 :获取成功
* @arg 0 :获取失败
*/
uint8_t XPT2046_Get_TouchedPoint ( strType_XPT2046_Coordinate * pDisplayCoordinate, strType_XPT2046_TouchPara * pTouchPara );
/**
* @brief 触摸屏被按下的时候会调用本函数
* @param touch包含触摸坐标的结构体
* @note 请在本函数中编写自己的触摸按下处理应用
* @retval 无
*/
void XPT2046_TouchDown(strType_XPT2046_Coordinate * touch);
/**
* @brief 触摸屏释放的时候会调用本函数
* @param touch包含触摸坐标的结构体
* @note 请在本函数中编写自己的触摸释放处理应用
* @retval 无
*/
void XPT2046_TouchUp(strType_XPT2046_Coordinate * touch);
/**
* @brief 检测到触摸中断时调用的处理函数,通过它调用tp_down 和tp_up汇报触摸点
* @note 本函数需要在while循环里被调用,也可使用定时器定时调用
* 例如,可以每隔5ms调用一次,消抖阈值宏DURIATION_TIME可设置为2,这样每秒最多可以检测100个点。
* 可在XPT2046_TouchDown及XPT2046_TouchUp函数中编写自己的触摸应用
* @param none
* @retval none
*/
void XPT2046_TouchEvenHandler(void );
#endif /* __BSP_TOUCH_H */
建立XPT2046驱动文件XPT2046_LCD_Function_book.c
代码如下 :
#include "XPT2046_LCD_Function_book.h"
#include "XPT2046_LCD_book.h"
#include "LCD_book.h"
#include "XPT2046_LCD_Device_book.h"
#include "USART_book.h"
//======================================================================
======================== 触摸状态机制通讯 ==========================
//======================================================================
/** 状态机制
* @brief 触摸屏检测状态机
* @retval 触摸状态
* 该返回值为以下值之一:
* @arg TOUCH_PRESSED :触摸按下
* @arg TOUCH_NOT_PRESSED :无触摸
*/
volatile uint8_t ucXPT2046_TouchFlag;
volatile Per_XPT2046_LCD_type XPT2046_LCD_flag;
uint8_t XPT2046_TouchDetect(void){
if(bXPT2046_LCD_10ms == 0){return TOUCH_NOT ;}
bXPT2046_LCD_10ms = 0;
static enumTouchState touch_state = XPT2046_STATE_RELEASE;
static uint8_t count_Touch = 0;
uint8_t detectResult = TOUCH_NOT_PRESSED;
switch(touch_state){
case XPT2046_STATE_RELEASE:
if(XPT2046_PENIRQ_Read() == XPT2046_PENIRQ_ActiveLevel){
touch_state = XPT2046_STATE_WAITING;
detectResult = TOUCH_NOT_PRESSED;
}else{
touch_state = XPT2046_STATE_RELEASE;
detectResult = TOUCH_NOT_PRESSED;
}
break;
case XPT2046_STATE_WAITING:
if(XPT2046_PENIRQ_Read() == XPT2046_PENIRQ_ActiveLevel){
if(count_Touch++>DURIATION_TIME){
count_Touch = 0;
touch_state = XPT2046_STATE_PRESSED;
detectResult = TOUCH_PRESSED;
}else{
touch_state = XPT2046_STATE_WAITING;
detectResult = TOUCH_NOT_PRESSED;
}
}else{
count_Touch = 0;
touch_state = XPT2046_STATE_RELEASE;
detectResult = TOUCH_NOT_PRESSED;
}
break;
case XPT2046_STATE_PRESSED:
if(XPT2046_PENIRQ_Read() == XPT2046_PENIRQ_ActiveLevel){
touch_state = XPT2046_STATE_PRESSED;
detectResult = TOUCH_PRESSED;
}else{
touch_state = XPT2046_STATE_RELEASE;
detectResult = TOUCH_NOT_PRESSED;
}
break;
}
return detectResult;
}
//======================================================================
======================== 触摸坐标采集 ===============================
//======================================================================
#if 0 //注意:校正较精准,但是相对复杂,速度较慢
/**
* @brief 在触摸 XPT2046 屏幕时获取一组坐标的AD值,并对该坐标进行滤波
* @param 无
* @retval 滤波之后的坐标AD值
*/
static uint8_t XPT2046_ReadAdc_Smooth_XY ( strType_XPT2046_Coordinate * pScreenCoordinate ){
uint8_t ucCount = 0;
int16_t sAD_X, sAD_Y;
int16_t sBufferArray [ 2 ] [ 9 ] = { { 0 }, { 0 } }; //坐标X和Y进行9次采样
int32_t lAverage [ 3 ], lDifference [ 3 ];
do{
XPT2046_ReadAdc_XY ( & sAD_X, & sAD_Y );
sBufferArray [ 0 ] [ ucCount ] = sAD_X;
sBufferArray [ 1 ] [ ucCount ] = sAD_Y;
ucCount ++;
}while ( ( XPT2046_EXTI_Read() == XPT2046_EXTI_ActiveLevel ) && ( ucCount < 9 ) ); //用户点击触摸屏时即TP_INT_IN信号为低 并且 ucCount<9*/
/*如果触笔弹起*/
if ( XPT2046_EXTI_Read() != XPT2046_EXTI_ActiveLevel )
ucXPT2046_TouchFlag = 0; //触摸中断标志复位
/* 如果成功采样9次,进行滤波 */
if ( ucCount == 9 ){
/* 为减少运算量,分别分3组取平均值 */
lAverage [ 0 ] = ( sBufferArray [ 0 ] [ 0 ] + sBufferArray [ 0 ] [ 1 ] + sBufferArray [ 0 ] [ 2 ] ) / 3;
lAverage [ 1 ] = ( sBufferArray [ 0 ] [ 3 ] + sBufferArray [ 0 ] [ 4 ] + sBufferArray [ 0 ] [ 5 ] ) / 3;
lAverage [ 2 ] = ( sBufferArray [ 0 ] [ 6 ] + sBufferArray [ 0 ] [ 7 ] + sBufferArray [ 0 ] [ 8 ] ) / 3;
/* 计算3组数据的差值 */
lDifference [ 0 ] = lAverage [ 0 ]-lAverage [ 1 ];
lDifference [ 1 ] = lAverage [ 1 ]-lAverage [ 2 ];
lDifference [ 2 ] = lAverage [ 2 ]-lAverage [ 0 ];
/* 对上述差值取绝对值 */
lDifference [ 0 ] = lDifference [ 0 ]>0?lDifference [ 0 ]: ( -lDifference [ 0 ] );
lDifference [ 1 ] = lDifference [ 1 ]>0?lDifference [ 1 ]: ( -lDifference [ 1 ] );
lDifference [ 2 ] = lDifference [ 2 ]>0?lDifference [ 2 ]: ( -lDifference [ 2 ] );
/* 判断绝对差值是否都超过差值门限,如果这3个绝对差值都超过门限值,则判定这次采样点为野点,抛弃采样点,差值门限取为2 */
if ( lDifference [ 0 ] > XPT2046_THRESHOLD_CalDiff && lDifference [ 1 ] > XPT2046_THRESHOLD_CalDiff && lDifference [ 2 ] > XPT2046_THRESHOLD_CalDiff )
return 0;
/* 计算它们的平均值,同时赋值给strScreenCoordinate */
if ( lDifference [ 0 ] < lDifference [ 1 ] ){
if ( lDifference [ 2 ] < lDifference [ 0 ] )
pScreenCoordinate ->x = ( lAverage [ 0 ] + lAverage [ 2 ] ) / 2;
else
pScreenCoordinate ->x = ( lAverage [ 0 ] + lAverage [ 1 ] ) / 2;
}
else if ( lDifference [ 2 ] < lDifference [ 1 ] )
pScreenCoordinate -> x = ( lAverage [ 0 ] + lAverage [ 2 ] ) / 2;
else
pScreenCoordinate ->x = ( lAverage [ 1 ] + lAverage [ 2 ] ) / 2;
/* 同上,计算Y的平均值 */
lAverage [ 0 ] = ( sBufferArray [ 1 ] [ 0 ] + sBufferArray [ 1 ] [ 1 ] + sBufferArray [ 1 ] [ 2 ] ) / 3;
lAverage [ 1 ] = ( sBufferArray [ 1 ] [ 3 ] + sBufferArray [ 1 ] [ 4 ] + sBufferArray [ 1 ] [ 5 ] ) / 3;
lAverage [ 2 ] = ( sBufferArray [ 1 ] [ 6 ] + sBufferArray [ 1 ] [ 7 ] + sBufferArray [ 1 ] [ 8 ] ) / 3;
lDifference [ 0 ] = lAverage [ 0 ] - lAverage [ 1 ];
lDifference [ 1 ] = lAverage [ 1 ] - lAverage [ 2 ];
lDifference [ 2 ] = lAverage [ 2 ] - lAverage [ 0 ];
/* 取绝对值 */
lDifference [ 0 ] = lDifference [ 0 ] > 0 ? lDifference [ 0 ] : ( - lDifference [ 0 ] );
lDifference [ 1 ] = lDifference [ 1 ] > 0 ? lDifference [ 1 ] : ( - lDifference [ 1 ] );
lDifference [ 2 ] = lDifference [ 2 ] > 0 ? lDifference [ 2 ] : ( - lDifference [ 2 ] );
if ( lDifference [ 0 ] > XPT2046_THRESHOLD_CalDiff && lDifference [ 1 ] > XPT2046_THRESHOLD_CalDiff && lDifference [ 2 ] > XPT2046_THRESHOLD_CalDiff )
return 0;
if ( lDifference [ 0 ] < lDifference [ 1 ] ){
if ( lDifference [ 2 ] < lDifference [ 0 ] )
pScreenCoordinate ->y = ( lAverage [ 0 ] + lAverage [ 2 ] ) / 2;
else
pScreenCoordinate ->y = ( lAverage [ 0 ] + lAverage [ 1 ] ) / 2;
}
else if ( lDifference [ 2 ] < lDifference [ 1 ] )
pScreenCoordinate ->y = ( lAverage [ 0 ] + lAverage [ 2 ] ) / 2;
else
pScreenCoordinate ->y = ( lAverage [ 1 ] + lAverage [ 2 ] ) / 2;
return 1;
}
else if ( ucCount > 1 ){
pScreenCoordinate ->x = sBufferArray [ 0 ] [ 0 ];
pScreenCoordinate ->y = sBufferArray [ 1 ] [ 0 ];
return 0;
}
return 0;
}
#else //注意:画板应用实例专用,不是很精准,但是简单,速度比较快
uint8_t XPT2046_ReadAdc_Smooth_XY ( strType_XPT2046_Coordinate * pScreenCoordinate ){
uint8_t ucCount = 0, i;
int16_t sAD_X, sAD_Y;
int16_t sBufferArray [ 2 ] [ 10 ] = { { 0 },{ 0 } }; //坐标X和Y进行多次采样
//存储采样中的最小值、最大值
int32_t lX_Min, lX_Max, lY_Min, lY_Max;
if ( XPT2046_PENIRQ_Read() != XPT2046_PENIRQ_ActiveLevel ){return 0;}
/* 循环采样10次 */
do{
XPT2046_ReadAdc_XY ( & sAD_X, & sAD_Y );
sBufferArray [ 0 ] [ ucCount ] = sAD_X;
sBufferArray [ 1 ] [ ucCount ] = sAD_Y;
ucCount ++;
}while ( ( XPT2046_PENIRQ_Read() == XPT2046_PENIRQ_ActiveLevel ) && ( ucCount < 10 ) );
//用户点击触摸屏时即TP_INT_IN信号为低 并且 ucCount<10
/*如果触笔弹起*/
if ( XPT2046_PENIRQ_Read() != XPT2046_PENIRQ_ActiveLevel )
ucXPT2046_TouchFlag = 0; //中断标志复位
/*如果成功采样10个样本*/
if ( ucCount ==10 ){
lX_Max = lX_Min = sBufferArray [ 0 ] [ 0 ];
lY_Max = lY_Min = sBufferArray [ 1 ] [ 0 ];
for ( i = 1; i < 10; i ++ ){
if ( sBufferArray[ 0 ] [ i ] < lX_Min )
lX_Min = sBufferArray [ 0 ] [ i ];
else if ( sBufferArray [ 0 ] [ i ] > lX_Max )
lX_Max = sBufferArray [ 0 ] [ i ];
}
for ( i = 1; i < 10; i ++ ){
if ( sBufferArray [ 1 ] [ i ] < lY_Min )
lY_Min = sBufferArray [ 1 ] [ i ];
else if ( sBufferArray [ 1 ] [ i ] > lY_Max )
lY_Max = sBufferArray [ 1 ] [ i ];
}
/*去除最小值和最大值之后求平均值*/
pScreenCoordinate ->x = ( sBufferArray [ 0 ] [ 0 ] + sBufferArray [ 0 ] [ 1 ] + sBufferArray [ 0 ] [ 2 ] + sBufferArray [ 0 ] [ 3 ] + sBufferArray [ 0 ] [ 4 ] +
sBufferArray [ 0 ] [ 5 ] + sBufferArray [ 0 ] [ 6 ] + sBufferArray [ 0 ] [ 7 ] + sBufferArray [ 0 ] [ 8 ] + sBufferArray [ 0 ] [ 9 ] - lX_Min-lX_Max ) >> 3;
pScreenCoordinate ->y = ( sBufferArray [ 1 ] [ 0 ] + sBufferArray [ 1 ] [ 1 ] + sBufferArray [ 1 ] [ 2 ] + sBufferArray [ 1 ] [ 3 ] + sBufferArray [ 1 ] [ 4 ] +
sBufferArray [ 1 ] [ 5 ] + sBufferArray [ 1 ] [ 6 ] + sBufferArray [ 1 ] [ 7 ] + sBufferArray [ 1 ] [ 8 ] + sBufferArray [ 1 ] [ 9 ] - lY_Min-lY_Max ) >> 3;
return 1;
}
return 0;
}
#endif
//======================================================================
======================== 触摸坐标校准算法 ===============================
//======================================================================
/**
* @brief 计算 XPT2046 触摸坐标校正系数(注意:只有在LCD和触摸屏间的误差角度非常小时,才能运用下面公式)
* @param pDisplayCoordinate :屏幕人为显示的已知坐标
* @param pstrScreenSample :对已知坐标点触摸时 XPT2046 产生的坐标
* @param pCalibrationFactor :根据人为设定坐标和采样回来的坐标计算出来的屏幕触摸校正系数
* @retval 计算状态
* 该返回值为以下值之一:
* @arg 1 :计算成功
* @arg 0 :计算失败
*/
/******************************* 定义 XPT2046 全局变量 ***************************/
//默认触摸参数,不同的屏幕稍有差异,可重新调用触摸校准函数获取
strType_XPT2046_TouchPara strXPT2046_TouchPara[] = {
-0.006464, -0.073259, 280.358032, 0.074878, 0.002052, -6.545977,//扫描方式0
0.086314, 0.001891, -12.836658, -0.003722, -0.065799, 254.715714,//扫描方式1
0.002782, 0.061522, -11.595689, 0.083393, 0.005159, -15.650089,//扫描方式2
0.089743, -0.000289, -20.612209, -0.001374, 0.064451, -16.054003,//扫描方式3
0.000767, -0.068258, 250.891769, -0.085559, -0.000195, 334.747650,//扫描方式4
-0.084744, 0.000047, 323.163147, -0.002109, -0.066371, 260.985809,//扫描方式5
-0.001848, 0.066984, -12.807136, -0.084858, -0.000805, 333.395386,//扫描方式6
-0.085470, -0.000876, 334.023163, -0.003390, 0.064725, -6.211169,//扫描方式7
};
static uint8_t XPT2046_Calculate_CalibrationFactor (
strType_XPT2046_Coordinate * pDisplayCoordinate,
strType_XPT2046_Coordinate * pScreenSample,
strType_XPT2046_Calibration * pCalibrationFactor
){
uint8_t ucRet = 1;
/* K= ( X0-X2 ) ( Y1-Y2 )- ( X1-X2 ) ( Y0-Y2 ) */
pCalibrationFactor -> Divider = ( ( pScreenSample [ 0 ] .x - pScreenSample [ 2 ] .x ) * ( pScreenSample [ 1 ] .y - pScreenSample [ 2 ] .y ) ) -
( ( pScreenSample [ 1 ] .x - pScreenSample [ 2 ] .x ) * ( pScreenSample [ 0 ] .y - pScreenSample [ 2 ] .y ) ) ;
if ( pCalibrationFactor -> Divider == 0 )
ucRet = 0;
else{
/* A= ( ( XD0-XD2 ) ( Y1-Y2 )- ( XD1-XD2 ) ( Y0-Y2 ) )/K */
pCalibrationFactor -> An = ( ( pDisplayCoordinate [ 0 ] .x - pDisplayCoordinate [ 2 ] .x ) * ( pScreenSample [ 1 ] .y - pScreenSample [ 2 ] .y ) ) -
( ( pDisplayCoordinate [ 1 ] .x - pDisplayCoordinate [ 2 ] .x ) * ( pScreenSample [ 0 ] .y - pScreenSample [ 2 ] .y ) );
/* B= ( ( X0-X2 ) ( XD1-XD2 )- ( XD0-XD2 ) ( X1-X2 ) )/K */
pCalibrationFactor -> Bn = ( ( pScreenSample [ 0 ] .x - pScreenSample [ 2 ] .x ) * ( pDisplayCoordinate [ 1 ] .x - pDisplayCoordinate [ 2 ] .x ) ) -
( ( pDisplayCoordinate [ 0 ] .x - pDisplayCoordinate [ 2 ] .x ) * ( pScreenSample [ 1 ] .x - pScreenSample [ 2 ] .x ) );
/* C= ( Y0 ( X2XD1-X1XD2 )+Y1 ( X0XD2-X2XD0 )+Y2 ( X1XD0-X0XD1 ) )/K */
pCalibrationFactor -> Cn = ( pScreenSample [ 2 ] .x * pDisplayCoordinate [ 1 ] .x - pScreenSample [ 1 ] .x * pDisplayCoordinate [ 2 ] .x ) * pScreenSample [ 0 ] .y +
( pScreenSample [ 0 ] .x * pDisplayCoordinate [ 2 ] .x - pScreenSample [ 2 ] .x * pDisplayCoordinate [ 0 ] .x ) * pScreenSample [ 1 ] .y +
( pScreenSample [ 1 ] .x * pDisplayCoordinate [ 0 ] .x - pScreenSample [ 0 ] .x * pDisplayCoordinate [ 1 ] .x ) * pScreenSample [ 2 ] .y ;
/* D= ( ( YD0-YD2 ) ( Y1-Y2 )- ( YD1-YD2 ) ( Y0-Y2 ) )/K */
pCalibrationFactor -> Dn = ( ( pDisplayCoordinate [ 0 ] .y - pDisplayCoordinate [ 2 ] .y ) * ( pScreenSample [ 1 ] .y - pScreenSample [ 2 ] .y ) ) -
( ( pDisplayCoordinate [ 1 ] .y - pDisplayCoordinate [ 2 ] .y ) * ( pScreenSample [ 0 ] .y - pScreenSample [ 2 ] .y ) ) ;
/* E= ( ( X0-X2 ) ( YD1-YD2 )- ( YD0-YD2 ) ( X1-X2 ) )/K */
pCalibrationFactor -> En = ( ( pScreenSample [ 0 ] .x - pScreenSample [ 2 ] .x ) * ( pDisplayCoordinate [ 1 ] .y - pDisplayCoordinate [ 2 ] .y ) ) -
( ( pDisplayCoordinate [ 0 ] .y - pDisplayCoordinate [ 2 ] .y ) * ( pScreenSample [ 1 ] .x - pScreenSample [ 2 ] .x ) ) ;
/* F= ( Y0 ( X2YD1-X1YD2 )+Y1 ( X0YD2-X2YD0 )+Y2 ( X1YD0-X0YD1 ) )/K */
pCalibrationFactor -> Fn = ( pScreenSample [ 2 ] .x * pDisplayCoordinate [ 1 ] .y - pScreenSample [ 1 ] .x * pDisplayCoordinate [ 2 ] .y ) * pScreenSample [ 0 ] .y +
( pScreenSample [ 0 ] .x * pDisplayCoordinate [ 2 ] .y - pScreenSample [ 2 ] .x * pDisplayCoordinate [ 0 ] .y ) * pScreenSample [ 1 ] .y +
( pScreenSample [ 1 ] .x * pDisplayCoordinate [ 0 ] .y - pScreenSample [ 0 ] .x * pDisplayCoordinate [ 1 ] .y ) * pScreenSample [ 2 ] .y;
}
return ucRet;
}
//======================================================================
======================== 触摸坐标校准执行 ===============================
//======================================================================
/**
* @brief XPT2046 触摸屏校准初始化
* @param LCD_Mode:指定要校正哪种液晶扫描模式的参数
* @note 本函数调用后会把液晶模式设置为LCD_Mode
* @retval 校准结果
* 该返回值为以下值之一:
* @arg 1 :校准成功
* @arg 0 :校准失败
*/
strType_XPT2046_Coordinate strCrossCoordinate[4];
strType_XPT2046_Coordinate strScreenSample[4];
void XPT2046_Touch_Calibrate_SetStand4Pint(void){
/* 设定“十”字交叉点的坐标 */
strCrossCoordinate [0].x = LCD_X_LENGTH >> 2;
strCrossCoordinate[0].y = LCD_Y_LENGTH >> 2;
strCrossCoordinate[1].x = strCrossCoordinate[0].x;
strCrossCoordinate[1].y = ( LCD_Y_LENGTH * 3 ) >> 2;
strCrossCoordinate[2].x = ( LCD_X_LENGTH * 3 ) >> 2;
strCrossCoordinate[2].y = strCrossCoordinate[1].y;
strCrossCoordinate[3].x = strCrossCoordinate[2].x;
strCrossCoordinate[3].y = strCrossCoordinate[0].y;
}
/**
* @brief XPT2046 触摸屏校准
* @param LCD_Mode:指定要校正哪种液晶扫描模式的参数
* @note 本函数调用后会把液晶模式设置为LCD_Mode
* @retval 校准结果
* 该返回值为以下值之一:
* @arg 1 :校准成功
* @arg 0 :校准失败
*/
uint8_t XPT2046_Touch_Calibrate ( uint8_t LCD_Mode ){
uint8_t i;
uint16_t usTest_x = 0, usTest_y = 0, usGap_x = 0, usGap_y = 0;
strType_XPT2046_Calibration CalibrationFactor;
XPT2046_Calculate_CalibrationFactor ( strCrossCoordinate, strScreenSample, & CalibrationFactor ) ; //用原始参数计算出 原始参数与坐标的转换系数
if ( CalibrationFactor.Divider == 0 ) goto Failure; //进行校验完成
usTest_x = ( ( CalibrationFactor.An * strScreenSample[3].x ) + ( CalibrationFactor.Bn * strScreenSample[3].y ) + CalibrationFactor.Cn ) / CalibrationFactor.Divider; //取一个点计算X值
usTest_y = ( ( CalibrationFactor.Dn * strScreenSample[3].x ) + ( CalibrationFactor.En * strScreenSample[3].y ) + CalibrationFactor.Fn ) / CalibrationFactor.Divider; //取一个点计算Y值
usGap_x = ( usTest_x > strCrossCoordinate[3].x ) ? ( usTest_x - strCrossCoordinate[3].x ) : ( strCrossCoordinate[3].x - usTest_x ); //实际X坐标与计算坐标的绝对差
usGap_y = ( usTest_y > strCrossCoordinate[3].y ) ? ( usTest_y - strCrossCoordinate[3].y ) : ( strCrossCoordinate[3].y - usTest_y ); //实际Y坐标与计算坐标的绝对差
if ( ( usGap_x > 15 ) || ( usGap_y > 15 ) ) goto Failure; //可以通过修改这两个值的大小来调整精度
/* 校准系数为全局变量 */
strXPT2046_TouchPara[LCD_Mode].dX_X = ( CalibrationFactor.An * 1.0 ) / CalibrationFactor.Divider;
strXPT2046_TouchPara[LCD_Mode].dX_Y = ( CalibrationFactor.Bn * 1.0 ) / CalibrationFactor.Divider;
strXPT2046_TouchPara[LCD_Mode].dX = ( CalibrationFactor.Cn * 1.0 ) / CalibrationFactor.Divider;
strXPT2046_TouchPara[LCD_Mode].dY_X = ( CalibrationFactor.Dn * 1.0 ) / CalibrationFactor.Divider;
strXPT2046_TouchPara[LCD_Mode].dY_Y = ( CalibrationFactor.En * 1.0 ) / CalibrationFactor.Divider;
strXPT2046_TouchPara[LCD_Mode].dY = ( CalibrationFactor.Fn * 1.0 ) / CalibrationFactor.Divider;
#if 1 //输出调试信息,注意要先初始化串口
{
float * ulHeadAddres ;
/* 打印校校准系数 */
printf ( "显示模式【%d】校准系数如下:", LCD_Mode);
ulHeadAddres = ( float* ) ( & strXPT2046_TouchPara[LCD_Mode] );
for ( i = 0; i < 6; i ++ )
{
printf ( "%12f,", *ulHeadAddres++ );
}
printf("\r\n");
}
#endif
return 1;
Failure:
return 0;
}
/**
* @brief 获取 XPT2046 触摸点(校准后)的坐标
* @param pDisplayCoordinate :该指针存放获取到的触摸点坐标
* @param pTouchPara:坐标校准系数
* @retval 获取情况
* 该返回值为以下值之一:
* @arg 1 :获取成功
* @arg 0 :获取失败
*/
uint8_t XPT2046_Get_TouchedPoint ( strType_XPT2046_Coordinate * pDisplayCoordinate, strType_XPT2046_TouchPara * pTouchPara )
{
uint8_t ucRet = 1; //若正常,则返回0
strType_XPT2046_Coordinate strScreenCoordinate;
if ( XPT2046_ReadAdc_Smooth_XY ( & strScreenCoordinate ) )
{
pDisplayCoordinate ->x = ( ( pTouchPara[LCD_SCAN_MODE].dX_X * strScreenCoordinate.x ) + ( pTouchPara[LCD_SCAN_MODE].dX_Y * strScreenCoordinate.y ) + pTouchPara[LCD_SCAN_MODE].dX );
pDisplayCoordinate ->y = ( ( pTouchPara[LCD_SCAN_MODE].dY_X * strScreenCoordinate.x ) + ( pTouchPara[LCD_SCAN_MODE].dY_Y * strScreenCoordinate.y ) + pTouchPara[LCD_SCAN_MODE].dY );
}
else ucRet = 0; //如果获取的触点信息有误,则返回0
return ucRet;
}
//--------------------------------按键动作------------------------------------
//----------------------------------------------------------------------------
/**
* @brief 触摸屏被按下的时候会调用本函数
* @param touch包含触摸坐标的结构体
* @note 请在本函数中编写自己的触摸按下处理应用
* @retval 无
*/
void XPT2046_TouchDown(strType_XPT2046_Coordinate * touch){
//如果是负数 表示之前已经处理过完毕
if((touch->pre_x == -1)&&(touch->pre_y==-1)){
return;
}
/***在此处编写自己的触摸按下处理应用***/
Touch_Button_Down(touch->x,touch->y);
/*处理描绘轨迹*/
Draw_Trail(touch->pre_x,touch->pre_y,touch->x,touch->y,&brush);
/***在上面编写自己的触摸按下处理应用***/
}
/**
* @brief 触摸屏释放的时候会调用本函数
* @param touch包含触摸坐标的结构体
* @note 请在本函数中编写自己的触摸释放处理应用
* @retval 无
*/
void XPT2046_TouchUp(strType_XPT2046_Coordinate * touch)
{
//若为负值表示之前已处理过
if(touch->pre_x == -1 && touch->pre_x == -1)
return;
/***在此处编写自己的触摸释放处理应用***/
/*处理触摸画板的选择按钮*/
Touch_Button_Up(touch->pre_x,touch->pre_y);
/***在上面编写自己的触摸释放处理应用***/
}
/**
* @brief 检测到触摸中断时调用的处理函数,通过它调用tp_down 和tp_up汇报触摸点
* @note 本函数需要在while循环里被调用,也可使用定时器定时调用
* 例如,可以每隔5ms调用一次,消抖阈值宏DURIATION_TIME可设置为2,这样每秒最多可以检测100个点。
* 可在XPT2046_TouchDown及XPT2046_TouchUp函数中编写自己的触摸应用
* @param none
* @retval none
*/
void XPT2046_TouchEvenHandler(void ){
static strType_XPT2046_Coordinate cinfo={-1,-1,-1,-1};
if(XPT2046_TouchDetect() == TOUCH_PRESSED){
printf("\nIdentify the screen by pressing\n" );
//获取触摸坐标
XPT2046_Get_TouchedPoint(&cinfo,strXPT2046_TouchPara);
//输出调试信息到串口
printf("x=%d,y=%d",cinfo.x,cinfo.y);
//调用触摸被按下时的处理函数,可在该函数编写自己的触摸按下处理过程
XPT2046_TouchDown(&cinfo);
/*更新触摸信息到pre xy*/
cinfo.pre_x = cinfo.x; cinfo.pre_y = cinfo.y;
}
else {
if(
(cinfo.x != -1)||
(cinfo.y != -1)||
(cinfo.pre_x != -1)||
(cinfo.pre_y != -1)
){
printf(" Identify the screen by loosen\n" );
//调用触摸被释放时的处理函数,可在该函数编写自己的触摸释放处理过程
XPT2046_TouchUp(&cinfo);
/*触笔释放,把 xy 重置为负*/
cinfo.x = -1;
cinfo.y = -1;
cinfo.pre_x = -1;
cinfo.pre_y = -1;
}
}
}
建立 LCD驱动 管理文件LCD_book.h
代码如下 :
#ifndef __LCD_BOOK_H
#define __LCD_BOOK_H
#include "stm32f10x.h"
/***************************************************************************************
2^26 =0X0400 0000 = 64MB,每个 BANK 有4*64MB = 256MB
64MB:FSMC_Bank1_NORSRAM1:0X6000 0000 ~ 0X63FF FFFF
64MB:FSMC_Bank1_NORSRAM2:0X6400 0000 ~ 0X67FF FFFF
64MB:FSMC_Bank1_NORSRAM3:0X6800 0000 ~ 0X6BFF FFFF
64MB:FSMC_Bank1_NORSRAM4:0X6C00 0000 ~ 0X6FFF FFFF
选择BANK1-BORSRAM4 连接 TFT,地址范围为0X6C00 0000 ~ 0X6FFF FFFF
FSMC_A23 接LCD的DC(寄存器/数据选择)脚
寄存器基地址 = 0X6C00 0000
RAM基地址 = 0X6D00 0000 = 0X6C00 0000+2^23*2 = 0X6C00 0000 + 0X100 0000 = 0X6D00 0000
当选择不同的地址线时,地址要重新计算
****************************************************************************************/
/******************************* ILI9341 显示屏的 FSMC 参数定义 ***************************/
//FSMC_Bank1_NORSRAM用于LCD命令操作的地址
#define FSMC_Addr_ILI9341_CMD ( ( uint32_t ) 0x6C000000 )
//FSMC_Bank1_NORSRAM用于LCD数据操作的地址
#define FSMC_Addr_ILI9341_DATA ( ( uint32_t ) 0x6D000000 )
//由片选引脚决定的NOR/SRAM块
#define FSMC_Bank1_NORSRAMx FSMC_Bank1_NORSRAM4
/******************************* ILI9341 显示屏8080通讯引脚定义 ***************************/
/******控制信号线******/
//片选,选择NOR/SRAM块
#define ILI9341_CS_CLK RCC_APB2Periph_GPIOG
#define ILI9341_CS_PORT GPIOG
#define ILI9341_CS_PIN GPIO_Pin_12
//DC引脚,使用FSMC的地址信号控制,本引脚决定了访问LCD时使用的地址
//PE2为FSMC_A23
#define ILI9341_DC_CLK RCC_APB2Periph_GPIOE
#define ILI9341_DC_PORT GPIOE
#define ILI9341_DC_PIN GPIO_Pin_2
//写使能
#define ILI9341_WR_CLK RCC_APB2Periph_GPIOD
#define ILI9341_WR_PORT GPIOD
#define ILI9341_WR_PIN GPIO_Pin_5
//读使能
#define ILI9341_RD_CLK RCC_APB2Periph_GPIOD
#define ILI9341_RD_PORT GPIOD
#define ILI9341_RD_PIN GPIO_Pin_4
//复位引脚
#define ILI9341_RST_CLK RCC_APB2Periph_GPIOG
#define ILI9341_RST_PORT GPIOG
#define ILI9341_RST_PIN GPIO_Pin_11
//背光引脚
#define ILI9341_BK_CLK RCC_APB2Periph_GPIOG
#define ILI9341_BK_PORT GPIOG
#define ILI9341_BK_PIN GPIO_Pin_6
/********数据信号线***************/
#define ILI9341_D0_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D0_PORT GPIOD
#define ILI9341_D0_PIN GPIO_Pin_14
#define ILI9341_D1_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D1_PORT GPIOD
#define ILI9341_D1_PIN GPIO_Pin_15
#define ILI9341_D2_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D2_PORT GPIOD
#define ILI9341_D2_PIN GPIO_Pin_0
#define ILI9341_D3_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D3_PORT GPIOD
#define ILI9341_D3_PIN GPIO_Pin_1
#define ILI9341_D4_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D4_PORT GPIOE
#define ILI9341_D4_PIN GPIO_Pin_7
#define ILI9341_D5_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D5_PORT GPIOE
#define ILI9341_D5_PIN GPIO_Pin_8
#define ILI9341_D6_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D6_PORT GPIOE
#define ILI9341_D6_PIN GPIO_Pin_9
#define ILI9341_D7_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D7_PORT GPIOE
#define ILI9341_D7_PIN GPIO_Pin_10
#define ILI9341_D8_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D8_PORT GPIOE
#define ILI9341_D8_PIN GPIO_Pin_11
#define ILI9341_D9_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D9_PORT GPIOE
#define ILI9341_D9_PIN GPIO_Pin_12
#define ILI9341_D10_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D10_PORT GPIOE
#define ILI9341_D10_PIN GPIO_Pin_13
#define ILI9341_D11_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D11_PORT GPIOE
#define ILI9341_D11_PIN GPIO_Pin_14
#define ILI9341_D12_CLK RCC_APB2Periph_GPIOE
#define ILI9341_D12_PORT GPIOE
#define ILI9341_D12_PIN GPIO_Pin_15
#define ILI9341_D13_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D13_PORT GPIOD
#define ILI9341_D13_PIN GPIO_Pin_8
#define ILI9341_D14_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D14_PORT GPIOD
#define ILI9341_D14_PIN GPIO_Pin_9
#define ILI9341_D15_CLK RCC_APB2Periph_GPIOD
#define ILI9341_D15_PORT GPIOD
#define ILI9341_D15_PIN GPIO_Pin_10
/*************************************** 调试预用 ******************************************/
#define DEBUG_DELAY()
/******************************* 定义 ILI934 常用命令 ********************************/
#define CMD_SetCoordinateX 0x2A //设置X坐标
#define CMD_SetCoordinateY 0x2B //设置Y坐标
#define CMD_SetPixel 0x2C //填充像素
/***************************** ILI934 显示区域的起始坐标和总行列数 ***************************/
#define ILI9341_DispWindow_X_Star 0 //起始点的X坐标
#define ILI9341_DispWindow_Y_Star 0 //起始点的Y坐标
#define ILI9341_LESS_PIXEL 240 //液晶屏较短方向的像素宽度
#define ILI9341_MORE_PIXEL 320 //液晶屏较长方向的像素宽度
//根据液晶扫描方向而变化的XY像素宽度
//调用ILI9341_GramScan函数设置方向时会自动更改
extern uint16_t LCD_X_LENGTH,LCD_Y_LENGTH;
//液晶屏扫描模式
//参数可选值为0-7
typedef enum {
LCD_SCAN_MODE_1 = 1,
LCD_SCAN_MODE_2 = 2,
LCD_SCAN_MODE_3 = 3,
LCD_SCAN_MODE_4 = 4,
LCD_SCAN_MODE_5 = 5,
LCD_SCAN_MODE_6 = 6,
} LCD_SCAN_MODE_enum;
#define _LCD_SCAN_MODE LCD_SCAN_MODE_6
extern uint8_t LCD_SCAN_MODE ;
void ILI9341_Delay ( __IO uint32_t nCount );
void ILI9341_Write_Cmd ( uint16_t usCmd );
void ILI9341_Write_Data ( uint16_t usData );
__IO uint16_t ILI9341_Read_Data ( void );
void ILI9341_GramScan ( uint8_t ucOption );
__IO uint16_t ILI9341_Init (void);
#endif /* __BSP_ILI9341_ILI9341_H */
建立 LCD驱动 管理文件LCD_book.c
代码如下 :
/**
/**
******************************************************************************
* @file bsp_ili9341_lcd.c
* @version V1.0
* @date 2013-xx-xx
* @brief ili9341液晶屏驱动
******************************************************************************
* @attention
*
* 实验平台:野火 F103-霸道 STM32 开发板
* 论坛 :http://www.firebbs.cn
* 淘宝 :https://fire-stm32.taobao.com
*
******************************************************************************
*/
#include "stm32f10x.h"
#include "Systick_book.h"
#include "LCD_book.h"
#include "SPI_book.h"
//根据液晶扫描方向而变化的XY像素宽度
//调用ILI9341_GramScan函数设置方向时会自动更改
uint16_t LCD_X_LENGTH = ILI9341_LESS_PIXEL;
uint16_t LCD_Y_LENGTH = ILI9341_MORE_PIXEL;
//液晶屏扫描模式,本变量主要用于方便选择触摸屏的计算参数
//参数可选值为0-7
//调用ILI9341_GramScan函数设置方向时会自动更改
//LCD刚初始化完成时会使用本默认值
uint8_t LCD_SCAN_MODE = 6;
/**
* @brief 初始化ILI9341的IO引脚
* @param 无
* @retval 无
*/
static void ILI9341_GPIO_Config ( void ){
GPIO_InitTypeDef GPIO_InitStructure;
/* 使能FSMC对应相应管脚时钟*/
RCC_APB2PeriphClockCmd (
/*控制信号*/
ILI9341_CS_CLK|ILI9341_DC_CLK|ILI9341_WR_CLK|
ILI9341_RD_CLK |ILI9341_BK_CLK|ILI9341_RST_CLK|
/*数据信号*/
ILI9341_D0_CLK|ILI9341_D1_CLK| ILI9341_D2_CLK |
ILI9341_D3_CLK | ILI9341_D4_CLK|ILI9341_D5_CLK|
ILI9341_D6_CLK | ILI9341_D7_CLK|ILI9341_D8_CLK|
ILI9341_D9_CLK | ILI9341_D10_CLK|ILI9341_D11_CLK|
ILI9341_D12_CLK | ILI9341_D13_CLK|ILI9341_D14_CLK|
ILI9341_D15_CLK , ENABLE );
/* 配置FSMC相对应的数据线,FSMC-D0~D15 */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = ILI9341_D0_PIN;
GPIO_Init ( ILI9341_D0_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D1_PIN;
GPIO_Init ( ILI9341_D1_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D2_PIN;
GPIO_Init ( ILI9341_D2_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D3_PIN;
GPIO_Init ( ILI9341_D3_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D4_PIN;
GPIO_Init ( ILI9341_D4_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D5_PIN;
GPIO_Init ( ILI9341_D5_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D6_PIN;
GPIO_Init ( ILI9341_D6_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D7_PIN;
GPIO_Init ( ILI9341_D7_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D8_PIN;
GPIO_Init ( ILI9341_D8_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D9_PIN;
GPIO_Init ( ILI9341_D9_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D10_PIN;
GPIO_Init ( ILI9341_D10_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D11_PIN;
GPIO_Init ( ILI9341_D11_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D12_PIN;
GPIO_Init ( ILI9341_D12_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D13_PIN;
GPIO_Init ( ILI9341_D13_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D14_PIN;
GPIO_Init ( ILI9341_D14_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_D15_PIN;
GPIO_Init ( ILI9341_D15_PORT, & GPIO_InitStructure );
/* 配置FSMC相对应的控制线
* FSMC_NOE :LCD-RD
* FSMC_NWE :LCD-WR
* FSMC_NE1 :LCD-CS
* FSMC_A16 :LCD-DC
*/
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Pin = ILI9341_RD_PIN;
GPIO_Init (ILI9341_RD_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_WR_PIN;
GPIO_Init (ILI9341_WR_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_CS_PIN;
GPIO_Init ( ILI9341_CS_PORT, & GPIO_InitStructure );
GPIO_InitStructure.GPIO_Pin = ILI9341_DC_PIN;
GPIO_Init ( ILI9341_DC_PORT, & GPIO_InitStructure );
/* 配置LCD复位RST控制管脚*/
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Pin = ILI9341_RST_PIN;
GPIO_Init ( ILI9341_RST_PORT, & GPIO_InitStructure );
/* 配置LCD背光控制管脚BK*/
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Pin = ILI9341_BK_PIN;
GPIO_Init ( ILI9341_BK_PORT, & GPIO_InitStructure );
}
/**
* @brief LCD FSMC 模式配置
* @param 无
* @retval 无
*/
static void ILI9341_FSMC_Config ( void )
{
FSMC_NORSRAMInitTypeDef FSMC_NORSRAMInitStructure;
FSMC_NORSRAMTimingInitTypeDef readWriteTiming;
/* 使能FSMC时钟*/
RCC_AHBPeriphClockCmd ( RCC_AHBPeriph_FSMC, ENABLE );
//地址建立时间(ADDSET)为1个HCLK 2/72M=28ns
readWriteTiming.FSMC_AddressSetupTime = 0x01; //地址建立时间
//数据保持时间(DATAST)+ 1个HCLK = 5/72M=70ns
readWriteTiming.FSMC_DataSetupTime = 0x06; //数据建立时间
//选择控制的模式
//模式B,异步NOR FLASH模式,与ILI9341的8080时序匹配
readWriteTiming.FSMC_AccessMode = FSMC_AccessMode_B;
/*以下配置与模式B无关*/
//地址保持时间(ADDHLD)模式A未用到
readWriteTiming.FSMC_AddressHoldTime = 0x00; //地址保持时间
//设置总线转换周期,仅用于复用模式的NOR操作
readWriteTiming.FSMC_BusTurnAroundDuration = 0x00;
//设置时钟分频,仅用于同步类型的存储器
readWriteTiming.FSMC_CLKDivision = 0x00;
//数据保持时间,仅用于同步型的NOR
readWriteTiming.FSMC_DataLatency = 0x00;
FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAMx;
FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_NOR;
FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &readWriteTiming;
FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &readWriteTiming;
FSMC_NORSRAMInit ( & FSMC_NORSRAMInitStructure );
/* 使能 FSMC_Bank1_NORSRAM4 */
FSMC_NORSRAMCmd ( FSMC_Bank1_NORSRAMx, ENABLE );
}
//==================================================================================
//==============================命令初始化==========================================
//==================================================================================
/**
* @brief 向ILI9341写入命令
* @param usCmd :要写入的命令(表寄存器地址)
* @retval 无
*/
__inline void ILI9341_Write_Cmd ( uint16_t usCmd ){
* ( __IO uint16_t * ) ( FSMC_Addr_ILI9341_CMD ) = usCmd;
}
/**
* @brief 向ILI9341写入数据
* @param usData :要写入的数据
* @retval 无
*/
__inline void ILI9341_Write_Data ( uint16_t usData ){
* ( __IO uint16_t * ) ( FSMC_Addr_ILI9341_DATA ) = usData;
}
/**
* @brief 从ILI9341读取数据
* @param 无
* @retval 读取到的数据
*/
__inline __IO uint16_t ILI9341_Read_Data ( void ){
return ( * ( __IO uint16_t * ) ( FSMC_Addr_ILI9341_DATA ) );
}
/**
* @brief 用于 ILI9341 简单延时函数
* @param nCount :延时计数值
* @retval 无
*/
void ILI9341_Delay ( __IO uint32_t nCount ){
for ( ; nCount != 0; nCount -- );
}
/**
* @brief ILI9341背光LED控制
* @param enumState :决定是否使能背光LED
* 该参数为以下值之一:
* @arg ENABLE :使能背光LED
* @arg DISABLE :禁用背光LED
* @retval 无
*/
void ILI9341_BackLed_Control ( FunctionalState enumState )
{
if ( enumState )
GPIO_ResetBits ( ILI9341_BK_PORT, ILI9341_BK_PIN );
else
GPIO_SetBits ( ILI9341_BK_PORT, ILI9341_BK_PIN );
}
/**
* @brief ILI9341 软件复位
* @param 无
* @retval 无
*/
void ILI9341_Rst ( void )
{
GPIO_ResetBits ( ILI9341_RST_PORT, ILI9341_RST_PIN ); //低电平复位
ILI9341_Delay ( 0xAFF );
GPIO_SetBits ( ILI9341_RST_PORT, ILI9341_RST_PIN );
ILI9341_Delay ( 0xAFF );
}
//==================================================================================
//============================== 显示屏幕 初始化========================================
//==================================================================================
/**
* @brief 初始化ILI9341寄存器
* @param 无
* @retval 无
*/
static void ILI9341_REG_Config ( void )
{
/* Power control B (CFh) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xCF );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x81 );
ILI9341_Write_Data ( 0x30 );
/* Power on sequence control (EDh) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xED );
ILI9341_Write_Data ( 0x64 );
ILI9341_Write_Data ( 0x03 );
ILI9341_Write_Data ( 0x12 );
ILI9341_Write_Data ( 0x81 );
/* Driver timing control A (E8h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xE8 );
ILI9341_Write_Data ( 0x85 );
ILI9341_Write_Data ( 0x10 );
ILI9341_Write_Data ( 0x78 );
/* Power control A (CBh) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xCB );
ILI9341_Write_Data ( 0x39 );
ILI9341_Write_Data ( 0x2C );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x34 );
ILI9341_Write_Data ( 0x02 );
/* Pump ratio control (F7h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xF7 );
ILI9341_Write_Data ( 0x20 );
/* Driver timing control B */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xEA );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x00 );
/* Frame Rate Control (In Normal Mode/Full Colors) (B1h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xB1 );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x1B );
/* Display Function Control (B6h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xB6 );
ILI9341_Write_Data ( 0x0A );
ILI9341_Write_Data ( 0xA2 );
/* Power Control 1 (C0h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xC0 );
ILI9341_Write_Data ( 0x35 );
/* Power Control 2 (C1h) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0xC1 );
ILI9341_Write_Data ( 0x11 );
/* VCOM Control 1 (C5h) */
ILI9341_Write_Cmd ( 0xC5 );
ILI9341_Write_Data ( 0x45 );
ILI9341_Write_Data ( 0x45 );
/* VCOM Control 2 (C7h) */
ILI9341_Write_Cmd ( 0xC7 );
ILI9341_Write_Data ( 0xA2 );
/* Enable 3G (F2h) */
ILI9341_Write_Cmd ( 0xF2 );
ILI9341_Write_Data ( 0x00 );
/* Gamma Set (26h) */
ILI9341_Write_Cmd ( 0x26 );
ILI9341_Write_Data ( 0x01 );
DEBUG_DELAY ();
/* Positive Gamma Correction */
ILI9341_Write_Cmd ( 0xE0 ); //Set Gamma
ILI9341_Write_Data ( 0x0F );
ILI9341_Write_Data ( 0x26 );
ILI9341_Write_Data ( 0x24 );
ILI9341_Write_Data ( 0x0B );
ILI9341_Write_Data ( 0x0E );
ILI9341_Write_Data ( 0x09 );
ILI9341_Write_Data ( 0x54 );
ILI9341_Write_Data ( 0xA8 );
ILI9341_Write_Data ( 0x46 );
ILI9341_Write_Data ( 0x0C );
ILI9341_Write_Data ( 0x17 );
ILI9341_Write_Data ( 0x09 );
ILI9341_Write_Data ( 0x0F );
ILI9341_Write_Data ( 0x07 );
ILI9341_Write_Data ( 0x00 );
/* Negative Gamma Correction (E1h) */
ILI9341_Write_Cmd ( 0XE1 ); //Set Gamma
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x19 );
ILI9341_Write_Data ( 0x1B );
ILI9341_Write_Data ( 0x04 );
ILI9341_Write_Data ( 0x10 );
ILI9341_Write_Data ( 0x07 );
ILI9341_Write_Data ( 0x2A );
ILI9341_Write_Data ( 0x47 );
ILI9341_Write_Data ( 0x39 );
ILI9341_Write_Data ( 0x03 );
ILI9341_Write_Data ( 0x06 );
ILI9341_Write_Data ( 0x06 );
ILI9341_Write_Data ( 0x30 );
ILI9341_Write_Data ( 0x38 );
ILI9341_Write_Data ( 0x0F );
/* memory access control set */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0x36 );
ILI9341_Write_Data ( 0xC8 ); /*竖屏 左上角到 (起点)到右下角 (终点)扫描方式*/
DEBUG_DELAY ();
/* column address control set */
ILI9341_Write_Cmd ( CMD_SetCoordinateX );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0xEF );
/* page address control set */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( CMD_SetCoordinateY );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x00 );
ILI9341_Write_Data ( 0x01 );
ILI9341_Write_Data ( 0x3F );
/* Pixel Format Set (3Ah) */
DEBUG_DELAY ();
ILI9341_Write_Cmd ( 0x3a );
ILI9341_Write_Data ( 0x55 );
/* Sleep Out (11h) */
ILI9341_Write_Cmd ( 0x11 );
ILI9341_Delay ( 0xAFFf<<2 );
DEBUG_DELAY ();
/* Display ON (29h) */
ILI9341_Write_Cmd ( 0x29 );
}
/**
* @brief uint16_t ILI9341_Read_Pixel_Pormat(void)
* @param 无
* @retval 读取到的数据
*/
static __IO uint16_t ILI9341_Read_Pixel_Pormat(void){
ILI9341_Write_Cmd(0x0C);
ILI9341_Read_Data();
return (__IO uint16_t) ILI9341_Read_Data();
}
/**
* @brief 设置ILI9341的GRAM的扫描方向
* @param ucOption :选择GRAM的扫描方向
* @arg 0-7 :参数可选值为0-7这八个方向
*
* !!!其中0、3、5、6 模式适合从左至右显示文字,
* 不推荐使用其它模式显示文字 其它模式显示文字会有镜像效果
*
* 其中0、2、4、6 模式的X方向像素为240,Y方向像素为320
* 其中1、3、5、7 模式下X方向像素为320,Y方向像素为240
*
* 其中 6 模式为大部分液晶例程的默认显示方向
* 其中 3 模式为摄像头例程使用的方向
* 其中 0 模式为BMP图片显示例程使用的方向
*
* @retval 无
* @note 坐标图例:A表示向上,V表示向下,<表示向左,>表示向右
X表示X轴,Y表示Y轴
------------------------------------------------------------
模式0: . 模式1: . 模式2: . 模式3:
A . A . A . A
| . | . | . |
Y . X . Y . X
0 . 1 . 2 . 3
<--- X0 o . <----Y1 o . o 2X---> . o 3Y--->
------------------------------------------------------------
模式4: . 模式5: . 模式6: . 模式7:
<--- X4 o . <--- Y5 o . o 6X---> . o 7Y--->
4 . 5 . 6 . 7
Y . X . Y . X
| . | . | . |
V . V . V . V
---------------------------------------------------------
LCD屏示例
|-----------------|
| 野火Logo |
| |
| |
| |
| |
| |
| |
| |
| |
|-----------------|
屏幕正面(宽240,高320)
*******************************************************/
void ILI9341_GramScan ( uint8_t ucOption ){
//参数检查,只可输入0-7
if(ucOption >7 )
return;
//根据模式更新LCD_SCAN_MODE的值,主要用于触摸屏选择计算参数
LCD_SCAN_MODE = ucOption;
//根据模式更新XY方向的像素宽度
if(ucOption%2 == 0)
{
//0 2 4 6模式下X方向像素宽度为240,Y方向为320
LCD_X_LENGTH = ILI9341_LESS_PIXEL;
LCD_Y_LENGTH = ILI9341_MORE_PIXEL;
}
else
{
//1 3 5 7模式下X方向像素宽度为320,Y方向为240
LCD_X_LENGTH = ILI9341_MORE_PIXEL;
LCD_Y_LENGTH = ILI9341_LESS_PIXEL;
}
//0x36命令参数的高3位可用于设置GRAM扫描方向
ILI9341_Write_Cmd ( 0x36 );
ILI9341_Write_Data ( 0x08 |(ucOption<<5));//根据ucOption的值设置LCD参数,共0-7种模式
ILI9341_Write_Cmd ( CMD_SetCoordinateX );
ILI9341_Write_Data ( 0x00 ); /* x 起始坐标高8位 */
ILI9341_Write_Data ( 0x00 ); /* x 起始坐标低8位 */
ILI9341_Write_Data ( ((LCD_X_LENGTH-1)>>8)&0xFF ); /* x 结束坐标高8位 */
ILI9341_Write_Data ( (LCD_X_LENGTH-1)&0xFF ); /* x 结束坐标低8位 */
ILI9341_Write_Cmd ( CMD_SetCoordinateY );
ILI9341_Write_Data ( 0x00 ); /* y 起始坐标高8位 */
ILI9341_Write_Data ( 0x00 ); /* y 起始坐标低8位 */
ILI9341_Write_Data ( ((LCD_Y_LENGTH-1)>>8)&0xFF ); /* y 结束坐标高8位 */
ILI9341_Write_Data ( (LCD_Y_LENGTH-1)&0xFF ); /* y 结束坐标低8位 */
/* write gram start */
ILI9341_Write_Cmd ( CMD_SetPixel );
}
//==================================================================================
//============================== 主程序初始化========================================
//==================================================================================
/**
* @brief ILI9341初始化函数,如果要用到lcd,一定要调用这个函数
* @param 无
* @retval 无
*/
__IO uint16_t ILI9341_Init (void){
// SPI_InitTypeDef SPI_InitStructure;
//
_FLASH_SPI_APBxClock_FUN(_FLASH_SPI_CLK , DISABLE);
_FLASH_SPI_GPIO_APBxClock_FUN(_FLASH_SPI_GPIO_CLK , DISABLE);
//
// SPI_StructInit(&SPI_InitStructure);
// SPI_Cmd(_FLASH_SPIx , DISABLE); //使能SPI
// fn_Systick_Delay(500,_Systick_ms);
ILI9341_GPIO_Config ();
ILI9341_FSMC_Config ();
ILI9341_Rst ();
ILI9341_BackLed_Control ( ENABLE ); //点亮LCD背光灯
ILI9341_REG_Config();
//设置默认扫描方向,其中 6 模式为大部分液晶例程的默认显示方向
ILI9341_GramScan(_LCD_SCAN_MODE );
return (__IO uint16_t)ILI9341_Read_Pixel_Pormat();
}
建立 LCD 绘制函数文件LCD_Draw_book.h
代码如下 :
#ifndef __LCD_DRAW_BOOK_H
#define __LCD_DRAW_BOOK_H
#include "stm32f10x.h"
#include "LCD_book.h"
#include "fonts.h"
#include "USART_book.h"
/******************************* 定义 ILI934 显示屏常用颜色 ********************************/
#define BACKGROUND BLACK //默认背景颜色
#define WHITE 0xFFFF //白色
#define BLACK 0x0000 //黑色
#define GREY 0xF7DE //灰色
#define BLUE 0x001F //蓝色
#define BLUE2 0x051F //浅蓝色
#define RED 0xF800 //红色
#define MAGENTA 0xF81F //红紫色,洋红色
#define GREEN 0x07E0 //绿色
#define CYAN 0x7FFF //蓝绿色,青色
#define YELLOW 0xFFE0 //黄色
#define BRED 0xF81F
#define GRED 0xFFE0
#define GBLUE 0x07FF
//1110 1100 1101 0101 1010 1111
//11101 110101 10101
//GB565(Rh,Gh,Bh) (((Rh&0xf8)<<8)|((Gh&0xfc)<<3)|((Bh&0xf8)>>3))
//GB888(RGB) ((((RGB&0xf80000)) | ((RGB&0x00fc00)<<3)| ((RGB&0x0000f8)<<5))>>8)
#define GB565(Rh,Gh,Bh) (((Rh&0xf8)<<8)|((Gh&0xfc)<<3)|((Bh&0xf8)>>3))
#define GB888(RGB) ((((RGB&0xf80000)) | ((RGB&0x00fc00)<<3)| ((RGB&0x0000f8)<<5))>>8)
extern sFONT *LCD_Currentfonts ; //英文字体
extern uint16_t CurrentForecolor ;//前景色
extern uint16_t CurrentBackColor ;//背景色
//================================ 接口函数=======================================
void ILI9341_OpenWindow (
uint16_t usX, //usX :在特定扫描方向下窗口的起点X坐标
uint16_t usY, //usY :在特定扫描方向下窗口的起点Y坐标
uint16_t usWidth, //usWidth :窗口的宽度
uint16_t usHeight //usHeight :窗口的高度
);
static void ILI9341_SetCursor (
uint16_t usX, // usX :在特定扫描方向下光标的X坐标
uint16_t usY, // usY :在特定扫描方向下光标的Y坐标
uint16_t usW
);
static __inline void ILI9341_FillColor (
uint32_t ulAmout_Point,// ulAmout_Point :要填充颜色的像素点的总数目
uint16_t usColor // usColor :颜色
);
void ILI9341_Clear (
uint16_t usX, //usX :在特定扫描方向下窗口的起点X坐标
uint16_t usY, //usY :在特定扫描方向下窗口的起点Y坐标
uint16_t usWidth, //usWidth :窗口的宽度
uint16_t usHeight //usHeight :窗口的高度
);
void LCD_ClearLine(uint16_t Line);
//================================ 颜色状态函数=======================================
void LCD_SetColors(uint16_t TextColor, uint16_t BackColor); //设置LCD的前景(字体)及背景颜色,RGB565
void LCD_SetForeColor(uint16_t Color);//设置LCD的前景(字体)颜色,RGB565
void LCD_SetBackColor(uint16_t Color); //设置LCD的背景颜色,RGB565
//================================ 形状绘制应用函数=======================================
void ILI9341_SetPointPixel (
uint16_t usX, //usX :在特定扫描方向下该点的X坐标
uint16_t usY, //usY :在特定扫描方向下该点的Y坐标
uint16_t usW //usW :在特定扫描宽度
);
void ILI9341_DrawLine ( //在 ILI9341 显示器上使用 Bresenham 算法画线段
uint16_t usX1, //usX1 :在特定扫描方向下线段的一个端点X坐标
uint16_t usY1, //usY1 :在特定扫描方向下线段的一个端点Y坐标
uint16_t usX2, //usX2 :在特定扫描方向下线段的另一个端点X坐标
uint16_t usY2, //usY2 :在特定扫描方向下线段的另一个端点Y坐标
uint16_t usW
);
void ILI9341_DrawRectangle (
uint16_t usX_Start, //X坐标
uint16_t usY_Start, //Y坐标
uint16_t usWidth, //X宽度
uint16_t usHeight, //Y宽度
uint8_t ucFilled , //填充类型
uint16_t usW //填充线宽度
);
void ILI9341_DrawCircle (
uint16_t usX_Center, //usX_Center :在特定扫描方向下圆心的X坐标
uint16_t usY_Center, //usY_Center :在特定扫描方向下圆心的Y坐标
uint16_t usRadius, //usRadius:圆的半径(单位:像素)
uint8_t ucFilled , //ucFilled :选择是否填充该圆
uint16_t usW
);
void ILI9341_DrawCross ( uint16_t usX, uint16_t usY );
void LCD_DrawUniLineCircle(
uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint8_t thick
);
//================================ 文字颜色状态绘制应用函数=======================================
void LCD_SetTextColor(uint16_t Color);
void LCD_SetFont(sFONT *fonts);
sFONT *LCD_GetFont(void);
//================================ 文字绘制应用函数=======================================
//================================ 英文文字绘制应用函数====================================
void ILI9341_DispChar_EN (
uint16_t usX,
uint16_t usY,
const char cChar );
void ILI9341_DispStringLine_EN (
uint16_t line,
char * pStr
);
void ILI9341_DispString_EN (
uint16_t usX ,
uint16_t usY,
char * pStr
);
void ILI9341_DispString_EN_YDir (
uint16_t usX,uint16_t usY ,
char * pStr
);
//================================ 中文文字绘制应用函数====================================
void ILI9341_DispChar_CH ( //在 ILI9341 显示器上显示一个中文字符
uint16_t usX,
uint16_t usY,
uint16_t usChar
);
void ILI9341_DispString_CH ( //在 ILI9341 显示器上显示中文字符串
uint16_t usX ,
uint16_t usY,
char * pStr
);
void ILI9341_DispStringLine_EN_CH (
uint16_t line, //line :在特定扫描方向下字符串的起始Y坐标
char * pStr //pStr :要显示的字符串的首地址
);
void ILI9341_DispString_EN_CH (
uint16_t usX , //在特定扫描方向下字符的起始X坐标
uint16_t usY, //在特定扫描方向下字符的起始Y坐标
char * pStr //要显示的字符串的首地址
);
void ILI9341_DispString_EN_CH_YDir (
uint16_t usX, //usX :在特定扫描方向下字符的起始X坐标
uint16_t usY, //usY :在特定扫描方向下字符的起始Y坐标
char * pStr //要显示的中英文字符串的首地址
);
/***********************缩放字体****************************/
void ILI9341_zoomChar(
uint16_t in_width, //原始字符宽度
uint16_t in_heig, //原始字符高度
uint16_t out_width, //缩放后的字符宽度
uint16_t out_heig, //缩放后的字符高度
uint8_t *in_ptr, //字库输入指针 注意:1pixel 1bit
uint8_t *out_ptr, //缩放后的字符输出指针 注意: 1pixel 8bit
uint8_t en_cn //0为英文,1为中文
);
void ILI9341_DrawChar_Ex(
uint16_t usX, //字符显示位置x
uint16_t usY, //字符显示位置y
uint16_t Font_width, //字符宽度
uint16_t Font_Height, //字符高度
uint8_t *c, //字模数据
uint16_t DrawModel //是否反色显示
);
void ILI9341_DisplayStringEx(
uint16_t x, //字符显示位置x
uint16_t y, //字符显示位置y
uint16_t Font_width, //要显示的字体宽度,英文字符在此基础上/2。注意为偶数
uint16_t Font_Height, //要显示的字体高度,注意为偶数
uint8_t *ptr, //显示的字符内容
uint16_t DrawModel //是否反色显示
);
void ILI9341_DisplayStringEx_YDir(
uint16_t x, //字符显示位置x
uint16_t y, //字符显示位置y
uint16_t Font_width, //要显示的字体宽度,英文字符在此基础上/2。注意为偶数
uint16_t Font_Height, //要显示的字体高度,注意为偶数
uint8_t *ptr, //显示的字符内容
uint16_t DrawModel //是否反色显示
);
void Lcd_display_String(uint8_t *ptr);
#endif /* __BSP_ILI9341_ILI9341_H */
建立 LCD 绘制文件LCD_Draw_book.c
代码如下 :
#include "LCD_Draw_book.h"
#include "Systick_book.h"
sFONT *LCD_Currentfonts = &Font8x16; //英文字体
uint16_t CurrentForecolor = BLACK;//前景色
uint16_t CurrentBackColor = BACKGROUND;//背景色
//================================ 接口函数=======================================
/**
* @brief 在ILI9341显示器上开辟一个窗口
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @retval 无
*/
void ILI9341_OpenWindow ( uint16_t usX, uint16_t usY, uint16_t usWidth, uint16_t usHeight ){
ILI9341_Write_Cmd ( CMD_SetCoordinateX ); /* 设置X坐标 */
ILI9341_Write_Data ( (usX & 0xFF00) >> 8 ); /* 先高8位,然后低8位 */
ILI9341_Write_Data ( usX & 0xff ); /* 设置起始点和结束点*/
ILI9341_Write_Data ( ( usX + usWidth - 1 ) >> 8 );
ILI9341_Write_Data ( ( usX + usWidth - 1 ) & 0xff );
ILI9341_Write_Cmd ( CMD_SetCoordinateY ); /* 设置Y坐标*/
ILI9341_Write_Data ( (usY & 0xFF00 )>> 8 );
ILI9341_Write_Data ( usY & 0xff );
ILI9341_Write_Data ( ( usY + usHeight - 1 ) >> 8 );
ILI9341_Write_Data ( ( usY + usHeight - 1) & 0xff );
}
/**
* @brief 设定ILI9341的光标坐标
* @param usX :在特定扫描方向下光标的X坐标
* @param usY :在特定扫描方向下光标的Y坐标
* @retval 无
*/
static void ILI9341_SetCursor (
uint16_t usX,
uint16_t usY,
uint16_t usW
){
ILI9341_OpenWindow ( usX, usY, usW, usW );
}
/**
* @brief 读取ILI9341 GRAN 的一个像素数据
* @param 无
* @retval 像素数据
*/
static uint16_t ILI9341_Read_PixelData ( void )
{
uint16_t usR=0, usG=0, usB=0 ;
ILI9341_Write_Cmd ( 0x2E ); /* 读数据 */
usR = ILI9341_Read_Data (); /*FIRST READ OUT DUMMY DATA*/
usR = ILI9341_Read_Data (); /*READ OUT RED DATA */
usB = ILI9341_Read_Data (); /*READ OUT BLUE DATA*/
usG = ILI9341_Read_Data (); /*READ OUT GREEN DATA*/
return ( ( ( usR >> 11 ) << 11 ) | ( ( usG >> 10 ) << 5 ) | ( usB >> 11 ) );
}
/**
* @brief 获取 ILI9341 显示器上某一个坐标点的像素数据
* @param usX :在特定扫描方向下该点的X坐标
* @param usY :在特定扫描方向下该点的Y坐标
* @retval 像素数据
*/
uint16_t ILI9341_GetPointPixel ( uint16_t usX, uint16_t usY )
{
uint16_t usPixelData;
ILI9341_SetCursor ( usX, usY ,1);
usPixelData = ILI9341_Read_PixelData ();
return usPixelData;
}
/**
* @brief 在ILI9341显示器上以某一颜色填充像素点
* @param ulAmout_Point :要填充颜色的像素点的总数目
* @param usColor :颜色
* @retval 无
*/
static __inline void ILI9341_FillColor ( uint32_t ulAmout_Point, uint16_t usColor ){
uint32_t i = 0;
/* memory write */
ILI9341_Write_Cmd ( CMD_SetPixel );
for ( i = 0; i < ulAmout_Point; i ++ )
ILI9341_Write_Data ( usColor );
}
/**
* @brief 对ILI9341显示器的某一窗口以某种颜色进行清屏
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_Clear (
uint16_t usX,
uint16_t usY,
uint16_t usWidth,
uint16_t usHeight
){
ILI9341_OpenWindow ( usX, usY, usWidth, usHeight );
ILI9341_FillColor ( usWidth * usHeight, CurrentBackColor );
}
/**
* @brief 清除某行文字
* @param Line: 指定要删除的行
* 本参数可使用宏LINE(0)、LINE(1)等方式指定要删除的行,
* 宏LINE(x)会根据当前选择的字体来计算Y坐标值,并删除当前字体高度的第x行。
* @retval None
*/
void LCD_ClearLine(uint16_t Line){
ILI9341_Clear(0,Line,LCD_X_LENGTH,((sFONT *)LCD_GetFont())->Height); /* 清屏,显示全黑 */
}
//================================ 颜色状态函数=======================================
/**
* @brief 设置LCD的前景(字体)及背景颜色,RGB565
* @param TextColor: 指定前景(字体)颜色
* @param BackColor: 指定背景颜色
* @retval None
*/
void LCD_SetColors(uint16_t TextColor, uint16_t BackColor){
CurrentForecolor = TextColor;
CurrentBackColor = BackColor;
}
/**
* @brief 设置LCD的前景(字体)颜色,RGB565
* @param Color: 指定前景(字体)颜色
* @retval None
*/
void LCD_SetForeColor(uint16_t Color){
CurrentForecolor = Color;
}
/**
* @brief 设置LCD的背景颜色,RGB565
* @param Color: 指定背景颜色
* @retval None
*/
void LCD_SetBackColor(uint16_t Color){
CurrentBackColor = Color;
}
//================================ 形状绘制应用函数=======================================
/**
* @brief 对ILI9341显示器的某一点以某种颜色进行填充
* @param usX :在特定扫描方向下该点的X坐标
* @param usY :在特定扫描方向下该点的Y坐标
* @param usW :在特定扫描宽度
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_SetPointPixel (
uint16_t usX,
uint16_t usY,
uint16_t usW
){
if ( ( usX < LCD_X_LENGTH ) && ( usY < LCD_Y_LENGTH ) ){
ILI9341_SetCursor ( usX, usY ,usW);
ILI9341_FillColor ( usW*usW, CurrentForecolor );
}
}
/**
* @brief 在 ILI9341 显示器上使用 Bresenham 算法画线段
* @param usX1 :在特定扫描方向下线段的一个端点X坐标
* @param usY1 :在特定扫描方向下线段的一个端点Y坐标
* @param usX2 :在特定扫描方向下线段的另一个端点X坐标
* @param usY2 :在特定扫描方向下线段的另一个端点Y坐标
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DrawLine (
uint16_t usX1,
uint16_t usY1,
uint16_t usX2,
uint16_t usY2,
uint16_t usW
){
uint16_t us;
uint16_t usX_Current, usY_Current;
int32_t lError_X = 0, lError_Y = 0, lDelta_X, lDelta_Y, lDistance;
int32_t lIncrease_X, lIncrease_Y;
lDelta_X = usX2 - usX1; //计算坐标增量
lDelta_Y = usY2 - usY1;
usX_Current = usX1;
usY_Current = usY1;
if (lDelta_X > 0) lIncrease_X = 1; //设置单步方向
else if (lDelta_X == 0) lIncrease_X = 0;//垂直线
else {
lIncrease_X = -1;
lDelta_X = - lDelta_X;
}
if (lDelta_Y > 0) lIncrease_Y = 1;
else if (lDelta_Y == 0) lIncrease_Y = 0;//水平线
else {
lIncrease_Y = -1;
lDelta_Y = - lDelta_Y;
}
if (lDelta_X > lDelta_Y )
lDistance = lDelta_X; //选取基本增量坐标轴
else
lDistance = lDelta_Y;
//-------------------进行化线处理--------------------
for ( us = 0; us <= lDistance + 1; us ++ ){//画线输出
ILI9341_SetPointPixel ( usX_Current, usY_Current , usW );//画点
lError_X += lDelta_X ;
lError_Y += lDelta_Y ;
if ( lError_X > lDistance )
{
lError_X -= lDistance;
usX_Current += lIncrease_X;
}
if ( lError_Y > lDistance )
{
lError_Y -= lDistance;
usY_Current += lIncrease_Y;
}
}
}
/**
* @brief 在 ILI9341 显示器上画一个矩形
* @param usX_Start :在特定扫描方向下矩形的起始点X坐标
* @param usY_Start :在特定扫描方向下矩形的起始点Y坐标
* @param usWidth:矩形的宽度(单位:像素)
* @param usHeight:矩形的高度(单位:像素)
* @param ucFilled :选择是否填充该矩形
* 该参数为以下值之一:
* @arg 0 :空心矩形
* @arg 1 :实心矩形
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DrawRectangle (
uint16_t usX_Start, //X坐标
uint16_t usY_Start, //Y坐标
uint16_t usWidth, //X宽度
uint16_t usHeight, //Y宽度
uint8_t ucFilled , //填充类型
uint16_t usW //填充线宽度
){
if ( ucFilled ){
ILI9341_OpenWindow ( usX_Start, usY_Start, usWidth, usHeight );
ILI9341_FillColor ( usWidth * usHeight ,CurrentForecolor);
}
else {
ILI9341_DrawLine ( usX_Start, usY_Start, usX_Start + usWidth - 1, usY_Start ,usW);
ILI9341_DrawLine ( usX_Start, usY_Start + usHeight - 1, usX_Start + usWidth - 1, usY_Start + usHeight - 1 ,usW);
ILI9341_DrawLine ( usX_Start, usY_Start, usX_Start, usY_Start + usHeight - 1 ,usW);
ILI9341_DrawLine ( usX_Start + usWidth - 1, usY_Start, usX_Start + usWidth - 1, usY_Start + usHeight - 1 ,usW);
}
}
/**
* @brief 在 ILI9341 显示器上使用 Bresenham 算法画圆
* @param usX_Center :在特定扫描方向下圆心的X坐标
* @param usY_Center :在特定扫描方向下圆心的Y坐标
* @param usRadius:圆的半径(单位:像素)
* @param ucFilled :选择是否填充该圆
* 该参数为以下值之一:
* @arg 0 :空心圆
* @arg 1 :实心圆
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DrawCircle (
uint16_t usX_Center,
uint16_t usY_Center,
uint16_t usRadius,
uint8_t ucFilled ,
uint16_t usW
){
int16_t sCurrentX, sCurrentY;
int16_t sError;
sCurrentX = 0; sCurrentY = usRadius;
sError = 3 - ( usRadius << 1 ); //判断下个点位置的标志
while ( sCurrentX <= sCurrentY ){
int16_t sCountY;
if ( ucFilled )
for ( sCountY = sCurrentX; sCountY <= sCurrentY; sCountY ++ )
{
ILI9341_SetPointPixel ( usX_Center + sCurrentX, usY_Center + sCountY ,usW ); //1,研究对象
ILI9341_SetPointPixel ( usX_Center - sCurrentX, usY_Center + sCountY ,usW); //2
ILI9341_SetPointPixel ( usX_Center - sCountY, usY_Center + sCurrentX ,usW); //3
ILI9341_SetPointPixel ( usX_Center - sCountY, usY_Center - sCurrentX ,usW); //4
ILI9341_SetPointPixel ( usX_Center - sCurrentX, usY_Center - sCountY ,usW); //5
ILI9341_SetPointPixel ( usX_Center + sCurrentX, usY_Center - sCountY ,usW); //6
ILI9341_SetPointPixel ( usX_Center + sCountY, usY_Center - sCurrentX ,usW); //7
ILI9341_SetPointPixel ( usX_Center + sCountY, usY_Center + sCurrentX ,usW); //0
}
else
{
ILI9341_SetPointPixel ( usX_Center + sCurrentX, usY_Center + sCurrentY ,usW ); //1,研究对象
ILI9341_SetPointPixel ( usX_Center - sCurrentX, usY_Center + sCurrentY ,usW ); //2
ILI9341_SetPointPixel ( usX_Center - sCurrentY, usY_Center + sCurrentX ,usW ); //3
ILI9341_SetPointPixel ( usX_Center - sCurrentY, usY_Center - sCurrentX ,usW ); //4
ILI9341_SetPointPixel ( usX_Center - sCurrentX, usY_Center - sCurrentY ,usW ); //5
ILI9341_SetPointPixel ( usX_Center + sCurrentX, usY_Center - sCurrentY ,usW ); //6
ILI9341_SetPointPixel ( usX_Center + sCurrentY, usY_Center - sCurrentX ,usW ); //7
ILI9341_SetPointPixel ( usX_Center + sCurrentY, usY_Center + sCurrentX ,usW ); //0
}
sCurrentX ++;
if ( sError < 0 ) sError += 4 * sCurrentX + 6;
else{
sError += 10 + 4 * ( sCurrentX - sCurrentY );
sCurrentY --;
}
}
}
/**
* @brief 在 ILI9341 上显示校正触摸时需要的十字
* @param usX :在特定扫描方向下十字交叉点的X坐标
* @param usY :在特定扫描方向下十字交叉点的Y坐标
* @retval 无
*/
void ILI9341_DrawCross ( uint16_t usX, uint16_t usY ){
ILI9341_DrawLine(usX-10,usY,usX+10,usY,2);
ILI9341_DrawLine(usX, usY - 10, usX, usY+10,2);
}
/**
* @brief 在两点之间描绘轨迹
* @param x1: specifies the point 1 x position.
* @param y1: specifies the point 1 y position.
* @param x2: specifies the point 2 x position.
* @param y2: specifies the point 2 y position.
* @retval None
*/
#define ABS(X) ((X) > 0 ? (X) : -(X))
void LCD_DrawUniLineCircle(
uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint8_t thick
){
int16_t deltax = 0 , deltay = 0 ;
int16_t x = 0 , y = 0 , xinc1 = 0 , xinc2 = 0 , yinc1 = 0, yinc2 = 0 ;
int16_t den = 0 , num = 0 ,numadd = 0 , numpixels = 0 , curpixel = 0 ;
deltax = ABS(x2 - x1);
deltay = ABS(y2 - y1);
x = x1 ;
y = y1 ;
/* The x-values are increasing or decreasing*/
if( x2 >= x1){
xinc1 = 1 ;
xinc2 = 1 ;
}else{
xinc1 = -1 ;
xinc2 = -1 ;
}
/* The y-values are increasing or decreasing*/
if( y2 >= y1){
yinc1 = 1 ;
yinc2 = 1 ;
}else{
yinc1 = -1 ;
yinc2 = -1 ;
}
if(deltax > deltay){
xinc1 = 0 ;
yinc2 = 0 ;
den = deltax ;
num = deltax / 2;
numadd = deltay ;
numpixels = deltax ;
}else{
xinc2 = 0 ;
yinc1 = 0 ;
den = deltay ;
num = deltay / 2;
numadd = deltax ;
numpixels = deltay ;
}
for(curpixel = 0 ; curpixel <= numpixels ; curpixel ++ ){
//判断边界
if( ((x+thick)>LCD_X_LENGTH)|| ((x-thick)<0) || //液晶左右边界
((y+thick)>LCD_Y_LENGTH)|| ((y-thick)<0) ){ //液晶上下边界
continue;
}
ILI9341_DrawCircle(x,y,thick,1,1);
num+= numadd ;
if(num >= den){
num -= den;
x += xinc1;
y += yinc1;
}
x += xinc2;
y += yinc2;
}
}
//================================ 文字颜色状态绘制应用函数=======================================
void LCD_SetTextColor(uint16_t Color){
CurrentForecolor = Color;
}
/**
* @brief 设置英文字体类型
* @param fonts: 指定要选择的字体
* 参数为以下值之一
* @arg:Font24x32;
* @arg:Font16x24;
* @arg:Font8x16;
* @retval None
*/
void LCD_SetFont(sFONT *fonts)
{
LCD_Currentfonts = fonts;
}
/**
* @brief 获取当前字体类型
* @param None.
* @retval 返回当前字体类型
*/
sFONT *LCD_GetFont(void)
{
return LCD_Currentfonts;
}
//================================ 文字绘制应用函数=======================================
//================================ 英文文字绘制应用函数====================================
/**
* @brief 在 ILI9341 显示器上显示一个英文字符
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下该点的起始Y坐标
* @param cChar :要显示的英文字符
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispChar_EN ( uint16_t usX, uint16_t usY, const char cChar )
{
uint8_t byteCount, bitCount,fontLength;
uint16_t ucRelativePositon;
uint8_t *Pfont;
uint16_t back_color = ILI9341_GetPointPixel(usX,usY);
//对ascii码表偏移(字模表不包含ASCII表的前32个非图形符号)
ucRelativePositon = cChar - ' ';
//每个字模的字节数
fontLength = (LCD_Currentfonts->Width*LCD_Currentfonts->Height)/8;
//字模首地址
/*ascii码表偏移值乘以每个字模的字节数,求出字模的偏移位置*/
Pfont = (uint8_t *)&LCD_Currentfonts->table[ucRelativePositon * fontLength];
//设置显示窗口
ILI9341_OpenWindow ( usX, usY, LCD_Currentfonts->Width, LCD_Currentfonts->Height);
ILI9341_Write_Cmd ( CMD_SetPixel );
//按字节读取字模数据
//由于前面直接设置了显示窗口,显示数据会自动换行
for ( byteCount = 0; byteCount < fontLength; byteCount++ )
{
//一位一位处理要显示的颜色
for ( bitCount = 0; bitCount < 8; bitCount++ )
{
if ( Pfont[byteCount] & (0x80>>bitCount) )
ILI9341_Write_Data ( CurrentForecolor );
else
ILI9341_Write_Data (back_color);
}
}
}
/**
* @brief 在 ILI9341 显示器上显示英文字符串
* @param line :在特定扫描方向下字符串的起始Y坐标
* 本参数可使用宏LINE(0)、LINE(1)等方式指定文字坐标,
* 宏LINE(x)会根据当前选择的字体来计算Y坐标值。
* 显示中文且使用LINE宏时,需要把英文字体设置成Font8x16
* @param pStr :要显示的英文字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispStringLine_EN ( uint16_t line, char * pStr ){
uint16_t usX = 0;
while ( * pStr != '\0' )
{
if ( ( usX - ILI9341_DispWindow_X_Star + LCD_Currentfonts->Width ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line += LCD_Currentfonts->Height;
}
if ( ( line - ILI9341_DispWindow_Y_Star + LCD_Currentfonts->Height ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line = ILI9341_DispWindow_Y_Star;
}
ILI9341_DispChar_EN ( usX, line, * pStr);
pStr ++;
usX += LCD_Currentfonts->Width;
}
}
/**
* @brief 在 ILI9341 显示器上显示英文字符串
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下字符的起始Y坐标
* @param pStr :要显示的英文字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispString_EN ( uint16_t usX ,uint16_t usY, char * pStr ){
while ( * pStr != '\0' )
{
if ( ( usX - ILI9341_DispWindow_X_Star + LCD_Currentfonts->Width ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY += LCD_Currentfonts->Height;
}
if ( ( usY - ILI9341_DispWindow_Y_Star + LCD_Currentfonts->Height ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
ILI9341_DispChar_EN ( usX, usY, * pStr);
pStr ++;
usX += LCD_Currentfonts->Width;
}
}
/**
* @brief 在 ILI9341 显示器上显示英文字符串(沿Y轴方向)
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下字符的起始Y坐标
* @param pStr :要显示的英文字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispString_EN_YDir ( uint16_t usX,uint16_t usY , char * pStr )
{
while ( * pStr != '\0' )
{
if ( ( usY - ILI9341_DispWindow_Y_Star + LCD_Currentfonts->Height ) >LCD_Y_LENGTH )
{
usY = ILI9341_DispWindow_Y_Star;
usX += LCD_Currentfonts->Width;
}
if ( ( usX - ILI9341_DispWindow_X_Star + LCD_Currentfonts->Width ) > LCD_X_LENGTH)
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
ILI9341_DispChar_EN ( usX, usY, * pStr);
pStr ++;
usY += LCD_Currentfonts->Height;
}
}
//================================ 中文文字绘制应用函数====================================
/**
* @brief 在 ILI9341 显示器上显示一个中文字符
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下字符的起始Y坐标
* @param usChar :要显示的中文字符(国标码)
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispChar_CH ( uint16_t usX, uint16_t usY, uint16_t usChar )
{
uint8_t rowCount, bitCount;
uint8_t ucBuffer [ WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8 ]; //16*16*8
uint16_t usTemp;
uint16_t back_color = ILI9341_GetPointPixel(usX,usY);
//设置显示窗口
ILI9341_OpenWindow ( usX, usY, WIDTH_CH_CHAR, HEIGHT_CH_CHAR ); // 16* 16
ILI9341_Write_Cmd ( CMD_SetPixel );
//取字模数据
GetGBKCode ( ucBuffer, usChar ); //第一个参数为 返回的字符图像参数 第二个参数为 中文字符号
for ( rowCount = 0; rowCount < HEIGHT_CH_CHAR; rowCount++ )
{
/* 取出两个字节的数据,在lcd上即是一个汉字的一行 */
usTemp = ucBuffer [ rowCount * 2 ];
usTemp = ( usTemp << 8 );
usTemp |= ucBuffer [ rowCount * 2 + 1 ];
for ( bitCount = 0; bitCount < WIDTH_CH_CHAR; bitCount ++ )
{
if ( usTemp & ( 0x8000 >> bitCount ) ) //高位在前
ILI9341_Write_Data ( CurrentForecolor );
else
ILI9341_Write_Data ( back_color );
}
}
}
/**
* @brief 在 ILI9341 显示器上显示中文字符串
* @param line :在特定扫描方向下字符串的起始Y坐标
* 本参数可使用宏LINE(0)、LINE(1)等方式指定文字坐标,
* 宏LINE(x)会根据当前选择的字体来计算Y坐标值。
* 显示中文且使用LINE宏时,需要把英文字体设置成Font8x16
* @param pStr :要显示的英文字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispString_CH ( uint16_t usX , uint16_t usY, char * pStr )
{
uint16_t usCh;
while( * pStr != '\0' )
{
if ( ( usX - ILI9341_DispWindow_X_Star + WIDTH_CH_CHAR ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY += HEIGHT_CH_CHAR;
}
if ( ( usY - ILI9341_DispWindow_Y_Star + HEIGHT_CH_CHAR ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
usCh = * ( uint16_t * ) pStr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
ILI9341_DispChar_CH ( usX, usY, usCh );
usX += WIDTH_CH_CHAR;
pStr += 2; //一个汉字两个字节
}
}
/**
* @brief 在 ILI9341 显示器上显示中英文字符串
* @param line :在特定扫描方向下字符串的起始Y坐标
* 本参数可使用宏LINE(0)、LINE(1)等方式指定文字坐标,
* 宏LINE(x)会根据当前选择的字体来计算Y坐标值。
* 显示中文且使用LINE宏时,需要把英文字体设置成Font8x16
* @param pStr :要显示的字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispStringLine_EN_CH ( uint16_t line, char * pStr )
{
uint16_t usCh;
uint16_t usX = 0;
while( * pStr != '\0' )
{
if ( * pStr <= 126 ) //英文字符
{
if ( ( usX - ILI9341_DispWindow_X_Star + LCD_Currentfonts->Width ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line += LCD_Currentfonts->Height;
}
if ( ( line - ILI9341_DispWindow_Y_Star + LCD_Currentfonts->Height ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line = ILI9341_DispWindow_Y_Star;
}
ILI9341_DispChar_EN ( usX, line, * pStr );
usX += LCD_Currentfonts->Width;
pStr ++;
}
else //汉字字符
{
if ( ( usX - ILI9341_DispWindow_X_Star + WIDTH_CH_CHAR ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line += HEIGHT_CH_CHAR;
}
if ( ( line - ILI9341_DispWindow_Y_Star + HEIGHT_CH_CHAR ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
line = ILI9341_DispWindow_Y_Star;
}
usCh = * ( uint16_t * ) pStr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
ILI9341_DispChar_CH ( usX, line, usCh );
usX += WIDTH_CH_CHAR;
pStr += 2; //一个汉字两个字节
}
}
}
/**
* @brief 在 ILI9341 显示器上显示中英文字符串
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下字符的起始Y坐标
* @param pStr :要显示的字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispString_EN_CH ( uint16_t usX , uint16_t usY, char * pStr )
{
uint16_t usCh;
while( * pStr != '\0' )
{
if ( * pStr <= 126 ) //英文字符
{
if ( ( usX - ILI9341_DispWindow_X_Star + LCD_Currentfonts->Width ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY += LCD_Currentfonts->Height;
}
if ( ( usY - ILI9341_DispWindow_Y_Star + LCD_Currentfonts->Height ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
ILI9341_DispChar_EN ( usX, usY, * pStr );
usX += LCD_Currentfonts->Width;
pStr ++;
}
else //汉字字符
{
if ( ( usX - ILI9341_DispWindow_X_Star + WIDTH_CH_CHAR ) > LCD_X_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY += HEIGHT_CH_CHAR;
}
if ( ( usY - ILI9341_DispWindow_Y_Star + HEIGHT_CH_CHAR ) > LCD_Y_LENGTH )
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
usCh = * ( uint16_t * ) pStr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
ILI9341_DispChar_CH ( usX, usY, usCh );
usX += WIDTH_CH_CHAR;
pStr += 2; //一个汉字两个字节
}
}
}
/**
* @brief 在 ILI9341 显示器上显示中英文字符串(沿Y轴方向)
* @param usX :在特定扫描方向下字符的起始X坐标
* @param usY :在特定扫描方向下字符的起始Y坐标
* @param pStr :要显示的中英文字符串的首地址
* @note 可使用LCD_SetBackColor、LCD_SetTextColor、LCD_SetColors函数设置颜色
* @retval 无
*/
void ILI9341_DispString_EN_CH_YDir ( uint16_t usX,uint16_t usY , char * pStr )
{
uint16_t usCh;
while( * pStr != '\0' )
{
//统一使用汉字的宽高来计算换行
if ( ( usY - ILI9341_DispWindow_Y_Star + HEIGHT_CH_CHAR ) >LCD_Y_LENGTH )
{
usY = ILI9341_DispWindow_Y_Star;
usX += WIDTH_CH_CHAR;
}
if ( ( usX - ILI9341_DispWindow_X_Star + WIDTH_CH_CHAR ) > LCD_X_LENGTH)
{
usX = ILI9341_DispWindow_X_Star;
usY = ILI9341_DispWindow_Y_Star;
}
//显示
if ( * pStr <= 126 ) //英文字符
{
ILI9341_DispChar_EN ( usX, usY, * pStr);
pStr ++;
usY += HEIGHT_CH_CHAR;
}
else //汉字字符
{
usCh = * ( uint16_t * ) pStr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
ILI9341_DispChar_CH ( usX,usY , usCh );
usY += HEIGHT_CH_CHAR;
pStr += 2; //一个汉字两个字节
}
}
}
/***********************缩放字体****************************/
#define ZOOMMAXBUFF 16384
uint8_t zoomBuff[ZOOMMAXBUFF] = {0}; //用于缩放的缓存,最大支持到128*128
uint8_t zoomTempBuff[1024] = {0};
/**
* @brief 缩放字模,缩放后的字模由1个像素点由8个数据位来表示
0x01表示笔迹,0x00表示空白区
* @param in_width :原始字符宽度
* @param in_heig :原始字符高度
* @param out_width :缩放后的字符宽度
* @param out_heig:缩放后的字符高度
* @param in_ptr :字库输入指针 注意:1pixel 1bit
* @param out_ptr :缩放后的字符输出指针 注意: 1pixel 8bit
* out_ptr实际上没有正常输出,改成了直接输出到全局指针zoomBuff中
* @param en_cn :0为英文,1为中文
* @retval 无
*/
void ILI9341_zoomChar(
uint16_t in_width, //原始字符宽度
uint16_t in_heig, //原始字符高度
uint16_t out_width, //缩放后的字符宽度
uint16_t out_heig, //缩放后的字符高度
uint8_t *in_ptr, //字库输入指针 注意:1pixel 1bit
uint8_t *out_ptr, //缩放后的字符输出指针 注意: 1pixel 8bit
uint8_t en_cn) //0为英文,1为中文
{
uint8_t *pts,*ots;
//根据源字模及目标字模大小,设定运算比例因子,左移16是为了把浮点运算转成定点运算
unsigned int xrIntFloat_16=(in_width<<16)/out_width+1;
unsigned int yrIntFloat_16=(in_heig<<16)/out_heig+1;
unsigned int srcy_16=0;
unsigned int y,x;
uint8_t *pSrcLine;
uint16_t byteCount,bitCount;
//检查参数是否合法
if(in_width >= 32) return; //字库不允许超过32像素
if(in_width * in_heig == 0) return;
if(in_width * in_heig >= 1024 ) return; //限制输入最大 32*32
if(out_width * out_heig == 0) return;
if(out_width * out_heig >= ZOOMMAXBUFF ) return; //限制最大缩放 128*128
pts = (uint8_t*)&zoomTempBuff;
//为方便运算,字库的数据由1 pixel/1bit 映射到1pixel/8bit
//0x01表示笔迹,0x00表示空白区
if(en_cn == 0x00)//英文
{
//英文和中文字库上下边界不对,可在此处调整。需要注意tempBuff防止溢出
for(byteCount=0;byteCount<in_heig*in_width/8;byteCount++)
{
for(bitCount=0;bitCount<8;bitCount++)
{
//把源字模数据由位映射到字节
//in_ptr里bitX为1,则pts里整个字节值为1
//in_ptr里bitX为0,则pts里整个字节值为0
*pts++ = (in_ptr[byteCount] & (0x80>>bitCount))?1:0;
}
}
}
else //中文
{
for(byteCount=0;byteCount<in_heig*in_width/8;byteCount++)
{
for(bitCount=0;bitCount<8;bitCount++)
{
//把源字模数据由位映射到字节
//in_ptr里bitX为1,则pts里整个字节值为1
//in_ptr里bitX为0,则pts里整个字节值为0
*pts++ = (in_ptr[byteCount] & (0x80>>bitCount))?1:0;
}
}
}
//zoom过程
pts = (uint8_t*)&zoomTempBuff; //映射后的源数据指针
ots = (uint8_t*)&zoomBuff; //输出数据的指针
for (y=0;y<out_heig;y++) /*行遍历*/
{
unsigned int srcx_16=0;
pSrcLine=pts+in_width*(srcy_16>>16);
for (x=0;x<out_width;x++) /*行内像素遍历*/
{
ots[x]=pSrcLine[srcx_16>>16]; //把源字模数据复制到目标指针中
srcx_16+=xrIntFloat_16; //按比例偏移源像素点
}
srcy_16+=yrIntFloat_16; //按比例偏移源像素点
ots+=out_width;
}
/*!!!缩放后的字模数据直接存储到全局指针zoomBuff里了*/
out_ptr = (uint8_t*)&zoomBuff; //out_ptr没有正确传出,后面调用直接改成了全局变量指针!
/*实际中如果使用out_ptr不需要下面这一句!!!
只是因为out_ptr没有使用,会导致warning。强迫症*/
out_ptr++;
}
/**
* @brief 利用缩放后的字模显示字符
* @param Xpos :字符显示位置x
* @param Ypos :字符显示位置y
* @param Font_width :字符宽度
* @param Font_Heig:字符高度
* @param c :要显示的字模数据
* @param DrawModel :是否反色显示
* @retval 无
*/
void ILI9341_DrawChar_Ex(
uint16_t usX, //字符显示位置x
uint16_t usY, //字符显示位置y
uint16_t Font_width, //字符宽度
uint16_t Font_Height, //字符高度
uint8_t *c, //字模数据
uint16_t DrawModel) //是否反色显示
{
uint32_t index = 0, counter = 0;
uint16_t back_color = ILI9341_GetPointPixel(usX,usY);
//设置显示窗口
ILI9341_OpenWindow ( usX, usY, Font_width, Font_Height);
ILI9341_Write_Cmd ( CMD_SetPixel );
//按字节读取字模数据
//由于前面直接设置了显示窗口,显示数据会自动换行
for ( index = 0; index < Font_Height; index++ )
{
//一位一位处理要显示的颜色
for ( counter = 0; counter < Font_width; counter++ )
{
//缩放后的字模数据,以一个字节表示一个像素位
//整个字节值为1表示该像素为笔迹
//整个字节值为0表示该像素为背景
if ( *c++ == DrawModel ){
ILI9341_Write_Data ( back_color ); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}else
ILI9341_Write_Data ( CurrentForecolor );
}
}
}
/**
* @brief 利用缩放后的字模显示字符串
* @param Xpos :字符显示位置x
* @param Ypos :字符显示位置y
* @param Font_width :字符宽度,英文字符在此基础上/2。注意为偶数
* @param Font_Heig:字符高度,注意为偶数
* @param c :要显示的字符串
* @param DrawModel :是否反色显示
* @retval 无
*/
void ILI9341_DisplayStringEx(
uint16_t x, //字符显示位置x
uint16_t y, //字符显示位置y
uint16_t Font_width, //要显示的字体宽度,英文字符在此基础上/2。注意为偶数
uint16_t Font_Height, //要显示的字体高度,注意为偶数
uint8_t *ptr, //显示的字符内容
uint16_t DrawModel) //是否反色显示
{
uint16_t Charwidth = Font_width; //默认为Font_width,英文宽度为中文宽度的一半
uint8_t *psr;
uint8_t Ascii; //英文
uint16_t usCh; //中文
uint8_t ucBuffer [ WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8 ];
while ( *ptr != '\0')
{
/****处理换行*****/
if ( ( x - ILI9341_DispWindow_X_Star + Charwidth ) > LCD_X_LENGTH )
{
x = ILI9341_DispWindow_X_Star;
y += Font_Height;
}
if ( ( y - ILI9341_DispWindow_Y_Star + Font_Height ) > LCD_Y_LENGTH )
{
x = ILI9341_DispWindow_X_Star;
y = ILI9341_DispWindow_Y_Star;
}
if(*ptr > 0x80) //如果是中文
{
Charwidth = Font_width;
usCh = * ( uint16_t * ) ptr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
GetGBKCode ( ucBuffer, usCh ); //取字模数据
//缩放字模数据,源字模为16*16
ILI9341_zoomChar(WIDTH_CH_CHAR,HEIGHT_CH_CHAR,Charwidth,Font_Height,(uint8_t *)&ucBuffer,psr,1);
//显示单个字符
ILI9341_DrawChar_Ex(x,y,Charwidth,Font_Height,(uint8_t*)&zoomBuff,DrawModel);
x+=Charwidth;
ptr+=2;
}
else
{
Charwidth = Font_width / 2;
Ascii = *ptr - 32;
//使用16*24字体缩放字模数据
ILI9341_zoomChar(16,24,Charwidth,Font_Height,(uint8_t *)&Font16x24.table[Ascii * Font16x24.Height*Font16x24.Width/8],psr,0);
//显示单个字符
ILI9341_DrawChar_Ex(x,y,Charwidth,Font_Height,(uint8_t*)&zoomBuff,DrawModel);
x+=Charwidth;
ptr++;
}
}
}
/**
* @brief 利用缩放后的字模显示字符串(沿Y轴方向)
* @param Xpos :字符显示位置x
* @param Ypos :字符显示位置y
* @param Font_width :字符宽度,英文字符在此基础上/2。注意为偶数
* @param Font_Heig:字符高度,注意为偶数
* @param c :要显示的字符串
* @param DrawModel :是否反色显示
* @retval 无
*/
void ILI9341_DisplayStringEx_YDir(
uint16_t x, //字符显示位置x
uint16_t y, //字符显示位置y
uint16_t Font_width, //要显示的字体宽度,英文字符在此基础上/2。注意为偶数
uint16_t Font_Height, //要显示的字体高度,注意为偶数
uint8_t *ptr, //显示的字符内容
uint16_t DrawModel) //是否反色显示
{
uint16_t Charwidth = Font_width; //默认为Font_width,英文宽度为中文宽度的一半
uint8_t *psr;
uint8_t Ascii; //英文
uint16_t usCh; //中文
uint8_t ucBuffer [ WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8 ];
while ( *ptr != '\0')
{
//统一使用汉字的宽高来计算换行
if ( ( y - ILI9341_DispWindow_X_Star + Font_width ) > LCD_X_LENGTH )
{
y = ILI9341_DispWindow_X_Star;
x += Font_width;
}
if ( ( x - ILI9341_DispWindow_Y_Star + Font_Height ) > LCD_Y_LENGTH )
{
y = ILI9341_DispWindow_X_Star;
x = ILI9341_DispWindow_Y_Star;
}
if(*ptr > 0x80) //如果是中文
{
Charwidth = Font_width;
usCh = * ( uint16_t * ) ptr;
usCh = ( usCh << 8 ) + ( usCh >> 8 );
GetGBKCode ( ucBuffer, usCh ); //取字模数据
//缩放字模数据,源字模为16*16
ILI9341_zoomChar(WIDTH_CH_CHAR,HEIGHT_CH_CHAR,Charwidth,Font_Height,(uint8_t *)&ucBuffer,psr,1);
//显示单个字符
ILI9341_DrawChar_Ex(x,y,Charwidth,Font_Height,(uint8_t*)&zoomBuff,DrawModel);
y+=Font_Height;
ptr+=2;
}
else
{
Charwidth = Font_width / 2;
Ascii = *ptr - 32;
//使用16*24字体缩放字模数据
ILI9341_zoomChar(16,24,Charwidth,Font_Height,(uint8_t *)&Font16x24.table[Ascii * Font16x24.Height*Font16x24.Width/8],psr,0);
//显示单个字符
ILI9341_DrawChar_Ex(x,y,Charwidth,Font_Height,(uint8_t*)&zoomBuff,DrawModel);
y+=Font_Height;
ptr++;
}
}
}
void Lcd_display_String(uint8_t *ptr){
LCD_SetColors(GB888(0x000000), GB888(0xFFFFFF));
ILI9341_Clear(0,(LCD_Y_LENGTH-Font24x32.Height),LCD_X_LENGTH,Font24x32.Height); /* 清屏,显示 粉色的界面 */
LCD_SetFont(&Font24x32); //制作对话框
LCD_SetForeColor( GB888(0xBB3756)); //红色文字
ILI9341_DisplayStringEx(0,LCD_Y_LENGTH-Font24x32.Height,Font24x32.Width , Font24x32.Height , ptr,0);
fn_Systick_Delay(1000,_Systick_ms);
}
建立 LCD页面绘制 文件LCD_PageHtml_book.h
代码如下 :
#ifndef __LCD_PAGEHTML_BOOK_H
#define __LCD_PAGEHTML_BOOK_H
#include "stm32f10x.h"
void Display_Char_test(void);
void Display_LCD_clear(void);
uint8_t XPT2046_Touch_Calibrate_Page (void);
void fn_Lcd_Page_Init(void);
void fn_Lcd_Page1(void);
void fn_Lcd_Page2(void);
void fn_Lcd_Page3(void);
#endif
建立 LCD页面绘制 文件LCD_PageHtml_book.c
代码如下 :
#include "LCD_PageHtml_book.h"
#include "LCD_book.h"
#include "LCD_Draw_book.h"
#include "XPT2046_LCD_Function_book.h"
#include "USART_book.h"
#include "XPT2046_LCD_Device_book.h"
#include "XPT2046_LCD_GridDiagram_book.h"
#include "fonts.h"
#include <stdio.h>
#include <string.h>
/// 自模 设计 字宽 16 字高 16
// 阴码 逐行 24 24 顺向 16进制
uint8_t test_modu[] ={
0x00,0x00,0x7F,0xFC,0x01,0x00,0x01,0x00,0x01,0x00,0x01,
0x00,0x01,0x00,0x3F,0xF8,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00 ,
0x01,0x00,0x01,0x00,0xFF,0xFE,0x00,0x00};/*"王",0*/
//#define _row_count 16
//#define _byte_count 2
//#define _bit_count 8
/// 自模 设计 字宽 32 字高 32
// 阴码 逐行 24 24 顺向 16进制
uint8_t test_modu2[2][32*32] ={
{
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,0x00,0x03,0xFF,0xFF,0xC0,0x07,0xFF,0xFF,0xC0 ,
0x04,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x01,0xFF,0xFF,0x00,0x03,0xFF,0xFF,0x00 ,
0x03,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x1F,0xFF,0xFC,0x00,0x3F,0xFF,0xFF,0xFE ,
0x7F,0x80,0x7F,0xFE,0x60,0x00,0x03,0xFC,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x02,0x00,0x00,0x03,0x87,0x00,0x00,0x03,0x87,0x00,0x18,0x07,0x87,0xC0,0x3F,0xEF,0xFF,0xC0 ,
0x3F,0xCF,0x87,0x00,0x03,0x83,0x87,0x00,0x03,0x83,0xFF,0x00,0x1F,0x83,0x87,0x00,0x3F,0xE3,0x87,0x00,0x3F,0x83,0xFF,0x00 ,
0x03,0x83,0x87,0x00,0x03,0xB3,0x87,0x00,0x03,0xFF,0xFF,0xFE,0x3F,0xDF,0xFF,0xFC,0x7E,0x18,0x00,0xFC,0x78,0x01,0x87,0x38 ,
0x40,0x03,0x87,0x80,0x00,0x0F,0x03,0xC0,0x00,0x1C,0x00,0xE0,0x00,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}/*"琪",0*/
};
#define _row_count 32
#define _byte_count 4
#define _bit_count 8
void Display_Char_test(void){
uint8_t row_count , byte_count , bit_count ;
uint8_t i;
for(i=0 ;i<2 ;i++ ){
for(row_count = 0 ;row_count< _row_count; row_count++){
printf("\n");
for(byte_count = 0 ;byte_count< _byte_count ; byte_count++){
for( bit_count = 0;bit_count < _bit_count ; bit_count++){
if(test_modu2[i][row_count*_byte_count+byte_count] &(0x80 >>bit_count)){
printf("*");
}else{
printf(" ");
}
}
}
}
}
}
void Display_LCD_clear(void){
LCD_SetColors(GB888(0x000000), GB888(0xFFFFFF));
ILI9341_Clear ( 0, 0, LCD_X_LENGTH, LCD_Y_LENGTH );
}
//================================ 页面设计函数=======================================
//================================ 页面设计函数=======================================
uint8_t XPT2046_Touch_Calibrate_Page (void){
uint8_t i;
char cStr [ 100 ];
char * pStr = 0;
LCD_SetFont(&Font8x16);
LCD_SetColors(GB888(0xFE5632),GB888(0xCFDA00));
XPT2046_Touch_Calibrate_SetStand4Pint();
for ( i = 0; i < 4; i ++ ){
ILI9341_Clear ( 0, 0, LCD_X_LENGTH, LCD_Y_LENGTH );
pStr = "Touch Calibrate 触摸校验...";
//插入空格,居中显示
sprintf(cStr,"%*c%s",((LCD_X_LENGTH/(((sFONT *)LCD_GetFont())->Width))-strlen(pStr))/2,' ',pStr) ;
ILI9341_DispStringLine_EN_CH (LCD_Y_LENGTH >> 1, cStr );
//插入空格,居中显示
sprintf ( cStr, "%*c%d",((LCD_X_LENGTH/(((sFONT *)LCD_GetFont())->Width)) -1)/2,' ',i + 1 );
ILI9341_DispStringLine_EN_CH (( LCD_Y_LENGTH >> 1 ) - (((sFONT *)LCD_GetFont())->Height), cStr );
ILI9341_Delay ( 0xFFFFF ); //适当的延时很有必要
LCD_SetForeColor( GB888(0x8C78EB));
ILI9341_DrawCircle(strCrossCoordinate[i] .x, strCrossCoordinate[i].y , 20 , 1, 1);
LCD_SetForeColor( GB888(0xDA44A6));
ILI9341_DrawCross ( strCrossCoordinate[i] .x, strCrossCoordinate[i].y ); //显示校正用的“十”字
while ( ! XPT2046_ReadAdc_Smooth_XY ( & strScreenSample [i] ) ); //读取XPT2046数据到变量pCoordinate,当ptr为空时表示没有触点被按下
}
if( XPT2046_Touch_Calibrate(_LCD_SCAN_MODE)==1){
goto XPT2046_Touch_Calibrate_SUCCESS ;
}else{
goto XPT2046_Touch_Calibrate_Failure ;
}
XPT2046_Touch_Calibrate_SUCCESS:
ILI9341_Clear ( 0, 0, LCD_X_LENGTH, LCD_Y_LENGTH );
LCD_SetColors(GB888(0x331B93),GB888(0xE4C294));
LCD_SetTextColor(GB888(0xFF5B93));
pStr = "Calibrate Succed";
//插入空格,居中显示
sprintf(cStr,"%*c%s",((LCD_X_LENGTH/(((sFONT *)LCD_GetFont())->Width))-strlen(pStr))/2,' ',pStr) ;
ILI9341_DispStringLine_EN (LCD_Y_LENGTH >> 1, cStr );
ILI9341_Delay ( 0xFFFFFF );
return 1;
XPT2046_Touch_Calibrate_Failure:
ILI9341_Clear ( 0, 0, LCD_X_LENGTH, LCD_Y_LENGTH );
LCD_SetColors(GB888(0x331B93),GB888(0xFF5B93));
LCD_SetTextColor(RED);
pStr = "Calibrate fail";
//插入空格,居中显示
sprintf(cStr,"%*c%s",((LCD_X_LENGTH/(((sFONT *)LCD_GetFont())->Width))-strlen(pStr))/2,' ',pStr) ;
ILI9341_DispStringLine_EN (LCD_Y_LENGTH >> 1, cStr );
pStr = "try again";
//插入空格,居中显示
sprintf(cStr,"%*c%s",((LCD_X_LENGTH/(((sFONT *)LCD_GetFont())->Width))-strlen(pStr))/2,' ',pStr) ;
ILI9341_DispStringLine_EN ( ( LCD_Y_LENGTH >> 1 ) + (((sFONT *)LCD_GetFont())->Height), cStr );
ILI9341_Delay ( 0xFFFFFF );
return 0;
}
//================================ 页面设计函数=======================================
void fn_Lcd_Page_Init(void){
fn_Lcd_Page4();
}
//================================ 页面设计函数=======================================
/**
* @brief 在ILI9341显示器上开辟一个窗口
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @retval 无
*/
void fn_Lcd_Page1(void){
// printf("\n-->LCD %x",GB565(255, 193 ,98));
// printf("\n-->LCD %x",GB888(0xFFC162));
ILI9341_GramScan(LCD_SCAN_MODE_6);
LCD_SetColors( GB888(0x589447), GB888(0xFFC162));
ILI9341_Clear(0,0,LCD_X_LENGTH,LCD_Y_LENGTH); /* 清屏,显示 黄色的界面 */
LCD_SetForeColor(GB888(0x589447)); //标题绿色的框
ILI9341_DrawRectangle( 0,0,LCD_X_LENGTH,25,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawLine(0,25,LCD_X_LENGTH,25,2);
LCD_SetForeColor(GB888(0xCDCDCD));
ILI9341_DrawLine(0,27,LCD_X_LENGTH,27,1);
LCD_SetForeColor(WHITE);//Wifi设计
ILI9341_DrawLine(LCD_X_LENGTH-20,19,LCD_X_LENGTH-15,19,3);
ILI9341_DrawLine(LCD_X_LENGTH-25,12,LCD_X_LENGTH-10,12,3);
ILI9341_DrawLine(LCD_X_LENGTH-28,5,LCD_X_LENGTH-7,5,3);
LCD_SetFont(&Font8x16);
LCD_SetForeColor(GB888(0xE8E5C4)); //白色文字,绿色背景
/********显示字符串示例*******/
ILI9341_DispStringLine_EN(LINE(0),"Wangqi Telephone:");
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0x000000));
ILI9341_DispStringLine_EN(LINE(3)," Personnal News:");
LCD_SetForeColor(GB888(0x589447)); //灰色的框
ILI9341_DrawRectangle( 10,65,(LCD_X_LENGTH-20),30,0,1);
LCD_SetForeColor(GB888(0xC3C09C)); //里面的
ILI9341_DrawRectangle( 11,66,(LCD_X_LENGTH-20-1),30-1,1,1);
LCD_SetFont(&Font8x16);
LCD_SetColors(GB888(0xE8E5C4), GB888(0x589447));
LCD_SetForeColor(GB888(0x589447)); //绿色的按钮
ILI9341_DrawRectangle( 180,110,(50),30,1,1);
LCD_SetForeColor(WHITE); //白色阴影
ILI9341_DrawRectangle( 180,110,(50),30,0,1);
//-------------------------
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0xC90000)); //红色文字
ILI9341_DispStringLine_EN(LINE(9)," Have Girlfriend?");
//-------------------------
LCD_SetColors( GB888(0xF0A0A1), GB888(0xFFC162)); //圆圈
ILI9341_DrawCircle(210,180,10,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawCircle(210,180,10,0,1);
LCD_SetColors( GB888(0x34BDD5), GB888(0xFFC162)); //圆圈
ILI9341_DrawCircle(210,205,10,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawCircle(210,205,10,0,1);
//-------------------------
LCD_SetFont(&Font16x24); //制作对话框
LCD_SetForeColor( GB888(0xBB3756)); //红色文字
ILI9341_DispStringLine_EN(LINE(7)," Yes!");
LCD_SetForeColor( GB888(0x310F29)); //红色文字
ILI9341_DispStringLine_EN(LINE(8)," NO!");
//-------------------------
LCD_SetForeColor(GB888(0xA6A6A6));//阴影框
ILI9341_DrawLine(0,230,LCD_X_LENGTH,230,1);
LCD_SetForeColor( GB888(0xBF5BBA)); //红色文字
ILI9341_DispStringLine_EN(LINE(10)," My LOVE ");
LCD_SetForeColor( GB888(0x2369FC)); //白色文字
ILI9341_DispStringLine_EN(LINE(12)," Hi 2021-8-14 ");
}
//=============================================================================
/**
* @brief 在ILI9341显示器上开辟一个窗口
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @retval 无
*/
void fn_Lcd_Page2(void){
// printf("\n-->LCD %x",GB565(255, 193 ,98));
// printf("\n-->LCD %x",GB888(0xFFC162));
ILI9341_GramScan(LCD_SCAN_MODE_6);
LCD_SetColors( GB888(0xF09387), GB888(0xF09387));
ILI9341_Clear(0,0,LCD_X_LENGTH,LCD_Y_LENGTH); /* 清屏,显示 粉色的界面 */
LCD_SetForeColor(GB888(0xFFDC78)); //标题绿色的框
ILI9341_DrawRectangle( 0,0,LCD_X_LENGTH,25,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawLine(0,25,LCD_X_LENGTH,25,2);
LCD_SetForeColor(GB888(0xCDCDCD));
ILI9341_DrawLine(0,27,LCD_X_LENGTH,27,1);
LCD_SetForeColor(GB888(0xA700A7));//Wifi设计
ILI9341_DrawLine(LCD_X_LENGTH-20,19,LCD_X_LENGTH-15,19,3);
ILI9341_DrawLine(LCD_X_LENGTH-25,12,LCD_X_LENGTH-10,12,3);
ILI9341_DrawLine(LCD_X_LENGTH-28,5,LCD_X_LENGTH-7,5,3);
LCD_SetFont(&Font8x16);
LCD_SetForeColor(GB888(0xA700A7)); //白色文字,绿色背景
/********显示字符串示例*******/
ILI9341_DispString_EN_CH(10,5,"输入 Telephone!");
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0x000000));
ILI9341_DispStringLine_EN_CH(LINE(3)," 信息:");
LCD_SetForeColor(GB888(0x589447)); //灰色的框
ILI9341_DrawRectangle( 10,65,(LCD_X_LENGTH-20),30,0,1);
LCD_SetForeColor(GB888(0xC3C09C)); //里面的
ILI9341_DrawRectangle( 11,66,(LCD_X_LENGTH-20-1),30-1,1,1);
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0x000000));
ILI9341_DispString_CH(13,72,"不顾一切的去看你");
LCD_SetFont(&Font8x16);
LCD_SetColors(GB888(0xE8E5C4), GB888(0x589447));
LCD_SetForeColor(GB888(0x589447)); //绿色的按钮
ILI9341_DrawRectangle( 180,110,(50),30,1,1);
LCD_SetForeColor(WHITE); //白色阴影
ILI9341_DrawRectangle( 180,110,(50),30,0,1);
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0x000000));
ILI9341_DispStringLine_EN_CH(LINE(7)," 确定");
//-------------------------
LCD_SetFont(&Font8x16); //制作对话框
LCD_SetForeColor( GB888(0xC90000)); //红色文字
ILI9341_DispStringLine_EN_CH(LINE(9)," 回忆化成蝶?");
//-------------------------
LCD_SetColors( GB888(0xF0A0A1), GB888(0xFFC162)); //圆圈
ILI9341_DrawCircle(210,180,10,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawCircle(210,180,10,0,1);
LCD_SetColors( GB888(0x34BDD5), GB888(0xFFC162)); //圆圈
ILI9341_DrawCircle(210,205,10,1,1);
LCD_SetForeColor(GB888(0x797979));//阴影框
ILI9341_DrawCircle(210,205,10,0,1);
//-------------------------
LCD_SetFont(&Font24x32); //制作对话框
LCD_SetForeColor( GB888(0xBB3756)); //红色文字
ILI9341_DisplayStringEx(0,200,Font24x32.Width , Font24x32.Height , " Yes!",0);
LCD_SetForeColor( GB888(0x310F29)); //红色文字
ILI9341_DisplayStringEx(0,230,Font24x32.Width , Font24x32.Height ," NO!",0);
//-------------------------
LCD_SetForeColor(GB888(0xA6A6A6));//阴影框
ILI9341_DrawLine(0,230,LCD_X_LENGTH,230,1);
LCD_SetForeColor( GB888(0xBF5BBA)); //红色文字
ILI9341_DisplayStringEx(0,260,Font24x32.Width , Font24x32.Height ," My LOVE ",0);
LCD_SetForeColor( GB888(0x2369FC)); //白色文字
LCD_SetFont(&Font16x24); //制作对话框
ILI9341_DispStringLine_EN(LINE(12)," Hi 2021-8-16 ");
}
//=============================================================================
/**
* @brief 在ILI9341显示器上开辟一个窗口
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @retval 无
*/
void fn_Lcd_Page3(void){
//绘制触摸画板界面
Palette_Init(_LCD_SCAN_MODE ,CL_WHITE , CL_BLACK);
}
//=============================================================================
/**
* @brief 在ILI9341显示器上开辟一个窗口
* @param usX :在特定扫描方向下窗口的起点X坐标
* @param usY :在特定扫描方向下窗口的起点Y坐标
* @param usWidth :窗口的宽度
* @param usHeight :窗口的高度
* @retval 无
*/
void fn_Lcd_Page4(void){
//绘制触摸画板界面
GridDiagram_Init();
}
建立 LCD 文字库 内存管理文件fonts.h
代码如下 :
#ifndef __FONT_H
#define __FONT_H
#include "stm32f10x.h"
/** @defgroup FONTS_Exported_Types
* @{
*/
typedef struct _tFont
{
const uint8_t *table;
uint16_t Width;
uint16_t Height;
} sFONT;
extern sFONT Font24x32;
extern sFONT Font16x24;
extern sFONT Font8x16;
/*******************中文********** 在显示屏上显示的字符大小 ***************************/
#define WIDTH_CH_CHAR 16 //中文字符宽度
#define HEIGHT_CH_CHAR 16 //中文字符高度
#define LINE(x) ((x) * (((sFONT *)LCD_GetFont())->Height))
//LINEY统一使用汉字字模的高度
#define LINEY(x) ((x) * (WIDTH_CH_CHAR))
//0表示使用SD卡字模,非零表示FLASH字模,由于SD卡字模有文件系统,速度慢很多。
#define GBKCODE_FLASH 1
#if GBKCODE_FLASH
/*使用FLASH字模*/
/*中文字库存储在FLASH的起始地址*/
/*FLASH*/
#define GBKCODE_START_ADDRESS 387*4096
/*获取字库的函数*/
//定义获取中文字符字模数组的函数名,ucBuffer为存放字模数组名,usChar为中文字符(国标码)
#define GetGBKCode( ucBuffer, usChar ) GetGBKCode_from_EXFlash( ucBuffer, usChar )
int GetGBKCode_from_EXFlash( uint8_t * pBuffer, uint16_t c);
#else
/*使用SD字模*/
/*SD卡字模路径*/
#define GBKCODE_FILE_NAME "0:/Font/GB2312_H1616.FON"
/*获取字库的函数*/
//定义获取中文字符字模数组的函数名,ucBuffer为存放字模数组名,usChar为中文字符(国标码)
#define GetGBKCode( ucBuffer, usChar ) GetGBKCode_from_sd( ucBuffer, usChar )
int GetGBKCode_from_sd ( uint8_t * pBuffer, uint16_t c);
#endif
#endif /*end of __FONT_H */
建立 LCD 文字库 内存管理文件fonts.c
代码如下 :
/**
******************************************************************************
* @file bsp_ili9341_lcd.c
* @version V1.0
* @date 2013-xx-xx
* @brief 液晶屏字模相关(仅支持英文)
******************************************************************************
* @attention
*
* 实验平台:野火 F103-霸道 STM32 开发板
* 论坛 :http://www.firebbs.cn
* 淘宝 :https://fire-stm32.taobao.com
*
******************************************************************************
*/
#include "./fonts.h"
#include "SPI_book.h"
/***********************英文字模******************************/
/*
* 常用ASCII表,偏移量32,大小:16(高度)* 8 (宽度)
*/
/***********************英文字模******************************/
/*
* 常用ASCII表,偏移量32,大小:16(高度)* 8 (宽度)
*/
const uint8_t ASCII8x16_Table [ ] = { //@conslons字体,阴码点阵格式,逐行顺向取摸
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x08,0x00,0x08,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x34,0x24,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x16,0x24,0x7f,0x24,0x24,0x24,0x7e,0x24,0x24,0x00,0x00,0x00,
0x00,0x00,0x00,0x08,0x3e,0x68,0x48,0x68,0x1c,0x16,0x12,0x12,0x7c,0x10,0x10,0x00,
0x00,0x00,0x00,0x61,0xd2,0x96,0x74,0x08,0x10,0x16,0x29,0x49,0xc6,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x64,0x64,0x38,0x72,0x4a,0xce,0x46,0x7f,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x04,0x08,0x18,0x10,0x30,0x30,0x30,0x30,0x10,0x10,0x18,0x0c,0x04,
0x00,0x00,0x00,0x20,0x10,0x08,0x08,0x0c,0x04,0x04,0x04,0x0c,0x08,0x18,0x10,0x20,
0x00,0x00,0x00,0x08,0x0a,0x34,0x1c,0x6a,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x7f,0x18,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x08,0x30,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x02,0x06,0x04,0x0c,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x47,0x5b,0x73,0x42,0x66,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x18,0x78,0x48,0x08,0x08,0x08,0x08,0x08,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x46,0x06,0x06,0x04,0x08,0x10,0x20,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x06,0x06,0x04,0x3c,0x02,0x02,0x06,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0c,0x1c,0x14,0x24,0x64,0x44,0xff,0x04,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7e,0x02,0x02,0x06,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x30,0x60,0x48,0x76,0x42,0x42,0x62,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x02,0x06,0x04,0x0c,0x08,0x18,0x10,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x62,0x42,0x36,0x1c,0x66,0x42,0x42,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x1a,0x02,0x04,0x78,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x08,0x30,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x18,0x30,0x60,0x10,0x0c,0x06,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x18,0x04,0x06,0x0c,0x10,0x20,0x00,0x00,0x00,
0x00,0x00,0x00,0x30,0x1c,0x06,0x06,0x06,0x18,0x10,0x00,0x10,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x22,0x41,0x41,0xdd,0xb5,0xa5,0xa5,0xaf,0x94,0xc0,0x40,0x3c,
0x00,0x00,0x00,0x00,0x18,0x1c,0x34,0x24,0x26,0x62,0x7e,0x43,0xc1,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x46,0x42,0x46,0x7c,0x42,0x42,0x42,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x20,0x40,0x40,0x40,0x40,0x40,0x60,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x46,0x42,0x43,0x43,0x43,0x42,0x46,0x78,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7e,0x60,0x60,0x60,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x60,0x60,0x60,0x7e,0x60,0x60,0x60,0x60,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x60,0x40,0x40,0xce,0x42,0x42,0x62,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x70,0x58,0x4c,0x44,0x42,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x66,0x67,0x5f,0x5b,0x5b,0xc1,0xc1,0xc1,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x62,0x72,0x52,0x5a,0x4a,0x4e,0x46,0x46,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x62,0x43,0xc3,0xc3,0xc3,0x43,0x62,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7c,0x46,0x42,0x42,0x46,0x78,0x40,0x40,0x40,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x62,0x43,0xc3,0xc3,0xc3,0x43,0x62,0x3c,0x18,0x0f,0x00,
0x00,0x00,0x00,0x00,0x7c,0x66,0x62,0x66,0x7c,0x6c,0x64,0x66,0x62,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3e,0x60,0x40,0x60,0x1c,0x06,0x02,0x02,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x62,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xc1,0x43,0x42,0x62,0x26,0x24,0x34,0x1c,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xc1,0xc1,0x41,0x49,0x5b,0x5b,0x76,0x66,0x66,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x43,0x66,0x34,0x18,0x18,0x1c,0x24,0x66,0xc3,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xc1,0x42,0x66,0x34,0x1c,0x18,0x18,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7e,0x02,0x04,0x0c,0x18,0x10,0x20,0x60,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1c,
0x00,0x00,0x00,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x0c,0x04,0x06,0x02,0x00,0x00,
0x00,0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,
0x00,0x00,0x00,0x00,0x18,0x1c,0x24,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x06,0x02,0x3e,0x42,0x46,0x7a,0x00,0x00,0x00,
0x00,0x00,0x00,0x40,0x40,0x40,0x5c,0x62,0x42,0x42,0x42,0x42,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x20,0x60,0x40,0x60,0x20,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x02,0x02,0x02,0x3e,0x62,0x42,0x42,0x42,0x66,0x3a,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x62,0x42,0x7e,0x40,0x60,0x3e,0x00,0x00,0x00,
0x00,0x00,0x00,0x0f,0x18,0x10,0x10,0x7e,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x66,0x42,0x66,0x58,0x40,0x3e,0x43,0x42,0x3c,
0x00,0x00,0x00,0x40,0x40,0x40,0x5c,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0x18,0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x04,0x0c,0x00,0x7c,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x0c,0x78,
0x00,0x00,0x00,0x60,0x60,0x60,0x62,0x6c,0x78,0x70,0x68,0x64,0x62,0x00,0x00,0x00,
0x00,0x00,0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x4b,0x4b,0x4b,0x4b,0x4b,0x4b,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x62,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x62,0x42,0x43,0x42,0x62,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x5c,0x62,0x42,0x42,0x42,0x42,0x7c,0x40,0x40,0x40,
0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x62,0x42,0x42,0x42,0x66,0x3a,0x02,0x02,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x72,0x63,0x60,0x60,0x60,0x60,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x20,0x20,0x3c,0x06,0x02,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x10,0xfe,0x10,0x10,0x10,0x10,0x10,0x1e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x66,0x3a,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x42,0x66,0x24,0x34,0x18,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xc1,0xc1,0x5b,0x5a,0x5e,0x66,0x66,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x26,0x1c,0x18,0x1c,0x26,0x62,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x42,0x66,0x24,0x34,0x1c,0x18,0x18,0x30,0xe0,
0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x06,0x0c,0x18,0x10,0x20,0x7e,0x00,0x00,0x00,
0x00,0x00,0x00,0x0e,0x18,0x10,0x10,0x10,0x30,0x70,0x10,0x10,0x10,0x10,0x18,0x0e,
0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x00,0x00,0x00,0x30,0x18,0x08,0x08,0x08,0x0c,0x0e,0x08,0x08,0x08,0x08,0x18,0x30,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x71,0x4b,0x06,0x00,0x00,0x00,0x00,0x00,
};
/*
* 常用ASCII表,偏移量32,大小:24(高度)* 16 (宽度)
*/
const uint8_t ASCII16x24_Table [ ] = { //@conslons字体,阴码点阵格式,逐行顺向取摸
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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,
0x00,0x00,0x03,0xc0,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x70,0x0e,0x70,0x0e,0x70,
0x0c,0x30,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,0x00,0x00,0x00,0x06,0x18,0x06,0x38,
0x06,0x30,0x7f,0xfe,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x7f,0xfe,0x0c,0x60,
0x1c,0x60,0x18,0x60,0x18,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0xc0,0x0f,0xf8,0x3c,0xc8,
0x31,0xc0,0x31,0x80,0x3d,0x80,0x1f,0x80,0x03,0xf0,0x01,0xf8,0x03,0x1c,0x03,0x0c,
0x03,0x1c,0x3f,0xf8,0x3f,0xe0,0x07,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x7e,0x0e,0x63,0x0c,0x63,0x18,
0x63,0x30,0x7e,0x60,0x00,0xc0,0x01,0x80,0x03,0x00,0x07,0x7c,0x0e,0xe6,0x1c,0xc6,
0x18,0xc6,0x30,0xc6,0x60,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x1c,0xf0,0x38,0x70,
0x38,0x70,0x1c,0x60,0x1f,0xc0,0x0f,0x00,0x3f,0x8c,0x71,0xcc,0x60,0xec,0x60,0x7c,
0x70,0x38,0x3c,0xfc,0x1f,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x01,0x80,0x01,0x80,
0x01,0x80,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,0x30,0x00,0xe0,0x01,0xc0,0x01,0x80,
0x03,0x00,0x07,0x00,0x06,0x00,0x06,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,
0x06,0x00,0x07,0x00,0x03,0x00,0x03,0x80,0x01,0xc0,0x00,0xe0,0x00,0x30,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x06,0x00,0x03,0x80,0x01,0x80,
0x01,0xc0,0x00,0xe0,0x00,0x60,0x00,0x60,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x60,
0x00,0x60,0x00,0xe0,0x00,0xc0,0x01,0x80,0x03,0x80,0x06,0x00,0x0c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x11,0x88,0x1d,0xb8,
0x03,0xc0,0x07,0xe0,0x3d,0xbc,0x01,0x88,0x01,0x80,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,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x7f,0xfe,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,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,0x00,0x00,0x00,0x00,0x00,
0x03,0xc0,0x03,0xc0,0x01,0xc0,0x01,0xc0,0x03,0x80,0x1f,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,0x0f,0xf0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xc0,0x03,0xc0,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x38,0x00,0x30,
0x00,0x60,0x00,0xe0,0x00,0xc0,0x01,0xc0,0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,
0x0e,0x00,0x0c,0x00,0x1c,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x0f,0xf0,0x1c,0x38,
0x38,0x1c,0x30,0x1c,0x70,0x7e,0x70,0xee,0x73,0x8e,0x7e,0x0e,0x7c,0x0c,0x30,0x0c,
0x38,0x1c,0x1e,0x78,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xc0,0x1f,0xc0,
0x39,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,
0x01,0xc0,0x3f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x1f,0xf0,0x18,0x38,
0x00,0x38,0x00,0x18,0x00,0x38,0x00,0x38,0x00,0x70,0x01,0xe0,0x03,0x80,0x07,0x00,
0x1c,0x00,0x3f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x1f,0xf0,0x00,0x38,
0x00,0x38,0x00,0x38,0x00,0x30,0x07,0xe0,0x07,0xf0,0x00,0x38,0x00,0x1c,0x00,0x1c,
0x00,0x18,0x20,0xf8,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x01,0xb0,
0x03,0x30,0x07,0x30,0x0e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x7f,0xfe,0x7f,0xfe,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x18,0x00,
0x18,0x00,0x18,0x00,0x18,0x00,0x1f,0xe0,0x00,0xf8,0x00,0x1c,0x00,0x1c,0x00,0x1c,
0x00,0x38,0x00,0xf0,0x1f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf8,0x0f,0x00,
0x1c,0x00,0x18,0x00,0x30,0x00,0x37,0xf8,0x3c,0x3c,0x30,0x0c,0x30,0x0c,0x38,0x0c,
0x38,0x1c,0x1e,0x38,0x0f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xfc,0x00,0x1c,
0x00,0x18,0x00,0x38,0x00,0x70,0x00,0x60,0x00,0xe0,0x01,0xc0,0x01,0x80,0x03,0x80,
0x07,0x00,0x06,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x1f,0xf8,0x38,0x1c,
0x38,0x1c,0x38,0x1c,0x1c,0x38,0x0f,0xf0,0x07,0xf0,0x1c,0x78,0x38,0x1c,0x30,0x0c,
0x38,0x1c,0x3c,0x38,0x0f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x1f,0xf0,0x38,0x38,
0x30,0x1c,0x70,0x1c,0x70,0x0c,0x38,0x0c,0x1f,0xfc,0x0f,0xcc,0x00,0x1c,0x00,0x18,
0x00,0x70,0x1f,0xe0,0x1f,0x80,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,0x03,0xc0,0x03,0xc0,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xc0,0x03,0xc0,0x03,0xc0,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,0x03,0xc0,0x03,0xc0,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0xc0,0x03,0xc0,0x01,0xc0,0x01,0xc0,0x03,0x80,0x0f,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x00,0xf0,0x01,0xc0,0x07,0x00,0x1e,0x00,0x38,0x00,0x0e,0x00,0x07,0x80,
0x01,0xc0,0x00,0x70,0x00,0x30,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,0x3f,0xfc,0x00,0x00,0x00,0x00,0x3f,0xfc,0x3f,0xfc,
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,0x0f,0x00,0x03,0x80,0x01,0xe0,0x00,0x78,0x00,0x1c,0x00,0x70,0x01,0xe0,
0x03,0x80,0x0e,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xc0,0x00,0xf0,0x00,0x38,
0x00,0x38,0x00,0x38,0x00,0x38,0x03,0xf0,0x03,0x80,0x03,0x00,0x03,0x00,0x00,0x00,
0x00,0x00,0x07,0x80,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xf8,0x0c,0x0c,0x18,0x06,
0x30,0x06,0x70,0x03,0x63,0xf3,0x66,0x33,0xc6,0x73,0xcc,0x63,0xcc,0x62,0xcc,0x66,
0xcc,0xe6,0xc7,0xfc,0xe0,0x00,0x60,0x00,0x70,0x00,0x38,0x10,0x1f,0xf0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x07,0xe0,
0x06,0xe0,0x0e,0x70,0x0e,0x70,0x0c,0x30,0x1c,0x38,0x18,0x18,0x3f,0xfc,0x3f,0xfc,
0x70,0x0e,0x60,0x0e,0xe0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x38,0x38,
0x38,0x1c,0x38,0x1c,0x38,0x38,0x3f,0xf0,0x3f,0xf8,0x38,0x1c,0x38,0x0c,0x38,0x0c,
0x38,0x1c,0x3f,0xf8,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x07,0xfc,0x1e,0x04,
0x38,0x00,0x38,0x00,0x30,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x30,0x00,0x38,0x00,
0x3c,0x00,0x1f,0x9c,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x30,0x78,
0x30,0x1c,0x30,0x0c,0x30,0x0e,0x30,0x0e,0x30,0x0e,0x30,0x0e,0x30,0x0e,0x30,0x1c,
0x30,0x38,0x3f,0xf0,0x3f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x18,0x00,
0x18,0x00,0x18,0x00,0x18,0x00,0x1f,0xf8,0x1f,0xf8,0x18,0x00,0x18,0x00,0x18,0x00,
0x18,0x00,0x1f,0xf8,0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x18,0x00,
0x18,0x00,0x18,0x00,0x18,0x00,0x1f,0xf8,0x1f,0xf8,0x18,0x00,0x18,0x00,0x18,0x00,
0x18,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x07,0xfc,0x1e,0x04,
0x38,0x00,0x30,0x00,0x70,0x00,0x70,0x00,0x70,0xfc,0x70,0x0c,0x70,0x0c,0x30,0x0c,
0x38,0x0c,0x1f,0x1c,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x0c,0x30,0x0c,
0x30,0x0c,0x30,0x0c,0x30,0x0c,0x3f,0xfc,0x3f,0xfc,0x30,0x0c,0x30,0x0c,0x30,0x0c,
0x30,0x0c,0x30,0x0c,0x30,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xfc,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x3f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf0,0x00,0x30,
0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,0x00,0x30,
0x00,0x70,0x1d,0xe0,0x1f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x1c,0x38,0x70,
0x38,0xe0,0x39,0xc0,0x3b,0x80,0x3f,0x00,0x3f,0x00,0x3b,0x80,0x39,0xc0,0x38,0xe0,
0x38,0x70,0x38,0x38,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x1c,0x00,
0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,
0x1c,0x00,0x1f,0xfc,0x1f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x1c,0x7c,0x3c,
0x6c,0x3e,0x6e,0x6e,0x66,0x6e,0x66,0xce,0x63,0xc6,0x63,0x86,0x61,0x86,0x60,0x06,
0x60,0x06,0x60,0x06,0x60,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x0c,0x3c,0x0c,
0x3e,0x0c,0x36,0x0c,0x33,0x0c,0x33,0x8c,0x31,0x8c,0x31,0xcc,0x30,0xec,0x30,0x6c,
0x30,0x7c,0x30,0x3c,0x30,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc0,0x0f,0xf8,0x1c,0x3c,
0x38,0x1c,0x70,0x0e,0x70,0x0e,0x60,0x06,0x60,0x06,0x70,0x0e,0x70,0x0e,0x70,0x0c,
0x38,0x1c,0x1e,0x78,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x38,0x3c,
0x38,0x1c,0x38,0x0c,0x38,0x0c,0x38,0x1c,0x38,0x78,0x3f,0xe0,0x38,0x00,0x38,0x00,
0x38,0x00,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc0,0x0f,0xf8,0x1c,0x3c,
0x38,0x1c,0x70,0x0e,0x70,0x0e,0x60,0x06,0x60,0x06,0x70,0x0e,0x70,0x0e,0x70,0x0c,
0x38,0x1c,0x1e,0x78,0x0f,0xe0,0x01,0x80,0x01,0xc0,0x00,0xff,0x00,0x3c,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x38,0x38,
0x38,0x18,0x38,0x18,0x38,0x38,0x38,0xf0,0x3f,0xc0,0x38,0xe0,0x38,0x70,0x38,0x38,
0x38,0x38,0x38,0x1c,0x38,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe0,0x0f,0xf8,0x38,0x00,
0x38,0x00,0x38,0x00,0x3c,0x00,0x1f,0x80,0x03,0xf0,0x00,0x78,0x00,0x1c,0x00,0x1c,
0x00,0x1c,0x38,0x78,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x0c,0x30,0x0c,
0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,0x30,0x0c,
0x38,0x1c,0x1c,0x38,0x0f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x06,0x70,0x0e,
0x70,0x0e,0x38,0x1c,0x38,0x1c,0x1c,0x18,0x1c,0x38,0x0c,0x30,0x0e,0x70,0x06,0x60,
0x07,0xe0,0x03,0xc0,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x06,0x60,0x06,
0x60,0x06,0x60,0x06,0x61,0x86,0x63,0x86,0x73,0xc6,0x73,0xce,0x76,0x6c,0x36,0x6c,
0x3c,0x3c,0x3c,0x3c,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x1c,0x38,0x18,
0x1c,0x38,0x0e,0x70,0x07,0xe0,0x03,0xc0,0x03,0xc0,0x07,0xe0,0x0e,0x70,0x1c,0x38,
0x18,0x38,0x38,0x1c,0x70,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0e,0x70,0x0c,
0x38,0x1c,0x1c,0x38,0x0e,0x70,0x06,0x60,0x07,0xe0,0x03,0xc0,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xfc,0x00,0x1c,
0x00,0x38,0x00,0x70,0x00,0xe0,0x01,0xc0,0x03,0x80,0x07,0x00,0x0e,0x00,0x0c,0x00,
0x18,0x00,0x3f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xf0,0x07,0xf0,0x06,0x00,0x06,0x00,
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x07,0xf0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x1c,0x00,0x0c,0x00,
0x06,0x00,0x07,0x00,0x03,0x00,0x03,0x80,0x01,0x80,0x01,0xc0,0x00,0xc0,0x00,0x60,
0x00,0x70,0x00,0x30,0x00,0x38,0x00,0x18,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x0f,0xe0,0x00,0x60,0x00,0x60,
0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,
0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x0f,0xe0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x06,0xc0,
0x06,0x60,0x0c,0x30,0x18,0x18,0x30,0x1c,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,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,0xff,0xff,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x03,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1f,0xf0,0x10,0x38,0x00,0x1c,0x00,0x1c,0x0f,0xfc,0x1c,0x1c,0x38,0x1c,
0x38,0x1c,0x3c,0xfc,0x1f,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x38,0x00,0x38,0x00,
0x38,0x00,0x3b,0xf8,0x3e,0x1c,0x3c,0x1c,0x38,0x0c,0x38,0x0c,0x38,0x0c,0x38,0x0c,
0x38,0x1c,0x3c,0x78,0x1f,0xe0,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,0x07,0xf8,0x0e,0x00,0x1c,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,
0x1c,0x00,0x0f,0x18,0x07,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x1c,0x00,0x1c,
0x00,0x1c,0x0f,0xfc,0x1c,0x1c,0x38,0x1c,0x30,0x1c,0x30,0x1c,0x30,0x1c,0x30,0x1c,
0x38,0x3c,0x1c,0xfc,0x0f,0x9c,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,0x0f,0xf0,0x1c,0x38,0x38,0x1c,0x30,0x0c,0x3f,0xfc,0x30,0x00,0x30,0x00,
0x38,0x00,0x1e,0x0c,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x01,0xfe,0x03,0x80,0x03,0x00,
0x03,0x00,0x03,0x00,0x7f,0xfc,0x7f,0xfc,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
0x03,0x00,0x03,0x00,0x03,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,0x0f,0xfe,0x1c,0x38,0x38,0x18,0x38,0x18,0x18,0x38,0x1f,0xf0,0x3b,0x80,
0x30,0x00,0x3f,0xf0,0x1f,0xfc,0x30,0x0e,0x70,0x0e,0x38,0x1c,0x1f,0xf8,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x38,0x00,0x38,0x00,
0x38,0x00,0x3b,0xf8,0x3e,0x38,0x3c,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,
0x38,0x1c,0x38,0x1c,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0xc0,0x03,0xc0,0x00,0x00,
0x00,0x00,0x1f,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,
0x01,0xc0,0x01,0xc0,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x70,0x00,0x70,0x00,0x00,
0x00,0x00,0x3f,0xf0,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,
0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x20,0xe0,0x3f,0xc0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x18,0x00,
0x18,0x00,0x18,0x3c,0x18,0x70,0x18,0xe0,0x1b,0x80,0x1f,0x00,0x1b,0x80,0x19,0xe0,
0x18,0x70,0x18,0x38,0x18,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xc0,0x01,0xc0,0x01,0xc0,
0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,
0x01,0xc0,0x01,0xc0,0x3f,0xfc,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,0x6f,0x3c,0x79,0xee,0x71,0xce,0x71,0x8e,0x71,0x8e,0x71,0x8e,0x71,0x8e,
0x71,0x8e,0x71,0x8e,0x71,0x8e,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,0x3b,0xf8,0x3e,0x38,0x3c,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,
0x38,0x1c,0x38,0x1c,0x38,0x1c,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,0x0f,0xf0,0x1c,0x3c,0x38,0x1c,0x70,0x0e,0x70,0x0e,0x70,0x0e,0x70,0x0c,
0x38,0x1c,0x1e,0x78,0x0f,0xe0,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,0x3b,0xf8,0x3e,0x1c,0x3c,0x1c,0x38,0x0c,0x38,0x0c,0x38,0x0c,0x38,0x0c,
0x38,0x1c,0x3c,0x78,0x3f,0xe0,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0f,0xfc,0x1c,0x1c,0x38,0x1c,0x30,0x1c,0x30,0x1c,0x30,0x1c,0x30,0x1c,
0x38,0x3c,0x1c,0xfc,0x0f,0x9c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x1c,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x19,0xf8,0x1f,0x1c,0x1c,0x0c,0x18,0x0e,0x18,0x00,0x18,0x00,0x18,0x00,
0x18,0x00,0x18,0x00,0x18,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,0x0f,0xf8,0x1c,0x00,0x18,0x00,0x1e,0x00,0x0f,0xc0,0x01,0xf8,0x00,0x18,
0x00,0x18,0x18,0x38,0x1f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,
0x06,0x00,0x7f,0xfc,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
0x07,0x00,0x07,0x84,0x01,0xfc,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,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,0x38,0x1c,
0x38,0x3c,0x1c,0xfc,0x0f,0xdc,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,0x70,0x0c,0x38,0x1c,0x38,0x18,0x1c,0x38,0x0c,0x30,0x0e,0x70,0x06,0x60,
0x07,0xe0,0x03,0xc0,0x03,0xc0,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,0x60,0x06,0x60,0x06,0x61,0x86,0x73,0x8e,0x73,0xcc,0x33,0xcc,0x36,0x6c,
0x36,0x6c,0x3c,0x3c,0x3c,0x38,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,0x38,0x1c,0x1c,0x38,0x0e,0x70,0x07,0xe0,0x03,0xc0,0x03,0xc0,0x07,0xe0,
0x0e,0x70,0x1c,0x38,0x38,0x1e,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,0x70,0x0c,0x38,0x1c,0x38,0x18,0x1c,0x38,0x0c,0x30,0x0e,0x70,0x06,0x60,
0x07,0xe0,0x03,0xc0,0x03,0xc0,0x03,0x80,0x07,0x00,0x0e,0x00,0x7c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1f,0xf8,0x00,0x38,0x00,0x70,0x00,0xe0,0x01,0xc0,0x03,0x80,0x07,0x00,
0x0c,0x00,0x1f,0xfc,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x01,0xf8,0x03,0x80,0x03,0x80,
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x00,0x3f,0x00,0x3e,0x00,0x03,0x00,0x03,0x80,
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x01,0xc0,0x00,0xf8,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x1f,0x80,0x01,0x80,0x01,0xc0,
0x01,0xc0,0x01,0xc0,0x01,0xc0,0x00,0xc0,0x00,0xfc,0x00,0x7c,0x00,0xc0,0x01,0xc0,
0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x01,0xc0,0x03,0x80,0x1f,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,0x3f,0x06,0x71,0xce,0x60,0xfc,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
/*
* 常用ASCII表,偏移量32,大小:32(高度)* 24 (宽度)
*/
const uint8_t ASCII24x32_Table [ ] = { //@conslons字体,阴码点阵格式,逐行顺向取摸
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,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,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,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,
0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3c,0x00,0x00,0x7e,0x00,0x00,0x3c,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,0x00,0x03,0xc3,0xe0,0x03,0xc3,0xe0,0x03,0xc3,0xc0,0x03,0xc3,0xc0,0x03,0xc3,
0xc0,0x03,0xc3,0xc0,0x03,0xc1,0xc0,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,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,0x00,0x00,0x00,0x01,0xe0,0xe0,0x01,0xc0,0xe0,0x01,0xc0,
0xe0,0x01,0xc0,0xe0,0x3f,0xff,0xfe,0x3f,0xff,0xfe,0x03,0xc1,0xc0,0x03,0x81,0xc0,
0x03,0x81,0xc0,0x03,0x81,0xc0,0x7f,0xff,0xfc,0x7f,0xff,0xfc,0x07,0x83,0x80,0x07,
0x03,0x80,0x07,0x03,0x80,0x07,0x03,0x80,0x07,0x07,0x80,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,
0x07,0x00,0x00,0x0f,0x00,0x00,0x0e,0x00,0x01,0xff,0xf0,0x07,0xff,0xf0,0x1f,0x0e,
0x00,0x1e,0x1e,0x00,0x1e,0x1c,0x00,0x1e,0x1c,0x00,0x0f,0xdc,0x00,0x07,0xfc,0x00,
0x00,0xff,0x80,0x00,0x3f,0xf0,0x00,0x38,0xf8,0x00,0x38,0x78,0x00,0x78,0x3c,0x00,
0x70,0x78,0x30,0x71,0xf8,0x3f,0xff,0xe0,0x1f,0xff,0x00,0x00,0xe0,0x00,0x00,0xe0,
0x00,0x00,0xe0,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,0x0f,0x80,0x0f,0x3f,0xe0,0x1e,0x78,0x70,0x3c,0x70,0x70,0x70,0x70,0x70,
0xe0,0x70,0x71,0xc0,0x3f,0xe3,0x80,0x1f,0xc7,0x00,0x00,0x0e,0x00,0x00,0x1c,0x00,
0x00,0x78,0x00,0x00,0xf0,0xf0,0x01,0xe7,0xfc,0x03,0xcf,0x0e,0x07,0x8e,0x0e,0x0f,
0x0e,0x0e,0x1e,0x0e,0x0e,0x3c,0x07,0xbc,0x70,0x03,0xf8,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,0x00,0x00,0x00,0x01,0xff,0x00,0x07,0xff,0x80,0x0f,0x03,0xc0,0x0f,0x03,
0xc0,0x0f,0x03,0xc0,0x0f,0x07,0x80,0x07,0x9f,0x00,0x03,0xfe,0x00,0x03,0xf0,0x00,
0x0f,0xf8,0x3c,0x3e,0x7c,0x3c,0x3c,0x1f,0x3c,0x78,0x0f,0xf8,0x78,0x07,0xf8,0x7c,
0x01,0xf0,0x3e,0x03,0xf8,0x1f,0xff,0xfc,0x07,0xfe,0x1f,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,0x00,0x3e,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,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,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,0x80,0x00,0x01,0xc0,0x00,0x07,0x80,0x00,0x0f,0x00,0x00,0x1e,0x00,0x00,0x3c,
0x00,0x00,0x78,0x00,0x00,0xf0,0x00,0x00,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,
0x01,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x01,0xc0,0x00,0x01,0xe0,0x00,0x01,
0xe0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x00,0x78,0x00,0x00,0x3c,0x00,0x00,0x1e,
0x00,0x00,0x0f,0x00,0x00,0x07,0xc0,0x00,0x01,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0xc0,0x00,0x01,0xe0,0x00,0x00,0xf0,0x00,0x00,0x7c,0x00,0x00,0x3e,
0x00,0x00,0x1e,0x00,0x00,0x0f,0x00,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x03,0x80,
0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0x80,0x00,
0x07,0x80,0x00,0x07,0x80,0x00,0x0f,0x00,0x00,0x1e,0x00,0x00,0x3c,0x00,0x00,0x78,
0x00,0x00,0xf0,0x00,0x01,0xe0,0x00,0x03,0x80,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,0x18,0x00,0x0f,0x18,0xf0,0x07,0xdb,
0xe0,0x00,0x7f,0x00,0x00,0xff,0x00,0x07,0xdb,0xe0,0x0e,0x18,0x70,0x00,0x18,0x00,
0x00,0x1c,0x00,0x00,0x1c,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,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,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,
0x00,0x3c,0x00,0x3f,0xff,0xfc,0x3f,0xff,0xfc,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7c,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x3e,0x00,0x00,0x1e,0x00,0x00,0x3c,
0x00,0x00,0xf8,0x00,0x07,0xe0,0x00,0x04,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,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xff,0xe0,0x03,0xff,0xe0,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,
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,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,
0x7c,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x7e,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,0x00,0x00,0x00,0x78,0x00,0x00,0xf0,0x00,0x00,0xe0,0x00,0x01,0xe0,0x00,0x03,
0xc0,0x00,0x03,0x80,0x00,0x07,0x80,0x00,0x0f,0x00,0x00,0x0e,0x00,0x00,0x1e,0x00,
0x00,0x3c,0x00,0x00,0x38,0x00,0x00,0x70,0x00,0x00,0xf0,0x00,0x00,0xe0,0x00,0x01,
0xc0,0x00,0x03,0xc0,0x00,0x07,0x80,0x00,0x07,0x00,0x00,0x0f,0x00,0x00,0x1e,0x00,
0x00,0x1c,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,0x01,0xff,0xc0,0x07,0xff,0xe0,0x0f,0x00,
0xf0,0x1e,0x00,0x78,0x1e,0x00,0x3c,0x3c,0x00,0xfc,0x3c,0x07,0xfc,0x3c,0x1f,0xbc,
0x3c,0x7c,0x1c,0x3d,0xf0,0x3c,0x3f,0xc0,0x3c,0x3f,0x00,0x3c,0x1e,0x00,0x38,0x1e,
0x00,0x78,0x0f,0x80,0xf0,0x07,0xff,0xe0,0x01,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x03,0xfe,0x00,0x1f,0xde,
0x00,0x0e,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,
0x1e,0x00,0x00,0x1e,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0x80,0x0f,0xff,0xe0,0x0e,0x01,
0xf0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x01,0xe0,
0x00,0x03,0xc0,0x00,0x0f,0x80,0x00,0x3e,0x00,0x00,0x7c,0x00,0x01,0xf0,0x00,0x03,
0xc0,0x00,0x0f,0x80,0x00,0x1f,0xff,0xfc,0x1f,0xff,0xfc,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,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0x80,0x0f,0xff,0xe0,0x00,0x01,
0xe0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x01,0xe0,0x00,0x03,0xc0,0x01,0xff,0x00,
0x01,0xff,0xc0,0x00,0x03,0xf0,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,
0x00,0x78,0x00,0x01,0xf0,0x0f,0xff,0xc0,0x0f,0xff,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xc0,0x00,0x1f,0xc0,0x00,0x3f,
0xc0,0x00,0x7b,0xc0,0x00,0xf3,0xc0,0x01,0xe3,0xc0,0x03,0xc3,0xc0,0x07,0x83,0xc0,
0x0f,0x03,0xc0,0x1c,0x03,0xc0,0x38,0x03,0xc0,0x7f,0xff,0xfe,0x7f,0xff,0xfe,0x00,
0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xe0,0x0f,0xff,0xe0,0x0f,0x00,
0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0xff,0x80,
0x0f,0xff,0xe0,0x00,0x00,0xf0,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,
0x00,0xf0,0x00,0x03,0xe0,0x0f,0xff,0xc0,0x0f,0xfe,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x01,0xff,0xf0,0x03,0xe0,
0x00,0x07,0x80,0x00,0x0f,0x00,0x00,0x1e,0x00,0x00,0x1e,0x1f,0x00,0x1f,0xff,0xe0,
0x1f,0xc1,0xf8,0x1e,0x00,0x78,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x0f,
0x00,0x78,0x0f,0x80,0xf8,0x07,0xff,0xe0,0x01,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x1f,0xff,0xfc,0x00,0x00,
0x78,0x00,0x00,0xf0,0x00,0x00,0xe0,0x00,0x01,0xe0,0x00,0x03,0xc0,0x00,0x07,0x80,
0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x1e,0x00,0x00,0x3c,0x00,0x00,0x78,0x00,0x00,
0xf0,0x00,0x01,0xf0,0x00,0x01,0xe0,0x00,0x03,0xc0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xe0,0x0f,0xe3,0xf0,0x0f,0x00,
0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x0f,0x00,0xf0,0x07,0xe3,0xe0,0x01,0xff,0x80,
0x01,0xff,0x80,0x07,0xe7,0xe0,0x0f,0x00,0xf8,0x1e,0x00,0x78,0x1e,0x00,0x3c,0x1e,
0x00,0x7c,0x1f,0x00,0xf8,0x0f,0xff,0xf0,0x03,0xff,0xc0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0x80,0x0f,0xc7,0xe0,0x1e,0x00,
0xf0,0x1e,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x38,0x1e,0x00,0x78,
0x0f,0xef,0xf8,0x07,0xff,0xb8,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0xf0,0x00,
0x01,0xe0,0x00,0x0f,0xc0,0x0f,0xff,0x00,0x0f,0xf0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3c,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x3e,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x18,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3e,0x00,0x00,0x7e,0x00,0x00,0x7f,0x00,0x00,0x1f,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0xfc,0x00,0x07,0xf0,0x00,0x04,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,0x00,
0x40,0x00,0x01,0xe0,0x00,0x07,0xc0,0x00,0x1f,0x00,0x00,0x7e,0x00,0x01,0xf8,0x00,
0x03,0xe0,0x00,0x0f,0x80,0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00,0xf8,0x00,0x00,
0x3e,0x00,0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00,0xe0,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,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,0x1f,0xff,0xf8,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xf8,0x1f,0xff,0xf8,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,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,0x07,0x80,0x00,0x03,0xe0,0x00,0x00,0xf8,0x00,0x00,0x3e,0x00,0x00,0x0f,0x80,
0x00,0x03,0xe0,0x00,0x00,0xf8,0x00,0x01,0xf0,0x00,0x07,0xc0,0x00,0x1f,0x00,0x00,
0x7c,0x00,0x01,0xf0,0x00,0x07,0xc0,0x00,0x03,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,
0x00,0x00,0x01,0xc0,0x00,0x01,0xfe,0x00,0x00,0x7f,0x80,0x00,0x07,0xc0,0x00,0x01,
0xe0,0x00,0x00,0xf0,0x00,0x00,0xf0,0x00,0x01,0xf0,0x00,0x03,0xe0,0x00,0x7f,0xc0,
0x00,0x7e,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xf8,0x00,0x00,0xf8,0x00,0x00,0xf8,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,0x00,0x00,0x1f,0x80,0x00,0xff,0xf0,0x03,0xc0,0x78,0x07,0x80,0x1c,0x0e,0x00,
0x0e,0x1c,0x00,0x0e,0x3c,0x00,0x0f,0x38,0x3f,0xc7,0x78,0xff,0xc7,0x70,0xe3,0xc7,
0x71,0xc3,0xc7,0xf3,0xc3,0x87,0xe3,0xc3,0x87,0xe3,0x87,0x8e,0xe3,0x87,0x8e,0xe3,
0xcf,0x8e,0xe3,0xff,0xfc,0x71,0xf9,0xf0,0x70,0x00,0x00,0x70,0x00,0x00,0x38,0x00,
0x00,0x3c,0x00,0x00,0x0f,0x01,0xc0,0x07,0xff,0xc0,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,0x7e,0x00,0x00,0x7f,0x00,0x00,0xff,
0x00,0x00,0xe7,0x80,0x01,0xe7,0x80,0x03,0xc3,0xc0,0x03,0xc3,0xc0,0x07,0x81,0xe0,
0x07,0x81,0xe0,0x0f,0x00,0xf0,0x0f,0x00,0xf8,0x1f,0xff,0xf8,0x1f,0xff,0xfc,0x3c,
0x00,0x3c,0x3c,0x00,0x1e,0x78,0x00,0x1e,0xf0,0x00,0x0f,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,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xc0,0x1f,0xff,0xf0,0x1e,0x00,
0xf0,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0xf0,0x1e,0x01,0xf0,0x1f,0xff,0xc0,
0x1f,0xff,0xe0,0x1e,0x01,0xf8,0x1e,0x00,0x78,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,
0x00,0x78,0x1e,0x00,0xf8,0x1f,0xff,0xe0,0x1f,0xff,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xf8,0x03,0xff,0xf8,0x07,0xc0,
0x00,0x0f,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3e,0x00,0x00,0x1e,0x00,0x00,0x0f,
0x00,0x00,0x0f,0xc0,0x08,0x03,0xff,0xf8,0x00,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0x00,0x3f,0xff,0xe0,0x3c,0x01,
0xf0,0x3c,0x00,0x78,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x1e,
0x3c,0x00,0x1e,0x3c,0x00,0x1e,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x78,0x3c,
0x00,0xf8,0x3c,0x07,0xe0,0x3f,0xff,0xc0,0x3f,0xfc,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xf0,0x0f,0xff,0xf0,0x0f,0x00,
0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0xff,0xf0,
0x0f,0xff,0xf0,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,
0x00,0x00,0x0f,0x00,0x00,0x0f,0xff,0xf0,0x0f,0xff,0xf0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xf0,0x0f,0xff,0xf0,0x0f,0x00,
0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0xff,0xf0,
0x0f,0xff,0xf0,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,
0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,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,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xfc,0x03,0xff,0xfc,0x0f,0xc0,
0x04,0x1f,0x00,0x00,0x1e,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x78,0x0f,0xfc,
0x78,0x0f,0xfc,0x78,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3e,0x00,0x3c,0x1f,
0x00,0x3c,0x0f,0xc0,0x3c,0x03,0xff,0xfc,0x00,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,
0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3f,0xff,0xfc,
0x3f,0xff,0xfc,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,
0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,
0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xe0,0x0f,0xff,0xe0,0x00,0x01,
0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,
0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,
0x03,0xc0,0x0c,0x07,0xc0,0x0f,0xff,0x80,0x07,0xfe,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x78,0x1e,0x01,0xf0,0x1e,0x03,
0xc0,0x1e,0x07,0x80,0x1e,0x1f,0x00,0x1e,0x3c,0x00,0x1e,0x78,0x00,0x1e,0xf0,0x00,
0x1f,0xf0,0x00,0x1e,0xf8,0x00,0x1e,0x3c,0x00,0x1e,0x1e,0x00,0x1e,0x0f,0x80,0x1e,
0x07,0xc0,0x1e,0x01,0xe0,0x1e,0x00,0xf8,0x1e,0x00,0x7c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,
0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,
0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,
0x80,0x00,0x07,0x80,0x00,0x07,0xff,0xf8,0x07,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x7c,0x3f,0x00,0xfc,0x3f,0x81,
0xdc,0x3b,0x81,0xdc,0x3b,0xc3,0x9c,0x39,0xc3,0x9c,0x38,0xe7,0x1c,0x38,0xef,0x1c,
0x38,0x7e,0x1c,0x38,0x7c,0x1e,0x38,0x3c,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,0x78,
0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,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,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x3c,0x1f,0x80,0x3c,0x1f,0xc0,
0x3c,0x1d,0xc0,0x3c,0x1d,0xe0,0x3c,0x1c,0xf0,0x3c,0x1c,0x78,0x3c,0x1c,0x78,0x3c,
0x1c,0x3c,0x3c,0x1c,0x1e,0x3c,0x1c,0x0f,0x3c,0x1c,0x0f,0x3c,0x1c,0x07,0xbc,0x1c,
0x03,0xfc,0x1c,0x01,0xfc,0x1c,0x00,0xfc,0x1c,0x00,0xfc,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,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xc0,0x07,0xff,0xf0,0x0f,0x00,
0xf8,0x1e,0x00,0x7c,0x3c,0x00,0x3c,0x3c,0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,
0x78,0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x1e,
0x00,0x78,0x1f,0x00,0xf0,0x07,0xff,0xe0,0x01,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x1f,0xff,0xf0,0x1e,0x00,
0xf8,0x1e,0x00,0x7c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x78,
0x1e,0x03,0xf0,0x1f,0xff,0xc0,0x1f,0xfe,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,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,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xc0,0x07,0xff,0xf0,0x0f,0x00,
0xf8,0x1e,0x00,0x7c,0x3c,0x00,0x3c,0x3c,0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,
0x78,0x00,0x1e,0x78,0x00,0x1e,0x78,0x00,0x1e,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x1e,
0x00,0x78,0x1f,0x80,0xf0,0x07,0xff,0xe0,0x01,0xff,0x80,0x00,0x3c,0x00,0x00,0x3c,
0x00,0x00,0x1f,0x06,0x00,0x0f,0xff,0x00,0x01,0xf8,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,0x0f,0xff,0x80,0x0f,0xff,0xe0,0x0e,0x01,
0xf0,0x0e,0x00,0xf0,0x0e,0x00,0xf0,0x0e,0x00,0xf0,0x0e,0x01,0xf0,0x0f,0xff,0xc0,
0x0f,0xff,0x00,0x0e,0x1f,0x00,0x0e,0x07,0x80,0x0e,0x03,0xc0,0x0e,0x01,0xe0,0x0e,
0x00,0xf0,0x0e,0x00,0xf8,0x0e,0x00,0x78,0x0e,0x00,0x3c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xf0,0x0f,0xff,0xf0,0x1f,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1f,0x00,0x00,0x0f,0xc0,0x00,0x07,0xfc,0x00,
0x00,0xff,0x80,0x00,0x0f,0xf0,0x00,0x01,0xf8,0x00,0x00,0x78,0x00,0x00,0x78,0x00,
0x00,0x78,0x20,0x00,0xf8,0x3f,0xff,0xe0,0x3f,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xfc,0x3f,0xff,0xfc,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,
0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,
0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,
0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x1e,
0x00,0x78,0x1f,0x00,0xf8,0x0f,0xff,0xe0,0x03,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x0f,0x78,0x00,0x1e,0x3c,0x00,
0x1e,0x3c,0x00,0x3c,0x1e,0x00,0x38,0x1e,0x00,0x78,0x0f,0x00,0x70,0x0f,0x00,0xf0,
0x07,0x81,0xe0,0x07,0x81,0xe0,0x03,0xc3,0xc0,0x03,0xe3,0xc0,0x01,0xe7,0x80,0x00,
0xf7,0x80,0x00,0xff,0x00,0x00,0x7e,0x00,0x00,0x7e,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x0e,0x78,0x00,0x0e,0x78,0x00,
0x0e,0x78,0x00,0x1e,0x38,0x00,0x1e,0x38,0x00,0x1e,0x38,0x3c,0x1c,0x38,0x3c,0x1c,
0x38,0x7e,0x1c,0x38,0x7f,0x1c,0x3c,0xe7,0x1c,0x3c,0xe7,0x9c,0x3d,0xc3,0x9c,0x1d,
0xc3,0xdc,0x1f,0x81,0xdc,0x1f,0x80,0xf8,0x1f,0x00,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x1e,0x00,0x78,0x0f,0x00,
0xf0,0x07,0x81,0xe0,0x03,0xc3,0xc0,0x01,0xe7,0x80,0x00,0xff,0x00,0x00,0x7e,0x00,
0x00,0x7e,0x00,0x00,0xff,0x00,0x01,0xff,0x80,0x03,0xe7,0xc0,0x07,0xc3,0xe0,0x0f,
0x81,0xf0,0x1f,0x00,0xf8,0x3e,0x00,0x7c,0x7c,0x00,0x3e,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,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x1f,0x3c,0x00,0x3e,0x1e,0x00,
0x7c,0x1f,0x00,0x78,0x0f,0x80,0xf0,0x07,0xc1,0xe0,0x03,0xe3,0xc0,0x01,0xe7,0x80,
0x00,0xff,0x00,0x00,0x7e,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x1f,0xff,0xfc,0x00,0x00,
0xf8,0x00,0x01,0xe0,0x00,0x03,0xc0,0x00,0x07,0x80,0x00,0x0f,0x00,0x00,0x1e,0x00,
0x00,0x3c,0x00,0x00,0x78,0x00,0x00,0xf0,0x00,0x03,0xe0,0x00,0x07,0xc0,0x00,0x0f,
0x80,0x00,0x1f,0x00,0x00,0x3f,0xff,0xfc,0x3f,0xff,0xfc,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,0x01,0xff,0xc0,0x01,0xff,0xc0,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,
0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,
0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,
0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,
0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0e,0x00,0x00,0x0f,0x00,0x00,0x07,0x00,0x00,0x03,0x80,0x00,0x03,0xc0,
0x00,0x01,0xe0,0x00,0x00,0xe0,0x00,0x00,0xf0,0x00,0x00,0x78,0x00,0x00,0x38,0x00,
0x00,0x3c,0x00,0x00,0x1e,0x00,0x00,0x0e,0x00,0x00,0x0f,0x00,0x00,0x07,0x80,0x00,
0x03,0x80,0x00,0x01,0xc0,0x00,0x01,0xe0,0x00,0x00,0xe0,0x00,0x00,0x70,0x00,0x00,
0x78,0x00,0x00,0x3c,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,0x03,0xff,0x80,0x03,0xff,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,
0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,
0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,
0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x00,0x07,
0x80,0x00,0x07,0x80,0x00,0x07,0x80,0x03,0xff,0x80,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,0x00,0x7e,0x00,0x00,0xe7,
0x00,0x01,0xc3,0x80,0x03,0x81,0xc0,0x07,0x00,0xe0,0x0e,0x00,0xf0,0x1e,0x00,0x78,
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,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,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0f,0x80,0x00,0x03,0xe0,0x00,0x00,0xf8,0x00,0x00,0x3c,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,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,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,0x07,0xff,0xc0,0x07,0xe7,0xf0,0x00,0x00,0xf0,0x00,0x00,0x78,
0x00,0x00,0x78,0x00,0xff,0xf8,0x07,0xff,0xf8,0x0f,0x00,0x78,0x1e,0x00,0x78,0x1e,
0x00,0x78,0x1e,0x03,0xf8,0x0f,0xff,0xf8,0x07,0xfc,0x78,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,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x7f,0xe0,0x1e,0xff,0xf0,0x1f,0xc0,0x78,0x1f,0x00,0x78,
0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x38,0x1e,
0x00,0x78,0x1e,0x00,0xf0,0x1f,0xff,0xe0,0x07,0xff,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xff,0xf0,0x03,0xff,0xf0,0x07,0xc0,0x00,0x0f,0x80,0x00,
0x0f,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x0f,0x00,0x00,0x0f,
0x80,0x00,0x07,0xc0,0x00,0x03,0xff,0xf0,0x00,0xff,0xf0,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,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,
0x78,0x00,0x00,0x78,0x01,0xff,0xf8,0x07,0xff,0xf8,0x0f,0x00,0x78,0x1e,0x00,0x78,
0x1e,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x78,0x1c,0x00,0x78,0x1e,
0x01,0xf8,0x1f,0x03,0xf8,0x0f,0xff,0x78,0x03,0xfc,0x78,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xff,0xc0,0x07,0xe3,0xf0,0x0f,0x00,0xf8,0x1e,0x00,0x78,
0x1e,0x00,0x3c,0x1f,0xff,0xfc,0x1f,0xff,0xfc,0x1c,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0x0f,0x80,0x00,0x07,0xff,0xf8,0x01,0xff,0xf8,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,0x00,0x03,0xfc,0x00,0x1f,0xfe,0x00,0x3e,0x00,0x00,0x78,0x00,0x00,0x78,
0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x3f,0xff,0xfc,0x3f,0xff,0xfc,
0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,
0x70,0x00,0x00,0x70,0x00,0x00,0x70,0x00,0x00,0x70,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xff,0xfc,0x07,0xc3,0xfc,0x0f,0x00,0xf0,0x1e,0x00,0xf0,
0x1e,0x00,0xf0,0x0f,0x00,0xf0,0x0f,0x83,0xe0,0x0f,0xff,0xc0,0x1e,0x7c,0x00,0x1c,
0x00,0x00,0x1f,0x00,0x00,0x0f,0xff,0xf0,0x0f,0xff,0xfc,0x1e,0x00,0x3c,0x3c,0x00,
0x3c,0x3c,0x00,0x3c,0x1f,0x81,0xf8,0x0f,0xff,0xe0,0x00,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x7f,0xe0,0x1e,0xff,0xf0,0x1f,0xc0,0xf0,0x1f,0x00,0x78,
0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,
0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,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,0x00,0x3c,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x3c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0f,0xfe,0x00,0x0f,0xfe,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,
0x1e,0x00,0x00,0x1e,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,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,0x00,0x03,0x80,0x00,0x07,0xe0,0x00,0x07,0xe0,0x00,0x03,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x0f,0xff,0xc0,0x0f,0xff,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,
0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,
0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,0xc0,0x00,0x03,
0xc0,0x00,0x07,0x80,0x1e,0x3f,0x00,0x1f,0xfe,0x00,0x01,0xc0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,
0x00,0x0f,0x00,0x00,0x0f,0x00,0xf8,0x0f,0x01,0xe0,0x0f,0x07,0xc0,0x0f,0x1f,0x00,
0x0f,0x3c,0x00,0x0f,0xf8,0x00,0x0f,0xf8,0x00,0x0f,0x3e,0x00,0x0f,0x1f,0x00,0x0f,
0x07,0xc0,0x0f,0x03,0xe0,0x0f,0x00,0xf8,0x0f,0x00,0x7c,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,0x0f,0xfe,0x00,0x0f,0xfe,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,
0x1e,0x00,0x00,0x1e,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x39,0xf9,0xf8,0x3b,0xbb,0xbc,0x3e,0x3e,0x1c,0x3c,0x3e,0x1c,
0x38,0x3c,0x1c,0x38,0x3c,0x1c,0x38,0x3c,0x1c,0x38,0x3c,0x1c,0x38,0x3c,0x1c,0x38,
0x3c,0x1c,0x38,0x3c,0x1c,0x38,0x3c,0x1c,0x38,0x3c,0x1c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x7f,0xe0,0x1e,0xff,0xf0,0x1f,0xc0,0xf0,0x1f,0x00,0x78,
0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,
0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xff,0xc0,0x07,0xe7,0xf0,0x0f,0x00,0xf8,0x1e,0x00,0x3c,
0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x3c,0x00,0x3c,0x1e,
0x00,0x78,0x1f,0x00,0xf0,0x07,0xff,0xe0,0x01,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x7f,0xe0,0x1e,0xff,0xf0,0x1f,0xc0,0x78,0x1f,0x00,0x78,
0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x38,0x1e,
0x00,0x78,0x1e,0x00,0xf0,0x1f,0xff,0xe0,0x1f,0xff,0x00,0x1e,0x00,0x00,0x1e,0x00,
0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,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,0x00,
0x00,0x00,0x00,0x00,0x01,0xff,0xf8,0x07,0xf7,0xf8,0x0f,0x00,0x78,0x1e,0x00,0x78,
0x1e,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x78,0x3c,0x00,0x78,0x1c,0x00,0x78,0x1e,
0x01,0xf8,0x1f,0x03,0xf8,0x0f,0xff,0x78,0x03,0xfc,0x78,0x00,0x00,0x78,0x00,0x00,
0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,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,0x00,0x00,0x00,0x0f,0x1f,0xf0,0x0f,0x7f,0xf8,0x0f,0xe0,0x3c,0x0f,0x80,0x3c,
0x0f,0x00,0x3c,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,
0x00,0x00,0x0f,0x00,0x00,0x0f,0x00,0x00,0x0f,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,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xff,0xe0,0x07,0xe1,0xe0,0x0f,0x00,0x00,0x0f,0x00,0x00,
0x07,0x80,0x00,0x03,0xfc,0x00,0x00,0xff,0xc0,0x00,0x0f,0xf0,0x00,0x00,0xf0,0x00,
0x00,0x78,0x00,0x00,0xf0,0x0f,0xff,0xe0,0x0f,0xff,0x80,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,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,
0x00,0x01,0xe0,0x00,0x7f,0xff,0xf8,0x7f,0xff,0xf8,0x01,0xe0,0x00,0x01,0xe0,0x00,
0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,0xe0,0x00,0x01,
0xe0,0x00,0x00,0xf0,0x00,0x00,0x7f,0xf8,0x00,0x3f,0xf8,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,
0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x1e,0x00,0x78,0x0e,
0x00,0xf8,0x0f,0x03,0xf8,0x07,0xff,0x78,0x03,0xfc,0x78,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x1e,0x00,0x7c,0x1e,0x00,0x78,0x0f,0x00,0xf0,
0x0f,0x80,0xf0,0x07,0x81,0xe0,0x03,0xc3,0xc0,0x03,0xc3,0xc0,0x01,0xe7,0x80,0x00,
0xe7,0x00,0x00,0xff,0x00,0x00,0x7e,0x00,0x00,0x3c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x78,0x00,0x0e,0x78,0x00,0x1e,0x78,0x00,0x1e,0x38,0x3c,0x1e,
0x38,0x3c,0x1c,0x3c,0x7e,0x1c,0x3c,0x7e,0x3c,0x1c,0xe7,0x3c,0x1c,0xe7,0xb8,0x1d,
0xc3,0xb8,0x1f,0xc3,0xf8,0x0f,0x81,0xf8,0x0f,0x81,0xf0,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1f,0x00,0x7c,0x0f,0x80,0xf0,0x07,0xc1,0xe0,0x03,0xe3,0xc0,
0x00,0xf7,0x80,0x00,0x7f,0x00,0x00,0x3e,0x00,0x00,0xff,0x00,0x01,0xe7,0x80,0x03,
0xc3,0xc0,0x07,0x81,0xf0,0x1f,0x00,0xf8,0x3e,0x00,0x7c,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x1e,0x00,0x3c,0x1e,0x00,0x78,0x0f,0x00,0xf0,
0x07,0x80,0xf0,0x07,0x81,0xe0,0x03,0xc1,0xc0,0x03,0xc3,0xc0,0x01,0xe7,0x80,0x00,
0xf7,0x80,0x00,0xff,0x00,0x00,0x7e,0x00,0x00,0x3e,0x00,0x00,0x3c,0x00,0x00,0x78,
0x00,0x01,0xf0,0x00,0x7f,0xe0,0x00,0x7f,0x80,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,
0x00,0x00,0x00,0x00,0x0f,0xff,0xf0,0x0f,0xff,0xf0,0x00,0x01,0xe0,0x00,0x07,0xc0,
0x00,0x0f,0x80,0x00,0x1e,0x00,0x00,0x3c,0x00,0x00,0xf8,0x00,0x01,0xe0,0x00,0x03,
0xc0,0x00,0x07,0x80,0x00,0x0f,0xff,0xf8,0x0f,0xff,0xf8,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,0x00,0x07,0xe0,0x00,0x1f,0xe0,0x00,0x3c,0x00,0x00,0x38,0x00,0x00,0x38,
0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,
0x1f,0xf0,0x00,0x1f,0x80,0x00,0x01,0xf0,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,
0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x78,0x00,0x00,0x38,
0x00,0x00,0x3c,0x00,0x00,0x1f,0x80,0x00,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,
0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,
0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,
0x00,0x00,0x3c,0x00,0x00,0x3c,0x00,0x00,0x3c,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,0x07,0xe0,0x00,0x07,0xf8,0x00,0x00,0x3c,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x0e,0x00,
0x00,0x0f,0xf8,0x00,0x01,0xf8,0x00,0x0f,0x80,0x00,0x0e,0x00,0x00,0x1e,0x00,0x00,
0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,0x00,0x00,0x1e,
0x00,0x00,0x3c,0x00,0x00,0xfc,0x00,0x07,0xf0,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,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xc0,0x00,
0x1f,0xf0,0x1e,0x3c,0x7c,0x1e,0x38,0x1f,0xfc,0x78,0x07,0xf8,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,
};
sFONT Font8x16 = {
ASCII8x16_Table,
8, /* Width */
16, /* Height */
};
sFONT Font16x24 = {
ASCII16x24_Table,
16, /* Width */
24, /* Height */
};
sFONT Font24x32 = {
ASCII24x32_Table,
24, /* Width */
32, /* Height */
};
//选择使用FLASH字模还是SD卡的字模
#if GBKCODE_FLASH
//选择 1:GB2312字模
//选择 0:HZLIB字模(旧版,不建议使用)
#if 1
/*使用FLASH字模*/
//字模GB2312_H1616配套的函数
//中文字库存储在FLASH的起始地址 :
//GBKCODE_START_ADDRESS 在fonts.h文件定义
/**
* @brief 获取FLASH中文显示字库数据
* @param pBuffer:存储字库矩阵的缓冲区
* @param c : 要获取的文字
* @retval None.
*/
int GetGBKCode_from_EXFlash( uint8_t * pBuffer, uint16_t c)
{
unsigned char High8bit,Low8bit;
unsigned int pos;
static uint8_t everRead=0;
/*第一次使用,初始化FLASH*/
if(everRead == 0)
{
SPI_FLASH_Init();
everRead = 1;
}
High8bit= c >> 8; /* 取高8位数据 */
Low8bit= c & 0x00FF; /* 取低8位数据 */
/*GB2312 公式*/
pos = ((High8bit-0xa1)*94+Low8bit-0xa1)*WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8;
SPI_Read_Data(pBuffer,GBKCODE_START_ADDRESS+pos,WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8); //读取字库数据
// printf ( "%02x %02x %02x %02x\n", pBuffer[0],pBuffer[1],pBuffer[2],pBuffer[3]);
return 0;
}
#else //旧版字模HZLIB 配套的函数
//!!HZLIB不支持标点,本函数仅为兼容而保留,不建议使用
/*HZLIB中文字库存储在FLASH的起始地址*/
#define HZLIB_START_ADDRESS 1*4096
//旧版HZLIB字库使用的函数,HZLIB不支持标点
//本函数使用的寻址公式跟GB2312的也稍有区别
int GetGBKCode_from_EXFlash( uint8_t * pBuffer, uint16_t c)
{
unsigned char High8bit,Low8b