2021-10-20 TM32F103 触摸XPT2046 LCD 画板程序

***LCD模式触摸控件的制作 **
本文展示了STM32 XPT2046 触摸 LCD 显示 中按钮控件的制作以及触摸 动作的实现 :

内容涉及 :
内容涉及对LCD触摸画板的控制
SRAM 内存扩展管理
FatFs 文件系统移植
SPI函数移植过程
SPI字节数据模拟输出独写 缓存读写
USART串口的识别
IO口输入输出
按键的外部中断处理
32位数据通讯,字符串通讯,单字符通讯

完整代码 : GIT源代码代码

[视频链接]

Stm320f1触摸显示屏幕

stm32f103 触摸显示屏 画板 小程序


前言

触摸检测的主体是型号为 XPT2046 的芯片,它接收触摸屏的 X+/X-/Y+/Y-信号进行处理,把触摸信息使用 SPI接口输出到 STM32等控制器,注意,由于控制 XPT2046 芯片的并不是 STM32 专用的硬件 SPI 接口,所以在编写程序时,需要使用软件模拟 SPI 时序与触摸芯片进行通讯。

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

触摸屏硬件相关宏定义.以上代码 根 据 硬 件 的 连 接 , 把 STM32 与 触 摸 屏 通 讯 使 用 的 引 脚 号 和 控 制 CS/CLK/MOSI 引脚输出高低电平的操作、读取 MISO 引脚电平状态的操作都使用宏封装了 起来,以便后面制作模拟 SPI 时序的驱动。另外,本驱动中 XPT2046 的 PENIRQ 触摸信号 并没有使用中断检测,而是使用普通的引脚电平轮询获取状态的。 初始化触摸屏控制引脚由于使用软件模拟 SPI协议的方式, 所以它把 MISO 设置为输入,其余的 MOSI、CLK、CS 引脚均配置为普通的推挽输出模式, 而 PENIRQ 作为触摸信号的输入检测,它也被设置成输入模式。 模拟 SPI 协议的读写时序,SPI协议的读写时序都比较简单,只要驱动好一个时钟信号传输一个数据位即可,发送 数据时使用 MOSI 引脚输出电平,读取数据时从 MISO 引脚获取状态。 代码中的 XPT2046_WriteCMD 函数主要在后面用于发送控制触摸芯片的命令代码,发 送不同的命令可以控制触摸芯片检测 X 坐标或 Y 坐标的触摸信号,该命令代码一般为 8 个 数据位;而 XPT2046_ReadCMD 函数主要在后面用于读取触摸芯片输出的 ADC电压值,这 些 ADC 电压值一般为 12 个数据位 采集触摸原始数据根据触摸芯片的要求,发送命令代码 XPT2046_CHANNEL_X(0x90)后,电阻屏的 X 方 向会通电,然后触摸屏使用 Y 通道检测得电压,获取到触摸点 X 方向的 ADC 原始值;发 送命令代码 XPT2046_CHANNEL_Y(0xd0)后,电阻屏的 Y 方向会通电,然后触摸屏使用 X 通道检测得电压,获取到触摸点 Y 方向的 ADC 原始值。把该过程封装起来,即可得到 XPT2046_ReadAdc 及 XPT2046_ReadAdc_XY 函 数 , 实 际 应 用 中 通 常 直 接 调 用 XPT2046_ReadAdc_XY 函数以检测两个方向的触摸数据 触摸校正对触摸校正函数 XPT2046_Touch_Calibrate 做了封装,加入了把转换系数 存储在外部 SPI FLASH 的功能,以便下次板子重新上电也能使用上一次的校正得到的系数。 在调用时,使用 LCD_Mode 参数选择要校正的液晶扫描模式,使用 forceCal 选择是否要强 制校正;该函数调用后会触发 XPT2046_Touch_Calibrate 的校正函数,在屏幕上显示几个触 点提示用户点击,若校正成功,则会把转换系数写入到外部的 SPI FLASH 空间中并加入记 录标志,下次再调用本函数的时候,若不是使用 forceCal 设置成强制校正是不会触发重新 校正的过程的

在这里插入图片描述

一、 编程要点

(1) 编写软件模拟 SPI 协议的驱动;
(2) 编写触摸芯片的控制驱动,如发送命令字,获取触摸坐标等;
(3) 编写触摸校正程序;
(4) 编写测试程序检验驱动。
(5) 编写控件编辑函数。

二、使用步骤

(注意)Keil 配置状态

我的博客这里有项目配置 设计;
点击链接
(https://blog.csdn.net/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);

#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文件读取测试 
      
      //*************LCD系统初始化************** 
      
      fn_XPT2046_Init(); 
      fn_Lcd_Page_Init();
      fn_Systick_Delay_Handler_set(10,_Systick_ms);
      while(1){
    
    
        fn_key_Check();
        XPT2046_TouchEvenHandler();
        if(bkey_change == 0){
    
    continue;}
        switch(Count_Modle_flag){
    
    
          case 0:
            fn_Lcd_Page1();
            break;
          case 1:
            fn_Lcd_Page2();
            break;
          case 2:
            fn_Lcd_Page3();
            //触摸检测函数,本函数至少10ms调用一次         
            break;
          default:
              break;
        }
        
        bkey_change = 0;
      }
}

//======================================================================
//======================================================================

  
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 delay(int x){
    
    
	int y = 0xFFFFF;
	while((x--)>0){
    
    
		while((y--)>0){
    
    
			__NOP();
			__NOP();
			__NOP();
			__NOP();
			__NOP();
		}
	}
}
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

建立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 "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_Page1();
}
//================================ 页面设计函数=======================================

/**
 * @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));
      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));
  
      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);
   
}

建立 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,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-0xa0-16)*94+Low8bit-0xa1)*WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8;
		//地址指向HZLIB字模的地址HZLIB_START_ADDRESS
		SPI_FLASH_BufferRead(pBuffer,HZLIB_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;  
     
}

#endif




#else //SD卡字模

/*使用SD字模*/

static FIL fnew;													/* file objects */
static FATFS fs;													/* Work area (file system object) for logical drives */
static FRESULT res_sd; 
static UINT br;            					/* File R/W count */

//字库文件存储位置,fonts.h中的宏:
//#define GBKCODE_FILE_NAME			"0:/Font/GB2312_H2424.FON"

/**
  * @brief  获取SD卡中文显示字库数据
	* @param  pBuffer:存储字库矩阵的缓冲区
	* @param  c : 要获取的文字
  * @retval None.
  */
int GetGBKCode_from_sd ( uint8_t * pBuffer, uint16_t c)
{
    
     
    unsigned char High8bit,Low8bit;
    unsigned int pos;
		
		static uint8_t everRead = 0;
	
    High8bit= c >> 8;     /* 取高8位数据 */
    Low8bit= c & 0x00FF;  /* 取低8位数据 */
		
    pos = ((High8bit-0xa1)*94+Low8bit-0xa1)*WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8;
	
		/*第一次使用,挂载文件系统,初始化sd*/
		if(everRead == 0)
		{
    
    
			res_sd = f_mount(&fs,"0:",1);
			everRead = 1;

		}
		
    res_sd = f_open(&fnew , GBKCODE_FILE_NAME, FA_OPEN_EXISTING | FA_READ);
    
    if ( res_sd == FR_OK ) 
    {
    
    
        f_lseek (&fnew, pos);		//指针偏移
			
				//16*16大小的汉字 其字模 占用16*16/8个字节
        res_sd = f_read( &fnew, pBuffer, WIDTH_CH_CHAR*HEIGHT_CH_CHAR/8, &br );		 
        
        f_close(&fnew);
        
        return 0;  
    }    
    else
        return -1;    
}

#endif
/*----------------------------end of file--------------------------*/




建立 SRAM 内存管理文件SRAM_book.h

代码如下 :

#ifndef  __SRAM_BOOK_H_
#define  __SRAM_BOOK_H_

#include "stm32f10x.h"

//定义基础地址 因为我们的芯片是1M字节的
#define SRAM_BASE_ADDR  (0x68000000)
#define SRAM_CHIP       (1) //1M 
#define SRAM_SIZE       (SRAM_CHIP*1024*1024) 
#define SRAM_END_ADDR   (SRAM_BASE_ADDR + SRAM_SIZE) 
  
/*A地址信号线*/    
#define FSMC_A0_GPIO_PORT        GPIOF
#define FSMC_A0_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A0_GPIO_PIN         GPIO_Pin_0

#define FSMC_A1_GPIO_PORT        GPIOF
#define FSMC_A1_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A1_GPIO_PIN         GPIO_Pin_1

#define FSMC_A2_GPIO_PORT        GPIOF
#define FSMC_A2_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A2_GPIO_PIN         GPIO_Pin_2

#define FSMC_A3_GPIO_PORT        GPIOF
#define FSMC_A3_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A3_GPIO_PIN         GPIO_Pin_3

#define FSMC_A4_GPIO_PORT        GPIOF
#define FSMC_A4_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A4_GPIO_PIN         GPIO_Pin_4

#define FSMC_A5_GPIO_PORT        GPIOF
#define FSMC_A5_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A5_GPIO_PIN         GPIO_Pin_5

#define FSMC_A6_GPIO_PORT        GPIOF
#define FSMC_A6_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A6_GPIO_PIN         GPIO_Pin_12

#define FSMC_A7_GPIO_PORT        GPIOF
#define FSMC_A7_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A7_GPIO_PIN         GPIO_Pin_13

#define FSMC_A8_GPIO_PORT        GPIOF
#define FSMC_A8_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A8_GPIO_PIN         GPIO_Pin_14

#define FSMC_A9_GPIO_PORT        GPIOF
#define FSMC_A9_GPIO_CLK         RCC_APB2Periph_GPIOF
#define FSMC_A9_GPIO_PIN         GPIO_Pin_15

#define FSMC_A10_GPIO_PORT        GPIOG
#define FSMC_A10_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A10_GPIO_PIN         GPIO_Pin_0

#define FSMC_A11_GPIO_PORT        GPIOG
#define FSMC_A11_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A11_GPIO_PIN         GPIO_Pin_1

#define FSMC_A12_GPIO_PORT        GPIOG
#define FSMC_A12_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A12_GPIO_PIN         GPIO_Pin_2

#define FSMC_A13_GPIO_PORT        GPIOG
#define FSMC_A13_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A13_GPIO_PIN         GPIO_Pin_3

#define FSMC_A14_GPIO_PORT        GPIOG
#define FSMC_A14_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A14_GPIO_PIN         GPIO_Pin_4

#define FSMC_A15_GPIO_PORT        GPIOG
#define FSMC_A15_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_A15_GPIO_PIN         GPIO_Pin_5

#define FSMC_A16_GPIO_PORT        GPIOD
#define FSMC_A16_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_A16_GPIO_PIN         GPIO_Pin_11

#define FSMC_A17_GPIO_PORT        GPIOD
#define FSMC_A17_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_A17_GPIO_PIN         GPIO_Pin_12

#define FSMC_A18_GPIO_PORT        GPIOD
#define FSMC_A18_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_A18_GPIO_PIN         GPIO_Pin_13

/*D 数据信号线*/
#define FSMC_D0_GPIO_PORT        GPIOD
#define FSMC_D0_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D0_GPIO_PIN         GPIO_Pin_14

#define FSMC_D1_GPIO_PORT        GPIOD
#define FSMC_D1_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D1_GPIO_PIN         GPIO_Pin_15

#define FSMC_D2_GPIO_PORT        GPIOD
#define FSMC_D2_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D2_GPIO_PIN         GPIO_Pin_0

#define FSMC_D3_GPIO_PORT        GPIOD
#define FSMC_D3_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D3_GPIO_PIN         GPIO_Pin_1

#define FSMC_D4_GPIO_PORT        GPIOE
#define FSMC_D4_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D4_GPIO_PIN         GPIO_Pin_7

#define FSMC_D5_GPIO_PORT        GPIOE
#define FSMC_D5_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D5_GPIO_PIN         GPIO_Pin_8

#define FSMC_D6_GPIO_PORT        GPIOE
#define FSMC_D6_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D6_GPIO_PIN         GPIO_Pin_9

#define FSMC_D7_GPIO_PORT        GPIOE
#define FSMC_D7_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D7_GPIO_PIN         GPIO_Pin_10

#define FSMC_D8_GPIO_PORT        GPIOE
#define FSMC_D8_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D8_GPIO_PIN         GPIO_Pin_11

#define FSMC_D9_GPIO_PORT        GPIOE
#define FSMC_D9_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D9_GPIO_PIN         GPIO_Pin_12

#define FSMC_D10_GPIO_PORT        GPIOE
#define FSMC_D10_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D10_GPIO_PIN         GPIO_Pin_13

#define FSMC_D11_GPIO_PORT        GPIOE
#define FSMC_D11_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D11_GPIO_PIN         GPIO_Pin_14

#define FSMC_D12_GPIO_PORT        GPIOE
#define FSMC_D12_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_D12_GPIO_PIN         GPIO_Pin_15

#define FSMC_D13_GPIO_PORT        GPIOD
#define FSMC_D13_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D13_GPIO_PIN         GPIO_Pin_8

#define FSMC_D14_GPIO_PORT        GPIOD
#define FSMC_D14_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D14_GPIO_PIN         GPIO_Pin_9

#define FSMC_D15_GPIO_PORT        GPIOD
#define FSMC_D15_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_D15_GPIO_PIN         GPIO_Pin_10


/*控制信号线*/  
/*CS片选*/
/*NE3 ,对应的基地址0x68000000*/
// 这里一定要注意 那个地址用哪个地址
#define FSMC_CS_GPIO_PORT        GPIOG
#define FSMC_CS_GPIO_CLK         RCC_APB2Periph_GPIOG
#define FSMC_CS_GPIO_PIN         GPIO_Pin_10

/*WE写使能*/
#define FSMC_WE_GPIO_PORT        GPIOD
#define FSMC_WE_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_WE_GPIO_PIN         GPIO_Pin_5

/*OE读使能*/
#define FSMC_OE_GPIO_PORT        GPIOD
#define FSMC_OE_GPIO_CLK         RCC_APB2Periph_GPIOD
#define FSMC_OE_GPIO_PIN         GPIO_Pin_4


/*UB数据掩码*/
#define FSMC_UDQM_GPIO_PORT        GPIOE
#define FSMC_UDQM_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_UDQM_GPIO_PIN         GPIO_Pin_1

/*LB数据掩码*/
#define FSMC_LDQM_GPIO_PORT        GPIOE
#define FSMC_LDQM_GPIO_CLK         RCC_APB2Periph_GPIOE
#define FSMC_LDQM_GPIO_PIN         GPIO_Pin_0


void SRAM_Init(void); 
uint8_t SRAM_Test(void);
void SRAM_Write(void);
#endif

建立 SRAM 内存管理文件SRAM_book.c

代码如下 :

#include "SRAM_book.h" 
#include "Systick_book.h"
#include "USART_book.h"

/**
  * @brief  初始化控制SRAM的IO
  * @param  无
  * @retval 无
  */
static void SRAM_GPIO_Config(void)
{
    
    
	GPIO_InitTypeDef  GPIO_InitStructure;
 
  /* 使能SRAM相关的GPIO时钟 */

                         /*地址信号线*/
  RCC_APB2PeriphClockCmd(FSMC_A0_GPIO_CLK | FSMC_A1_GPIO_CLK | FSMC_A2_GPIO_CLK | 
                         FSMC_A3_GPIO_CLK | FSMC_A4_GPIO_CLK | FSMC_A5_GPIO_CLK |
                         FSMC_A6_GPIO_CLK | FSMC_A7_GPIO_CLK | FSMC_A8_GPIO_CLK |
                         FSMC_A9_GPIO_CLK | FSMC_A10_GPIO_CLK| FSMC_A11_GPIO_CLK| 
												 FSMC_A12_GPIO_CLK| FSMC_A13_GPIO_CLK|FSMC_A14_GPIO_CLK|
												 FSMC_A15_GPIO_CLK|FSMC_A16_GPIO_CLK|FSMC_A17_GPIO_CLK|FSMC_A18_GPIO_CLK|
                         /*数据信号线*/
                         FSMC_D0_GPIO_CLK | FSMC_D1_GPIO_CLK | FSMC_D2_GPIO_CLK | 
                         FSMC_D3_GPIO_CLK | FSMC_D4_GPIO_CLK | FSMC_D5_GPIO_CLK |
                         FSMC_D6_GPIO_CLK | FSMC_D7_GPIO_CLK | FSMC_D8_GPIO_CLK |
                         FSMC_D9_GPIO_CLK | FSMC_D10_GPIO_CLK| FSMC_D11_GPIO_CLK|
                         FSMC_D12_GPIO_CLK| FSMC_D13_GPIO_CLK| FSMC_D14_GPIO_CLK|
                         FSMC_D15_GPIO_CLK|  
                         /*控制信号线*/
                         FSMC_CS_GPIO_CLK  | FSMC_WE_GPIO_CLK | FSMC_OE_GPIO_CLK |
                         FSMC_UDQM_GPIO_CLK|FSMC_LDQM_GPIO_CLK, ENABLE);
												 //UDQM UB引脚


	 /*-- GPIO 配置 -----------------------------------------------------*/

  /* 通用 GPIO 配置 */
  GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF_PP;       //配置为复用功能
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;      //都是复用推完功能因为这个是数据手册的规定
  
  /*A地址信号线 针对引脚配置*/
  GPIO_InitStructure.GPIO_Pin = FSMC_A0_GPIO_PIN; 
  GPIO_Init(FSMC_A0_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A1_GPIO_PIN; 
  GPIO_Init(FSMC_A1_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A2_GPIO_PIN; 
  GPIO_Init(FSMC_A2_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A3_GPIO_PIN; 
  GPIO_Init(FSMC_A3_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A4_GPIO_PIN; 
  GPIO_Init(FSMC_A4_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A5_GPIO_PIN; 
  GPIO_Init(FSMC_A5_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A6_GPIO_PIN; 
  GPIO_Init(FSMC_A6_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A7_GPIO_PIN; 
  GPIO_Init(FSMC_A7_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A8_GPIO_PIN; 
  GPIO_Init(FSMC_A8_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A9_GPIO_PIN; 
  GPIO_Init(FSMC_A9_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A10_GPIO_PIN; 
  GPIO_Init(FSMC_A10_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A11_GPIO_PIN; 
  GPIO_Init(FSMC_A11_GPIO_PORT, &GPIO_InitStructure);
	
	GPIO_InitStructure.GPIO_Pin = FSMC_A12_GPIO_PIN; 
  GPIO_Init(FSMC_A12_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A13_GPIO_PIN; 
  GPIO_Init(FSMC_A13_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A14_GPIO_PIN; 
  GPIO_Init(FSMC_A14_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A15_GPIO_PIN; 
  GPIO_Init(FSMC_A15_GPIO_PORT, &GPIO_InitStructure);	
	
	GPIO_InitStructure.GPIO_Pin = FSMC_A16_GPIO_PIN; 
  GPIO_Init(FSMC_A16_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A17_GPIO_PIN; 
  GPIO_Init(FSMC_A17_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_A18_GPIO_PIN; 
  GPIO_Init(FSMC_A18_GPIO_PORT, &GPIO_InitStructure);
    
  /*DQ数据信号线 针对引脚配置*/
  GPIO_InitStructure.GPIO_Pin = FSMC_D0_GPIO_PIN; 
  GPIO_Init(FSMC_D0_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D1_GPIO_PIN; 
  GPIO_Init(FSMC_D1_GPIO_PORT, &GPIO_InitStructure);
    
  GPIO_InitStructure.GPIO_Pin = FSMC_D2_GPIO_PIN; 
  GPIO_Init(FSMC_D2_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D3_GPIO_PIN; 
  GPIO_Init(FSMC_D3_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D4_GPIO_PIN; 
  GPIO_Init(FSMC_D4_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D5_GPIO_PIN; 
  GPIO_Init(FSMC_D5_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D6_GPIO_PIN; 
  GPIO_Init(FSMC_D6_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D7_GPIO_PIN; 
  GPIO_Init(FSMC_D7_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D8_GPIO_PIN; 
  GPIO_Init(FSMC_D8_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D9_GPIO_PIN; 
  GPIO_Init(FSMC_D9_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D10_GPIO_PIN; 
  GPIO_Init(FSMC_D10_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D11_GPIO_PIN; 
  GPIO_Init(FSMC_D11_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D12_GPIO_PIN; 
  GPIO_Init(FSMC_D12_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D13_GPIO_PIN; 
  GPIO_Init(FSMC_D13_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D14_GPIO_PIN; 
  GPIO_Init(FSMC_D14_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_D15_GPIO_PIN; 
  GPIO_Init(FSMC_D15_GPIO_PORT, &GPIO_InitStructure);
  
  /*控制信号线*/
  GPIO_InitStructure.GPIO_Pin = FSMC_CS_GPIO_PIN; 
  GPIO_Init(FSMC_CS_GPIO_PORT, &GPIO_InitStructure);
    
  GPIO_InitStructure.GPIO_Pin = FSMC_WE_GPIO_PIN; 
  GPIO_Init(FSMC_WE_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_OE_GPIO_PIN; 
  GPIO_Init(FSMC_OE_GPIO_PORT, &GPIO_InitStructure);    
  
  GPIO_InitStructure.GPIO_Pin = FSMC_UDQM_GPIO_PIN; 
  GPIO_Init(FSMC_UDQM_GPIO_PORT, &GPIO_InitStructure);
  
  GPIO_InitStructure.GPIO_Pin = FSMC_LDQM_GPIO_PIN; 
  GPIO_Init(FSMC_LDQM_GPIO_PORT, &GPIO_InitStructure);	
}				  			


//  写时钟周期 
  //ADDSET +1 + DATAST +1 > 55ns;
  //DATAST +1 >40ns
  //ADDSET +1 > 0  ns
  //  读的时钟
  //ADDSET +1 > 25ns
  //DATAST +1 > 0 ns
  /时钟单位 1.38*10-8S = 13.8ns
  
  //写时序
  //ADDSET
  //DATAST
  //
  //读时序
  //ADDSET = 0
  //DATAST = 2
  //
  //ADDSET +1 + DATAST +1 = (0+1+2+1)(13.8)=55.2> 55ns;
  //DATAST +1 >=2+1*(13.8 = 41.4)40ns
  //ADDSET +1  = 0+1*(13.8) = 13.8>0  ns
static void FSMC_ModleConfig(void){
    
    
  //对寄存器进行配置
  FSMC_NORSRAMTimingInitTypeDef readTimingInitStruct ;  //读时序
  FSMC_NORSRAMTimingInitTypeDef writeTimingInitStruct ; //写时序
  FSMC_NORSRAMInitTypeDef SRAMInitStruct;
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC,ENABLE);     //注意时钟使能
  
  //读
  readTimingInitStruct.FSMC_AccessMode = FSMC_AccessMode_A ;/*设置访问模式 */
  readTimingInitStruct.FSMC_AddressHoldTime = 0; //SRAM 没有用到
  readTimingInitStruct.FSMC_BusTurnAroundDuration = 0;//SRAM 没有用到
  readTimingInitStruct.FSMC_CLKDivision = 0;//SRAM 没有用到
  readTimingInitStruct.FSMC_DataLatency = 0;//SRAM 没有用到
  readTimingInitStruct.FSMC_AddressSetupTime = 0; //代表ADDSET单位13.8ns
  readTimingInitStruct.FSMC_DataSetupTime =2;//代表DATAST单位13.8ns 
  //写
  writeTimingInitStruct.FSMC_AccessMode = FSMC_AccessMode_A ;/*设置访问模式 */
  writeTimingInitStruct.FSMC_AddressHoldTime = 0; //SRAM 没有用到
  writeTimingInitStruct.FSMC_BusTurnAroundDuration = 0;//SRAM 没有用到
  writeTimingInitStruct.FSMC_CLKDivision = 0;//SRAM 没有用到
  writeTimingInitStruct.FSMC_DataLatency = 0;//SRAM 没有用到
  writeTimingInitStruct.FSMC_AddressSetupTime = 0; //代表ADDSET单位13.8ns
  writeTimingInitStruct.FSMC_DataSetupTime =2;//代表DATAST单位13.8ns 
  //到此读时序结构体完成
  
  SRAMInitStruct.FSMC_Bank = FSMC_Bank1_NORSRAM3;
  SRAMInitStruct.FSMC_ExtendedMode = FSMC_ExtendedMode_Enable; //读写时序
  SRAMInitStruct.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
  SRAMInitStruct.FSMC_MemoryType = FSMC_MemoryType_SRAM;
  //SRAM 没有用到
  SRAMInitStruct.FSMC_BurstAccessMode =  FSMC_BurstAccessMode_Disable ;
  SRAMInitStruct.FSMC_AsynchronousWait = FSMC_AsynchronousWait_Disable;
  SRAMInitStruct.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
  SRAMInitStruct.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
  SRAMInitStruct.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
  SRAMInitStruct.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
  SRAMInitStruct.FSMC_WrapMode = FSMC_WrapMode_Disable;
  SRAMInitStruct.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
  SRAMInitStruct.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
  //读写操作结构化评估
  SRAMInitStruct.FSMC_ReadWriteTimingStruct = &readTimingInitStruct;//读
  SRAMInitStruct.FSMC_WriteTimingStruct = &writeTimingInitStruct;//写 
  //写操作 注意FSMC_ExtendedMode 配置成 FSMC_ExtendedMode_Enable 时候有用
  
  // 吧配置写入寄存器
  FSMC_NORSRAMInit(&SRAMInitStruct);
  //使能FSMC
  FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM3,ENABLE);
  
}

/**
  * @brief  测试SRAM是否正常 
  * @param  None
  * @retval 正常返回1,异常返回0
  */
uint8_t SRAM_Test(void){
    
    
  /*写入数据计数器*/
  uint32_t counter=0;
  
  /* 8位的数据 */
  uint8_t ubWritedata_8b = 0, ubReaddata_8b = 0;  
  
  /* 16位的数据 */
  uint16_t uhWritedata_16b = 0, uhReaddata_16b = 0; 
  
  printf("正在检测SRAM,以8位、16位的方式读写sram...");


  /*按8位格式读写数据,并校验*/
  
  /* 把SRAM数据全部重置为0 ,IS62WV51216_SIZE是以8位为单位的 */
  for (counter = 0x00; counter < SRAM_SIZE; counter++)
  {
    
    
    *(__IO uint8_t*) (SRAM_BASE_ADDR + counter) = (uint8_t)0x0;
  }
  
  /* 向整个SRAM写入数据  8位 */
  for (counter = 0; counter < SRAM_SIZE; counter++)
  {
    
    
    *(__IO uint8_t*) (SRAM_BASE_ADDR + counter) = (uint8_t)(ubWritedata_8b + counter);
  }
  
  /* 读取 SRAM 数据并检测*/
  for(counter = 0; counter<SRAM_SIZE;counter++ )
  {
    
    
    ubReaddata_8b = *(__IO uint8_t*)(SRAM_BASE_ADDR + counter);  //从该地址读出数据
    
    if(ubReaddata_8b != (uint8_t)(ubWritedata_8b + counter))      //检测数据,若不相等,跳出函数,返回检测失败结果。
    {
    
    
      printf("8位数据读写错误!");
      return 0;
    }
  }
	 
  /*按16位格式读写数据,并检测*/
  
  /* 把SRAM数据全部重置为0 */
  for (counter = 0x00; counter < SRAM_SIZE/2; counter++)
  {
    
    
    *(__IO uint16_t*) (SRAM_BASE_ADDR + 2*counter) = (uint16_t)0x00;
  }
  
  /* 向整个SRAM写入数据  16位 */
  for (counter = 0; counter < SRAM_SIZE/2; counter++)
  {
    
    
    *(__IO uint16_t*) (SRAM_BASE_ADDR + 2*counter) = (uint16_t)(uhWritedata_16b + counter);
  }
  
    /* 读取 SRAM 数据并检测*/
  for(counter = 0; counter<SRAM_SIZE/2;counter++ )
  {
    
    
    uhReaddata_16b = *(__IO uint16_t*)(SRAM_BASE_ADDR + 2*counter);  //从该地址读出数据
    
    if(uhReaddata_16b != (uint16_t)(uhWritedata_16b + counter))      //检测数据,若不相等,跳出函数,返回检测失败结果。
    {
    
    
      printf("16位数据读写错误!\n");

      return 0;
    }
  }  
  printf("SRAM读写测试正常!\n"); 
  /*检测正常,return 1 */
  return 1;

}

/**
  * @brief  void SRAM_Init(void)
  * @param  初始化
  * @retval  
  */
void SRAM_Init(void){
    
    
  SRAM_GPIO_Config();
  FSMC_ModleConfig();
}


static uint8_t testSRAM_Value __attribute__ ((at (SRAM_BASE_ADDR)));

/**
  * @brief  void SRAM_Write(void) 
  * @param  None
  * @retval 
  */  
void SRAM_Write(void){
    
    
  uint8_t* SRAM_P ;
  uint16_t* SRAM_P16 ;
  float* SRAM_Pf ;
  //---------------------------------
  SRAM_P = (uint8_t*)SRAM_BASE_ADDR;
  *SRAM_P = 0xA2;
  printf("读出的数据为1: 0x%x\n",*SRAM_P); 
  //---------------------------------
  SRAM_P16 = (uint16_t*)SRAM_BASE_ADDR;
  *SRAM_P16 = 0x2AA2;
  printf("读出的数据为2: 0x%x\n",*SRAM_P16);
  //---------------------------------
  SRAM_Pf = (float*)SRAM_BASE_ADDR;
  *SRAM_Pf = 83.65;
  printf("读出的数据为3: 0x%.2f\n",*SRAM_Pf);
  //-----------利用常量来设计----------------------
  testSRAM_Value = 0x6A;
  printf("读出的数据为1: 0x%x\n",testSRAM_Value); 
}

整改 系统文件diskio.c

代码如下 :

/*-----------------------------------------------------------------------*/
/* Low level disk I/O module skeleton for FatFs     (C)ChaN, 2014        */
/*-----------------------------------------------------------------------*/
/* If a working storage control module is available, it should be        */
/* attached to the FatFs via a glue function rather than modifying it.   */
/* This is an example of glue functions to attach various exsisting      */
/* storage control modules to the FatFs module with a defined API.       */
/*-----------------------------------------------------------------------*/

#include "diskio.h"		/* FatFs lower layer API */
#include "ff.h"
#include "SPI_book.h"

//#include "usbdisk.h"	/* Example: Header file of existing USB MSD control module */
//#include "atadrive.h"	/* Example: Header file of existing ATA harddisk control module */
//#include "sdcard.h"		/* Example: Header file of existing MMC/SDC contorl module */

/* Definitions of physical drive number for each drive */
#define ATA		0	/* Example: Map ATA harddisk to physical drive 0 */
#define MMC		1	/* Example: Map MMC/SD card to physical drive 1 */
#define USB		2	/* Example: Map USB MSD to physical drive 2 */

#define SD_CARD   0
#define SPI_FLASH 1

/*-----------------------------------------------------------------------*/
/* Get Drive Status                                                      */
/*-----------------------------------------------------------------------*/

DSTATUS disk_status (
	BYTE pdrv		/* Physical drive nmuber to identify the drive */
)
{
    
    
	DSTATUS stat = STA_NOINIT;
//	int result;

	switch (pdrv) {
    
    
    case SD_CARD : break;
    
    case SPI_FLASH :
      if(SPI_Read_ID() == _SPI_FLASH_ID){
    
    
        stat = RES_OK;
      }else{
    
    
        stat = RES_ERROR;
      }
      break;
    default:
			stat = STA_NOINIT;  
	}
	return stat;
}

//disk_status 函数只有一个参数 pdrv,表示物理编号。一般我们都是使用 switch 函数实
//现对 pdrv 的分支判断。对于 SD 卡只是预留接口,留空即可。对于 SPI Flash 芯片,我们直
//接调用在 SPI_FLASH_ReadID()获取设备 ID,

/*-----------------------------------------------------------------------*/
/* Inidialize a Drive                                                    */
/*-----------------------------------------------------------------------*/

DSTATUS disk_initialize (
	BYTE pdrv				/* Physical drive nmuber to identify the drive */
)
{
    
    
	DSTATUS stat = STA_NOINIT;
//	int result;

	switch (pdrv) {
    
    
    case SD_CARD : break;
  
    case SPI_FLASH :
      SPI_FLASH_Init();
      SPI_Flash_WAKEUP();
      stat = disk_status(SPI_FLASH);
      break;
    default:
			stat = STA_NOINIT;  
	}
	return stat;
}

//disk_initialize 函数也是有一个参数 pdrv,用来指定设备物理编号。对于 SPI Flash 芯片
//我们调用 SPI_FLASH_Init()函数实现对 SPI Flash 芯片引脚 GPIO 初始化配置以及 SPI 通信
//参数配置。SPI_Flash_WAKEUP()函数唤醒 SPI Flash 芯片,当 SPI Flash 芯片处于睡眠模式
//时需要唤醒芯片才可以进行读写操作。

/*-----------------------------------------------------------------------*/
/* Read Sector(s)                                                        */
/*-----------------------------------------------------------------------*/

DRESULT disk_read (
	BYTE pdrv,		/* Physical drive nmuber to identify the drive */
	BYTE *buff,		/* Data buffer to store read data */
	DWORD sector,	/* Sector address in LBA */
	UINT count		/* Number of sectors to read */
)
{
    
    
	DRESULT res = RES_PARERR;
	//int result;

	switch (pdrv) {
    
    
    case SD_CARD : break;
  
    case SPI_FLASH :
      // 扇区偏移2MB  外部Flash 文件系统空间放在 SPI_FLAH后面的6MB空间
      sector += 512;
      SPI_Read_Data(buff,(sector << 12),(count << 12));
      res = RES_OK ; 
      break;
    default:
			res = RES_PARERR;  
	}

	return res;
}

//SPI Flash 芯片型号为 W25Q64FV,每个扇区大小为 4096 个字节(4KB),
//总共有 8M 字节空间,为兼容后面实验程序,我们只将后部分 6MB 空间分配给 FatFs 使用,
//前部分 2MB 空间用于其他实验需要,即 FatFs 是从 2MB 空间开始,为实现这个效果需要
//将所有的读写地址都偏移 512 个扇区空间

/*-----------------------------------------------------------------------*/
/* Write Sector(s)                                                       */
/*-----------------------------------------------------------------------*/

#if _USE_WRITE
DRESULT disk_write (
	BYTE pdrv,			/* Physical drive nmuber to identify the drive */
	const BYTE *buff,	/* Data to be written */
	DWORD sector,		/* Sector address in LBA */
	UINT count			/* Number of sectors to write */
)
{
    
    
	DRESULT res = RES_PARERR;
	//int result;
  if(!count){
    
    return res;}
	switch (pdrv) {
    
    
	  case SD_CARD : break;
  
    case SPI_FLASH :
      // 扇区偏移2MB  外部Flash 文件系统空间放在 SPI_FLAH后面的6MB空间
      sector += 512;
      SPI_Erase_Sector(sector << 12);
      SPI_BufferWrite_Data((uint8_t *)buff ,sector << 12,count << 12);
      res = RES_OK ; 
      break;
    default:
			res = RES_PARERR;  
	}

	return res;
}
#endif
//disk_write 函数有四个形参,pdrv 为设备物理编号。buff 指向待写入扇区数据的首地址。
//sector,指定要写入数据的扇区首地址。count 指定扇区数量。对于 SPI Flash 芯片,在写入
//数据之前需要先擦除,所以用到扇区擦除函数(SPI_FLASH_SectorErase)。然后就是在调用
//数据写入函数(SPI_FLASH_BufferWrite)把数据写入到指定位置内。

/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions                                               */
/*-----------------------------------------------------------------------*/

#if _USE_IOCTL
DRESULT disk_ioctl (
	BYTE pdrv,		/* Physical drive nmuber (0..) */
	BYTE cmd,		/* Control code */
	void *buff		/* Buffer to send/receive control data */
)
{
    
    
	DRESULT res = RES_PARERR;
//	int result;

	switch (pdrv) {
    
    
    case SD_CARD : break;
  
    case SPI_FLASH :{
    
    
       switch(cmd){
    
    
          //返回 扇区的个数 1280*4096/1024/1024 = 5MB
         case GET_SECTOR_COUNT:
           *(DWORD * )buff = 1280;
           break;
         //返回每一个扇区的大小
         case GET_SECTOR_SIZE:
           *(DWORD * )buff = 4096;
           break;
         case GET_BLOCK_SIZE:
           *(DWORD * )buff = 1;
           break;    
         default:
          return RES_PARERR; 
       }
       res = RES_OK;
       break;
    }
   default:
      res =  RES_PARERR;     
	}
	return res;
}
#endif

 DWORD get_fattime(void) {
    
    
	/* 返回当前时间戳 */
	return	  ((DWORD)(2015 - 1980) << 25)	/* Year 2015 */
			| ((DWORD)1 << 21)				/* Month 1 */
			| ((DWORD)1 << 16)				/* Mday 1 */
			| ((DWORD)0 << 11)				/* Hour 0 */
			| ((DWORD)0 << 5)				  /* Min 0 */
			| ((DWORD)0 >> 1);				/* Sec 0 */
}

修改头文件文件diskio.h

代码如下 :

/*---------------------------------------------------------------------------/
/  FatFs - FAT file system module configuration file  R0.11a (C)ChaN, 2015
/---------------------------------------------------------------------------*/

#define _FFCONF 64180	/* Revision ID */

/*---------------------------------------------------------------------------/
/ Function Configurations
/---------------------------------------------------------------------------*/

#define _FS_READONLY	0
/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
/  Read-only configuration removes writing API functions, f_write(), f_sync(),
/  f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
/  and optional writing functions as well. */


#define _FS_MINIMIZE	0
/* This option defines minimization level to remove some basic API functions.
/
/   0: All basic functions are enabled.
/   1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
/      f_truncate() and f_rename() function are removed.
/   2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
/   3: f_lseek() function is removed in addition to 2. */


#define	_USE_STRFUNC	1
/* This option switches string functions, f_gets(), f_putc(), f_puts() and
/  f_printf().
/
/  0: Disable string functions.
/  1: Enable without LF-CRLF conversion.
/  2: Enable with LF-CRLF conversion. */


#define _USE_FIND		0
/* This option switches filtered directory read feature and related functions,
/  f_findfirst() and f_findnext(). (0:Disable or 1:Enable) */


#define	_USE_MKFS		1 
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
//格式化功能选择,为使用 FatFs 格式化功能,需要把它设置为 1

#define	_USE_FASTSEEK	0
/* This option switches fast seek feature. (0:Disable or 1:Enable) */


#define _USE_LABEL		0
/* This option switches volume label functions, f_getlabel() and f_setlabel().
/  (0:Disable or 1:Enable) */


#define	_USE_FORWARD	0
/* This option switches f_forward() function. (0:Disable or 1:Enable)
/  To enable it, also _FS_TINY need to be set to 1. */


/*---------------------------------------------------------------------------/
/ Locale and Namespace Configurations
/---------------------------------------------------------------------------*/

#define _CODE_PAGE	936
//语言功能选择
/* This option specifies the OEM code page to be used on the target system.
/  Incorrect setting of the code page can cause a file open failure.
/
/   1   - ASCII (No extended character. Non-LFN cfg. only)
/   437 - U.S.
/   720 - Arabic
/   737 - Greek
/   771 - KBL
/   775 - Baltic
/   850 - Latin 1
/   852 - Latin 2
/   855 - Cyrillic
/   857 - Turkish
/   860 - Portuguese
/   861 - Icelandic
/   862 - Hebrew
/   863 - Canadian French
/   864 - Arabic
/   865 - Nordic
/   866 - Russian
/   869 - Greek 2
/   932 - Japanese (DBCS)
/   936 - Simplified Chinese (DBCS)
/   949 - Korean (DBCS)
/   950 - Traditional Chinese (DBCS)
*/


#define	_USE_LFN	2
//2: Enable LFN with dynamic working buffer on the STACK.
//长文件名支持
#define	_MAX_LFN	255
/* The _USE_LFN option switches the LFN feature.
/
/   0: Disable LFN feature. _MAX_LFN has no effect.
/   1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
/   2: Enable LFN with dynamic working buffer on the STACK.
/   3: Enable LFN with dynamic working buffer on the HEAP.
/
/  When enable the LFN feature, Unicode handling functions (option/unicode.c) must
/  be added to the project. The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes.
/  When use stack for the working buffer, take care on stack overflow. When use heap
/  memory for the working buffer, memory management functions, ff_memalloc() and
/  ff_memfree(), must be added to the project. */


#define	_LFN_UNICODE	0
/* This option switches character encoding on the API. (0:ANSI/OEM or 1:Unicode)
/  To use Unicode string for the path name, enable LFN feature and set _LFN_UNICODE
/  to 1. This option also affects behavior of string I/O functions. */


#define _STRF_ENCODE	3
/* When _LFN_UNICODE is 1, this option selects the character encoding on the file to
/  be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
/
/  0: ANSI/OEM
/  1: UTF-16LE
/  2: UTF-16BE
/  3: UTF-8
/
/  When _LFN_UNICODE is 0, this option has no effect. */


#define _FS_RPATH	0
/* This option configures relative path feature.
/
/   0: Disable relative path feature and remove related functions.
/   1: Enable relative path feature. f_chdir() and f_chdrive() are available.
/   2: f_getcwd() function is available in addition to 1.
/
/  Note that directory items read via f_readdir() are affected by this option. */


/*---------------------------------------------------------------------------/
/ Drive/Volume Configurations
/---------------------------------------------------------------------------*/

#define _VOLUMES	2
/* Number of volumes (logical drives) to be used. */
//包括预留 SD 卡和 SPI Flash 芯片

#define _STR_VOLUME_ID	0
#define _VOLUME_STRS	"RAM","NAND","CF","SD1","SD2

猜你喜欢

转载自blog.csdn.net/u012651389/article/details/120874176