STM32入门学习笔记之TFTLCD显示实验4

电子说

1.3w人已加入

描述

(2)创建lcd.c,并添加以下代码。

#include "lcd.h"
#include "font.h"
#include "delay.h"
void LCD_WriteReg( u16 LCD_Reg, u16 LCD_RegValue )
{  
  LCD->LCD_REG = LCD_Reg ;              //写入寄存器序号
  LCD->LCD_RAM = LCD_RegValue ;            //写入数据
}
_lcd_dev lcddev ;                      //管理LCD重要参数
void LCD_SetCursor( u16 Xpos, u16 Ypos )
{
  LCD_WriteReg( lcddev.setxcmd, Xpos>>8 ) ;
  LCD_WriteReg( lcddev.setxcmd+1, Xpos&0xFF ) ;
  LCD_WriteReg( lcddev.setycmd, Ypos>>8 ) ;
  LCD_WriteReg( lcddev.setycmd+1, Ypos&0xFF ) ;
}
void LCD_Display_Dir()
{
  u16 temp;
  lcddev.wramcmd = 0x2C00 ;
  lcddev.setxcmd = 0x2A00 ;
  lcddev.setycmd = 0x2B00 ;
  lcddev.width = 480 ;
  lcddev.height = 800 ;
  //交换X,Y
  if( lcddev.width>lcddev.height )
  {
    temp = lcddev.width ;
    lcddev.width = lcddev.height ;
    lcddev.height = temp ;
  }
  //设置扫描方向
  LCD_WriteReg( 0x3600, 0 ) ;
  LCD_WriteReg( lcddev.setxcmd, 0 ) ;
  LCD_WriteReg( lcddev.setxcmd+1, 0 ) ;
  LCD_WriteReg( lcddev.setxcmd+2, ( lcddev.width-1 )>>8 ) ;
  LCD_WriteReg( lcddev.setxcmd+3, ( lcddev.width-1 )&0xFF ) ;
  LCD_WriteReg( lcddev.setycmd, 0 ) ;
  LCD_WriteReg( lcddev.setycmd+1, 0 ) ;
  LCD_WriteReg( lcddev.setycmd+2, ( lcddev.height-1 )>>8 ) ;
  LCD_WriteReg( lcddev.setycmd+3, ( lcddev.height-1 )&0xFF ) ;
}
void LCD_Init()
{
  RCC->AHBENR |= 1<<8 ;                  //使能FSMC时钟
    RCC->APB2ENR |= 1<<3 ;                  //使能PORTB时钟
  RCC->APB2ENR |= 1<<5 ;                  //使能PORTD时钟
  RCC->APB2ENR |= 1<<6 ;                  //使能PORTE时钟
   RCC->APB2ENR |= 1<<8 ;                  //使能PORTG时钟
  GPIOB->CRL &= 0xFFFFFFF0 ;                //PB0 推挽输出
  GPIOB->CRL |= 0x00000003 ;
  //PORTD复用推挽输出
  GPIOD->CRH &= 0x00FFF000 ;
  GPIOD->CRH |= 0xBB000BBB ;
  GPIOD->CRL &= 0xFF00FF00 ;
  GPIOD->CRL |= 0x00BB00BB ;
  //PORTE复用推挽输出
  GPIOE->CRH &= 0x00000000 ;
  GPIOE->CRH |= 0xBBBBBBBB ;
  GPIOE->CRL &= 0x0FFFFFFF ;
  GPIOE->CRL |= 0xB0000000 ;
  //PORTG12复用推挽输出
  GPIOG->CRH &= 0xFFF0FFFF ;
  GPIOG->CRH |= 0x000B0000 ;
  GPIOG->CRL &= 0xFFFFFFF0 ;                //PG0->RS
  GPIOG->CRL |= 0x0000000B ;
  FSMC_Bank1->BTCR[ 6 ] = 0x00000000 ;
  FSMC_Bank1->BTCR[ 7 ] = 0x00000000 ;
  FSMC_Bank1E->BWTR[ 6 ] = 0x00000000 ;
  FSMC_Bank1->BTCR[ 6 ] |= 1<<12 ;              //存储器写使能
  FSMC_Bank1->BTCR[ 6 ] |= 1<<14 ;              //读写使用不同的时序
  FSMC_Bank1->BTCR[ 6 ] |= 1<<4 ;              //存储器数据宽度为16bit
  FSMC_Bank1->BTCR[ 7 ] |= 0<<28 ;              //模式A
  FSMC_Bank1->BTCR[ 7 ] |= 1<<0 ;              //地址建立时间为2个HCLK 1/36M=27ns
  FSMC_Bank1->BTCR[ 7 ] |= 0xF<<8 ;              //数据保存时间为16个HCLK
  FSMC_Bank1E->BWTR[ 6 ] |= 0<<28 ;            //模式A
  FSMC_Bank1E->BWTR[ 6 ] |= 0<<0 ;              //地址建立时间为1个HCLK
  FSMC_Bank1E->BWTR[ 6 ] |= 3<<8 ;              //数据保存时间为4个HCLK
  FSMC_Bank1->BTCR[ 6 ] |= 1<<0 ;              //使能BANK1区域4
  delay_ms( 50 ) ;                      //delay 50 ms
  LCD_WriteReg( 0xF000, 0x55 ) ;
  LCD_WriteReg( 0xF001, 0xAA ) ;
  LCD_WriteReg( 0xF002, 0x52 ) ;
  LCD_WriteReg( 0xF003, 0x08 ) ;
  LCD_WriteReg( 0xF004, 0x01 ) ;
  //AVDD Set AVDD 5.2V
  LCD_WriteReg( 0xB000, 0x0D ) ;
  LCD_WriteReg( 0xB001, 0x0D ) ;
  LCD_WriteReg( 0xB002, 0x0D ) ;
  //AVDD ratio
  LCD_WriteReg( 0xB600, 0x34 ) ;
  LCD_WriteReg( 0xB601, 0x34 ) ;
  LCD_WriteReg( 0xB602, 0x34 ) ;
  //AVEE -5.2V
  LCD_WriteReg( 0xB100, 0x0D ) ;
  LCD_WriteReg( 0xB101, 0x0D ) ;
  LCD_WriteReg( 0xB102, 0x0D ) ;
  //AVEE ratio
  LCD_WriteReg( 0xB700, 0x34 ) ;
  LCD_WriteReg( 0xB701, 0x34 ) ;
  LCD_WriteReg( 0xB702, 0x34 ) ;
  //VCL -2.5V
  LCD_WriteReg( 0xB200, 0x00 ) ;
  LCD_WriteReg( 0xB201, 0x00 ) ;
  LCD_WriteReg( 0xB202, 0x00 ) ;
  //VCL ratio
  LCD_WriteReg( 0xB800, 0x24 ) ;
  LCD_WriteReg( 0xB801, 0x24 ) ;
  LCD_WriteReg( 0xB802, 0x24 ) ;
  //VGH 15V
  LCD_WriteReg( 0xBF00, 0x01 ) ;
  LCD_WriteReg( 0xB300, 0x0F ) ;
  LCD_WriteReg( 0xB301, 0x0F ) ;
  LCD_WriteReg( 0xB302, 0x0F ) ;
  //VGH ratio
  LCD_WriteReg( 0xB900, 0x34 ) ;
  LCD_WriteReg( 0xB901, 0x34 ) ;
  LCD_WriteReg( 0xB902, 0x34 ) ;
  //VGL_REG -10V
  LCD_WriteReg( 0xB500, 0x08 ) ;
  LCD_WriteReg( 0xB501, 0x08 ) ;
  LCD_WriteReg( 0xB502, 0x08 ) ;
  LCD_WriteReg( 0xC200, 0x03 ) ;
  //VGLX ratio
  LCD_WriteReg( 0xBA00, 0x24 ) ;
  LCD_WriteReg( 0xBA01, 0x24 ) ;
  LCD_WriteReg( 0xBA02, 0x24 ) ;
  //VGMP/VGSP 4.5V/0V
  LCD_WriteReg( 0xBC00, 0x00 ) ;
  LCD_WriteReg( 0xBC01, 0x78 ) ;
  LCD_WriteReg( 0xBC02, 0x00 ) ;
  //VGMN/VGSN -4.5V/0V
  LCD_WriteReg( 0xBD00, 0x00 ) ;
  LCD_WriteReg( 0xBD01, 0x78 ) ;
  LCD_WriteReg( 0xBD02, 0x00 ) ;
  //VCOM
  LCD_WriteReg( 0xBE00, 0x00 ) ;
  LCD_WriteReg( 0xBE01, 0x64 ) ;
  //Gamma Setting
  LCD_WriteReg( 0xD100, 0x00 ) ;
  LCD_WriteReg( 0xD101, 0x33 ) ;
  LCD_WriteReg( 0xD102, 0x00 ) ;
  LCD_WriteReg( 0xD103, 0x34 ) ;
  LCD_WriteReg( 0xD104, 0x00 ) ;
  LCD_WriteReg( 0xD105, 0x3A ) ;
  LCD_WriteReg( 0xD106, 0x00 ) ;
  LCD_WriteReg( 0xD107, 0x4A ) ;
  LCD_WriteReg( 0xD108, 0x00 ) ;
  LCD_WriteReg( 0xD109, 0x5C ) ;
  LCD_WriteReg( 0xD10A, 0x00 ) ;
  LCD_WriteReg( 0xD10B, 0x81 ) ;
  LCD_WriteReg( 0xD10C, 0x00 ) ;
  LCD_WriteReg( 0xD10D, 0xA6 ) ;
  LCD_WriteReg( 0xD10E, 0x00 ) ;
  LCD_WriteReg( 0xD10F, 0xE5 ) ;
  LCD_WriteReg( 0xD110, 0x01 ) ;
  LCD_WriteReg( 0xD111, 0x13 ) ;
  LCD_WriteReg( 0xD112, 0x01 ) ;
  LCD_WriteReg( 0xD113, 0x54 ) ;
  LCD_WriteReg( 0xD114, 0x01 ) ;
  LCD_WriteReg( 0xD115, 0x82 ) ;
  LCD_WriteReg( 0xD116, 0x01 ) ;
  LCD_WriteReg( 0xD117, 0xCA ) ;
  LCD_WriteReg( 0xD118, 0x02 ) ;
  LCD_WriteReg( 0xD119, 0x00 ) ;
  LCD_WriteReg( 0xD11A, 0x02 ) ;
  LCD_WriteReg( 0xD11B, 0x01 ) ;
  LCD_WriteReg( 0xD11C, 0x02 ) ;
  LCD_WriteReg( 0xD11D, 0x34 ) ;
  LCD_WriteReg( 0xD11E, 0x02 ) ;
  LCD_WriteReg( 0xD11F, 0x67 ) ;
  LCD_WriteReg( 0xD120, 0x02 ) ;
  LCD_WriteReg( 0xD121, 0x84 ) ;
  LCD_WriteReg( 0xD122, 0x02 ) ;
  LCD_WriteReg( 0xD123, 0xA4 ) ;
  LCD_WriteReg( 0xD124, 0x02 ) ;
  LCD_WriteReg( 0xD125, 0xB7 ) ;
  LCD_WriteReg( 0xD126, 0x02 ) ;
  LCD_WriteReg( 0xD127, 0xCF ) ;
  LCD_WriteReg( 0xD128, 0x02 ) ;
  LCD_WriteReg( 0xD129, 0xDE ) ;
  LCD_WriteReg( 0xD12A, 0x02 ) ;
  LCD_WriteReg( 0xD12B, 0xF2 ) ;
  LCD_WriteReg( 0xD12C, 0x02 ) ;
  LCD_WriteReg( 0xD12D, 0xFE ) ;
  LCD_WriteReg( 0xD12E, 0x03 ) ;
  LCD_WriteReg( 0xD12F, 0x10 ) ;
  LCD_WriteReg( 0xD130, 0x03 ) ;
  LCD_WriteReg( 0xD131, 0x33 ) ;
  LCD_WriteReg( 0xD132, 0x03 ) ;
  LCD_WriteReg( 0xD133, 0x6D ) ;
  LCD_WriteReg( 0xD200, 0x00 ) ;
  LCD_WriteReg( 0xD201, 0x33 ) ;
  LCD_WriteReg( 0xD202, 0x00 ) ;
  LCD_WriteReg( 0xD203, 0x34 ) ;
  LCD_WriteReg( 0xD204, 0x00 ) ;
  LCD_WriteReg( 0xD205, 0x3A ) ;
  LCD_WriteReg( 0xD206, 0x00 ) ;
  LCD_WriteReg( 0xD207, 0x4A ) ;
  LCD_WriteReg( 0xD208, 0x00 ) ;
  LCD_WriteReg( 0xD209, 0x5C ) ;
  LCD_WriteReg( 0xD20A, 0x00 ) ;
  LCD_WriteReg( 0xD20B, 0x81 ) ;
  LCD_WriteReg( 0xD20C, 0x00 ) ;
  LCD_WriteReg( 0xD20D, 0xA6 ) ;
  LCD_WriteReg( 0xD20E, 0x00 ) ;
  LCD_WriteReg( 0xD20F, 0xE5 ) ;
  LCD_WriteReg( 0xD210, 0x01 ) ;
  LCD_WriteReg( 0xD211, 0x13 ) ;
  LCD_WriteReg( 0xD212, 0x01 ) ;
  LCD_WriteReg( 0xD213, 0x54 ) ;
  LCD_WriteReg( 0xD214, 0x01 ) ;
  LCD_WriteReg( 0xD215, 0x82 ) ;
  LCD_WriteReg( 0xD216, 0x01 ) ;
  LCD_WriteReg( 0xD217, 0xCA ) ;
  LCD_WriteReg( 0xD218, 0x02 ) ;
  LCD_WriteReg( 0xD219, 0x00 ) ;
  LCD_WriteReg( 0xD21A, 0x02 ) ;
  LCD_WriteReg( 0xD21B, 0x01 ) ;
  LCD_WriteReg( 0xD21C, 0x02 ) ;
  LCD_WriteReg( 0xD21D, 0x34 ) ;
  LCD_WriteReg( 0xD21E, 0x02 ) ;
  LCD_WriteReg( 0xD21F, 0x67 ) ;
  LCD_WriteReg( 0xD220, 0x02 ) ;
  LCD_WriteReg( 0xD221, 0x84 ) ;
  LCD_WriteReg( 0xD222, 0x02 ) ;
  LCD_WriteReg( 0xD223, 0xA4 ) ;
  LCD_WriteReg( 0xD224, 0x02 ) ;
  LCD_WriteReg( 0xD225, 0xB7 ) ;
  LCD_WriteReg( 0xD226, 0x02 ) ;
  LCD_WriteReg( 0xD227, 0xCF ) ;
  LCD_WriteReg( 0xD228, 0x02 ) ;
  LCD_WriteReg( 0xD229, 0xDE ) ;
  LCD_WriteReg( 0xD22A, 0x02 ) ;
  LCD_WriteReg( 0xD22B, 0xF2 ) ;
  LCD_WriteReg( 0xD22C, 0x02 ) ;
  LCD_WriteReg( 0xD22D, 0xFE ) ;
  LCD_WriteReg( 0xD22E, 0x03 ) ;
  LCD_WriteReg( 0xD22F, 0x10 ) ;
  LCD_WriteReg( 0xD230, 0x03 ) ;
  LCD_WriteReg( 0xD231, 0x33 ) ;
  LCD_WriteReg( 0xD232, 0x03 ) ;
  LCD_WriteReg( 0xD233, 0x6D ) ;
  LCD_WriteReg( 0xD300, 0x00 ) ;
  LCD_WriteReg( 0xD301, 0x33 ) ;
  LCD_WriteReg( 0xD302, 0x00 ) ;
  LCD_WriteReg( 0xD303, 0x34 ) ;
  LCD_WriteReg( 0xD304, 0x00 ) ;
  LCD_WriteReg( 0xD305, 0x3A ) ;
  LCD_WriteReg( 0xD306, 0x00 ) ;
  LCD_WriteReg( 0xD307, 0x4A ) ;
  LCD_WriteReg( 0xD308, 0x00 ) ;
  LCD_WriteReg( 0xD309, 0x5C ) ;
  LCD_WriteReg( 0xD30A, 0x00 ) ;
  LCD_WriteReg( 0xD30B, 0x81 ) ;
  LCD_WriteReg( 0xD30C, 0x00 ) ;
  LCD_WriteReg( 0xD30D, 0xA6 ) ;
  LCD_WriteReg( 0xD30E, 0x00 ) ;
  LCD_WriteReg( 0xD30F, 0xE5 ) ;
  LCD_WriteReg( 0xD310, 0x01 ) ;
  LCD_WriteReg( 0xD311, 0x13 ) ;
  LCD_WriteReg( 0xD312, 0x01 ) ;
  LCD_WriteReg( 0xD313, 0x54 ) ;
  LCD_WriteReg( 0xD314, 0x01 ) ;
  LCD_WriteReg( 0xD315, 0x82 ) ;
  LCD_WriteReg( 0xD316, 0x01 ) ;
  LCD_WriteReg( 0xD317, 0xCA ) ;
  LCD_WriteReg( 0xD318, 0x02 ) ;
  LCD_WriteReg( 0xD319, 0x00 ) ;
  LCD_WriteReg( 0xD31A, 0x02 ) ;
  LCD_WriteReg( 0xD31B, 0x01 ) ;
  LCD_WriteReg( 0xD31C, 0x02 ) ;
  LCD_WriteReg( 0xD31D, 0x34 ) ;
  LCD_WriteReg( 0xD31E, 0x02 ) ;
  LCD_WriteReg( 0xD31F, 0x67 ) ;
  LCD_WriteReg( 0xD320, 0x02 ) ;
  LCD_WriteReg( 0xD321, 0x84 ) ;
  LCD_WriteReg( 0xD322, 0x02 ) ;
  LCD_WriteReg( 0xD323, 0xA4 ) ;
  LCD_WriteReg( 0xD324, 0x02 ) ;
  LCD_WriteReg( 0xD325, 0xB7 ) ;
  LCD_WriteReg( 0xD326, 0x02 ) ;
  LCD_WriteReg( 0xD327, 0xCF ) ;
  LCD_WriteReg( 0xD328, 0x02 ) ;
  LCD_WriteReg( 0xD329, 0xDE ) ;
  LCD_WriteReg( 0xD32A, 0x02 ) ;
  LCD_WriteReg( 0xD32B, 0xF2 ) ;
  LCD_WriteReg( 0xD32C, 0x02 ) ;
  LCD_WriteReg( 0xD32D, 0xFE ) ;
  LCD_WriteReg( 0xD32E, 0x03 ) ;
  LCD_WriteReg( 0xD32F, 0x10 ) ;
  LCD_WriteReg( 0xD330, 0x03 ) ;
  LCD_WriteReg( 0xD331, 0x33 ) ;
  LCD_WriteReg( 0xD332, 0x03 ) ;
  LCD_WriteReg( 0xD333, 0x6D ) ;
  LCD_WriteReg( 0xD400, 0x00 ) ;
  LCD_WriteReg( 0xD401, 0x33 ) ;
  LCD_WriteReg( 0xD402, 0x00 ) ;
  LCD_WriteReg( 0xD403, 0x34 ) ;
  LCD_WriteReg( 0xD404, 0x00 ) ;
  LCD_WriteReg( 0xD405, 0x3A ) ;
  LCD_WriteReg( 0xD406, 0x00 ) ;
  LCD_WriteReg( 0xD407, 0x4A ) ;
  LCD_WriteReg( 0xD408, 0x00 ) ;
  LCD_WriteReg( 0xD409, 0x5C ) ;
  LCD_WriteReg( 0xD40A, 0x00 ) ;
  LCD_WriteReg( 0xD40B, 0x81 ) ;
  LCD_WriteReg( 0xD40C, 0x00 ) ;
  LCD_WriteReg( 0xD40D, 0xA6 ) ;
  LCD_WriteReg( 0xD40E, 0x00 ) ;
  LCD_WriteReg( 0xD40F, 0xE5 ) ;
  LCD_WriteReg( 0xD410, 0x01 ) ;
  LCD_WriteReg( 0xD411, 0x13 ) ;
  LCD_WriteReg( 0xD412, 0x01 ) ;
  LCD_WriteReg( 0xD413, 0x54 ) ;
  LCD_WriteReg( 0xD414, 0x01 ) ;
  LCD_WriteReg( 0xD415, 0x82 ) ;
  LCD_WriteReg( 0xD416, 0x01 ) ;
  LCD_WriteReg( 0xD417, 0xCA ) ;
  LCD_WriteReg( 0xD418, 0x02 ) ;
  LCD_WriteReg( 0xD419, 0x00 ) ;
  LCD_WriteReg( 0xD41A, 0x02 ) ;
  LCD_WriteReg( 0xD41B, 0x01 ) ;
  LCD_WriteReg( 0xD41C, 0x02 ) ;
  LCD_WriteReg( 0xD41D, 0x34 ) ;
  LCD_WriteReg( 0xD41E, 0x02 ) ;
  LCD_WriteReg( 0xD41F, 0x67 ) ;
  LCD_WriteReg( 0xD420, 0x02 ) ;
  LCD_WriteReg( 0xD421, 0x84 ) ;
  LCD_WriteReg( 0xD422, 0x02 ) ;
  LCD_WriteReg( 0xD423, 0xA4 ) ;
  LCD_WriteReg( 0xD424, 0x02 ) ;
  LCD_WriteReg( 0xD425, 0xB7 ) ;
  LCD_WriteReg( 0xD426, 0x02 ) ;
  LCD_WriteReg( 0xD427, 0xCF ) ;
  LCD_WriteReg( 0xD428, 0x02 ) ;
  LCD_WriteReg( 0xD429, 0xDE ) ;
  LCD_WriteReg( 0xD42A, 0x02 ) ;
  LCD_WriteReg( 0xD42B, 0xF2 ) ;
  LCD_WriteReg( 0xD42C, 0x02 ) ;
  LCD_WriteReg( 0xD42D, 0xFE ) ;
  LCD_WriteReg( 0xD42E, 0x03 ) ;
  LCD_WriteReg( 0xD42F, 0x10 ) ;
  LCD_WriteReg( 0xD430, 0x03 ) ;
  LCD_WriteReg( 0xD431, 0x33 ) ;
  LCD_WriteReg( 0xD432, 0x03 ) ;
  LCD_WriteReg( 0xD433, 0x6D ) ;
  LCD_WriteReg( 0xD500, 0x00 ) ;
  LCD_WriteReg( 0xD501, 0x33 ) ;
  LCD_WriteReg( 0xD502, 0x00 ) ;
  LCD_WriteReg( 0xD503, 0x34 ) ;
  LCD_WriteReg( 0xD504, 0x00 ) ;
  LCD_WriteReg( 0xD505, 0x3A ) ;
  LCD_WriteReg( 0xD506, 0x00 ) ;
  LCD_WriteReg( 0xD507, 0x4A ) ;
  LCD_WriteReg( 0xD508, 0x00 ) ;
  LCD_WriteReg( 0xD509, 0x5C ) ;
  LCD_WriteReg( 0xD50A, 0x00 ) ;
  LCD_WriteReg( 0xD50B, 0x81 ) ;
  LCD_WriteReg( 0xD50C, 0x00 ) ;
  LCD_WriteReg( 0xD50D, 0xA6 ) ;
  LCD_WriteReg( 0xD50E, 0x00 ) ;
  LCD_WriteReg( 0xD50F, 0xE5 ) ;
  LCD_WriteReg( 0xD510, 0x01 ) ;
  LCD_WriteReg( 0xD511, 0x13 ) ;
  LCD_WriteReg( 0xD512, 0x01 ) ;
  LCD_WriteReg( 0xD513, 0x54 ) ;
  LCD_WriteReg( 0xD514, 0x01 ) ;
  LCD_WriteReg( 0xD515, 0x82 ) ;
  LCD_WriteReg( 0xD516, 0x01 ) ;
  LCD_WriteReg( 0xD517, 0xCA ) ;
  LCD_WriteReg( 0xD518, 0x02 ) ;
  LCD_WriteReg( 0xD519, 0x00 ) ;
  LCD_WriteReg( 0xD51A, 0x02 ) ;
  LCD_WriteReg( 0xD51B, 0x01 ) ;
  LCD_WriteReg( 0xD51C, 0x02 ) ;
  LCD_WriteReg( 0xD51D, 0x34 ) ;
  LCD_WriteReg( 0xD51E, 0x02 ) ;
  LCD_WriteReg( 0xD51F, 0x67 ) ;
  LCD_WriteReg( 0xD520, 0x02 ) ;
  LCD_WriteReg( 0xD521, 0x84 ) ;
  LCD_WriteReg( 0xD522, 0x02 ) ;
  LCD_WriteReg( 0xD523, 0xA4 ) ;
  LCD_WriteReg( 0xD524, 0x02 ) ;
  LCD_WriteReg( 0xD525, 0xB7 ) ;
  LCD_WriteReg( 0xD526, 0x02 ) ;
  LCD_WriteReg( 0xD527, 0xCF ) ;
  LCD_WriteReg( 0xD528, 0x02 ) ;
  LCD_WriteReg( 0xD529, 0xDE ) ;
  LCD_WriteReg( 0xD52A, 0x02 ) ;
  LCD_WriteReg( 0xD52B, 0xF2 ) ;
  LCD_WriteReg( 0xD52C, 0x02 ) ;
  LCD_WriteReg( 0xD52D, 0xFE ) ;
  LCD_WriteReg( 0xD52E, 0x03 ) ;
  LCD_WriteReg( 0xD52F, 0x10 ) ;
  LCD_WriteReg( 0xD530, 0x03 ) ;
  LCD_WriteReg( 0xD531, 0x33 ) ;
  LCD_WriteReg( 0xD532, 0x03 ) ;
  LCD_WriteReg( 0xD533, 0x6D ) ;
  LCD_WriteReg( 0xD600, 0x00 ) ;
  LCD_WriteReg( 0xD601, 0x33 ) ;
  LCD_WriteReg( 0xD602, 0x00 ) ;
  LCD_WriteReg( 0xD603, 0x34 ) ;
  LCD_WriteReg( 0xD604, 0x00 ) ;
  LCD_WriteReg( 0xD605, 0x3A ) ;
  LCD_WriteReg( 0xD606, 0x00 ) ;
  LCD_WriteReg( 0xD607, 0x4A ) ;
  LCD_WriteReg( 0xD608, 0x00 ) ;
  LCD_WriteReg( 0xD609, 0x5C ) ;
  LCD_WriteReg( 0xD60A, 0x00 ) ;
  LCD_WriteReg( 0xD60B, 0x81 ) ;
  LCD_WriteReg( 0xD60C, 0x00 ) ;
  LCD_WriteReg( 0xD60D, 0xA6 ) ;
  LCD_WriteReg( 0xD60E, 0x00 ) ;
  LCD_WriteReg( 0xD60F, 0xE5 ) ;
  LCD_WriteReg( 0xD610, 0x01 ) ;
  LCD_WriteReg( 0xD611, 0x13 ) ;
  LCD_WriteReg( 0xD612, 0x01 ) ;
  LCD_WriteReg( 0xD613, 0x54 ) ;
  LCD_WriteReg( 0xD614, 0x01 ) ;
  LCD_WriteReg( 0xD615, 0x82 ) ;
  LCD_WriteReg( 0xD616, 0x01 ) ;
  LCD_WriteReg( 0xD617, 0xCA ) ;
  LCD_WriteReg( 0xD618, 0x02 ) ;
  LCD_WriteReg( 0xD619, 0x00 ) ;
  LCD_WriteReg( 0xD61A, 0x02 ) ;
  LCD_WriteReg( 0xD61B, 0x01 ) ;
  LCD_WriteReg( 0xD61C, 0x02 ) ;
  LCD_WriteReg( 0xD61D, 0x34 ) ;
  LCD_WriteReg( 0xD61E, 0x02 ) ;
  LCD_WriteReg( 0xD61F, 0x67 ) ;
  LCD_WriteReg( 0xD620, 0x02 ) ;
  LCD_WriteReg( 0xD621, 0x84 ) ;
  LCD_WriteReg( 0xD622, 0x02 ) ;
  LCD_WriteReg( 0xD623, 0xA4 ) ;
  LCD_WriteReg( 0xD624, 0x02 ) ;
  LCD_WriteReg( 0xD625, 0xB7 ) ;
  LCD_WriteReg( 0xD626, 0x02 ) ;
  LCD_WriteReg( 0xD627, 0xCF ) ;
  LCD_WriteReg( 0xD628, 0x02 ) ;
  LCD_WriteReg( 0xD629, 0xDE ) ;
  LCD_WriteReg( 0xD62A, 0x02 ) ;
  LCD_WriteReg( 0xD62B, 0xF2 ) ;
  LCD_WriteReg( 0xD62C, 0x02 ) ;
  LCD_WriteReg( 0xD62D, 0xFE ) ;
  LCD_WriteReg( 0xD62E, 0x03 ) ;
  LCD_WriteReg( 0xD62F, 0x10 ) ;
  LCD_WriteReg( 0xD630, 0x03 ) ;
  LCD_WriteReg( 0xD631, 0x33 ) ;
  LCD_WriteReg( 0xD632, 0x03 ) ;
  LCD_WriteReg( 0xD633, 0x6D ) ;
  //LV2 Page 0 enable
  LCD_WriteReg( 0xF000, 0x55 ) ;
  LCD_WriteReg( 0xF001, 0xAA ) ;
  LCD_WriteReg( 0xF002, 0x52 ) ;
  LCD_WriteReg( 0xF003, 0x08 ) ;
  LCD_WriteReg( 0xF004, 0x00 ) ;
  //Display control
  LCD_WriteReg( 0xB100,  0xCC ) ;
  LCD_WriteReg( 0xB101,  0x00 ) ;
  //Source hold time
  LCD_WriteReg( 0xB600, 0x05 ) ;
  //Gate EQ control
  LCD_WriteReg( 0xB700, 0x70 ) ;
  LCD_WriteReg( 0xB701, 0x70 ) ;
  //Source EQ control ( Mode 2 )
  LCD_WriteReg( 0xB800, 0x01 ) ;
  LCD_WriteReg( 0xB801, 0x03 ) ;
  LCD_WriteReg( 0xB802, 0x03 ) ;
  LCD_WriteReg( 0xB803, 0x03 ) ;
  //Inversion mode ( 2-dot )
  LCD_WriteReg( 0xBC00, 0x02 ) ;
  LCD_WriteReg( 0xBC01, 0x00 ) ;
  LCD_WriteReg( 0xBC02, 0x00 ) ;
  //Timing control 4H w/ 4-delay
  LCD_WriteReg( 0xC900, 0xD0 ) ;
  LCD_WriteReg( 0xC901, 0x02 ) ;
  LCD_WriteReg( 0xC902, 0x50 ) ;
  LCD_WriteReg( 0xC903, 0x50 ) ;
  LCD_WriteReg( 0xC904, 0x50 ) ;
  LCD_WriteReg( 0x3500, 0x00 ) ;
  LCD_WriteReg( 0x3A00, 0x55 ) ;                                    //16-bit/pixel
  LCD->LCD_REG = 0x1100 ;
  delay_us( 120 ) ;
  LCD->LCD_REG = 0x2900 ;
  LCD_Display_Dir() ;                    //默认为竖屏
  LCD_LED = 1 ;                      //点亮背光
  LCD_Clear( WHITE ) ;
}
void LCD_Clear( u16 color )
{
  u32 index = 0 ;
  u32 totalpoint = lcddev.width ;
  totalpoint *= lcddev.height ;                //得到总点数
  LCD_SetCursor( 0, 0 ) ;                    //设置光标位置
  LCD->LCD_REG = lcddev.wramcmd ;              //开始写入GRAM
  for( index=0; indexLCD_RAM = color ;
}
void LCD_Fast_DrawPoint( u16 x, u16 y, u16 color )
{     
  LCD_WriteReg( lcddev.setxcmd, x>>8 ) ;
  LCD_WriteReg( lcddev.setxcmd+1, x&0xFF ) ;
  LCD_WriteReg( lcddev.setycmd, y>>8 ) ;
  LCD_WriteReg( lcddev.setycmd+1, y&0xFF ) ;
  LCD_WriteReg( lcddev.wramcmd, color ) ;  
}
u16 POINT_COLOR=RED ;                    //画笔颜色
u16 BACK_COLOR=WHITE ;                    //背景色
void LCD_ShowChar( u16 x, u16 y, u8 num )
{                  
    u8 temp, t1, t ;
  u16 y0=y ;
   num = num-' ' ;                      //得到偏移后的值
  for( t=0; t<16; t++ )
  {   
    temp = asc2_1608[ num ][ t ] ;              //调用1608字体
    for( t1=0; t1<8; t1++ )
    {
      if( ( temp&0x80 )==0x80 )
        LCD_Fast_DrawPoint( x, y, POINT_COLOR ) ;
      else
        LCD_Fast_DrawPoint( x, y, BACK_COLOR ) ;
      temp <<= 1 ;
      y ++ ;
      //超区域了
      if( y>=lcddev.height )
        return ;
      if( ( y-y0 )==16 )
      {
        y = y0 ;
        x ++ ;
        //超区域了
        if( x>=lcddev.width )
          return ;
        break ;
      }
    }
  }
}
void LCD_ShowString( u16 x, u16 y, u8 *p )
{
  //判断是不是非法字符
    while( ( *p<='~' )&&( *p>=' ' ) )
    {       
    //退出
        if( ( y>=lcddev.height )||( x>=lcddev.width ) )
      break ;
        LCD_ShowChar( x, y, *p ) ;
        x += 8 ;
        p ++ ;
    }  
}

注1 :省略的初始化代码是在采购屏幕的时候生产厂家提供的驱动代码,这部分代码包括初始化屏幕的伽马校正以及显示地址增加等功能,可以不去管,只需要复制到初始化的位置即可。

注2 :清屏函数LCD_Clear

清屏其实就是在屏幕中送入白色或者别的颜色,一般都是全部像素点写入白色,该函数也可以用于填充颜色使用,程序中首先通过横坐标点数和纵坐标点数计算出所有像素点的个数,由于初始化中设置了地址自增加功能,所以可以设定开始地址后直接不停的发送白色的数据代码,直到所有像素点全部填充后结束。

注3 :显示1个字符函数LCD_ShowChar

TFTLCD由于内部没有字库,所以所有的英文包括ASCII码,中文都需要自己取模,取模的方式类似于之前的51单片机驱动点阵,这种情况下可以采用厂家提供的现成的代码,或者自己用取模软件直接生成代码,文件中包含的头文件font.h其实就是自己通过软件得到的ASCII码的字符点阵数据。读取点阵的时候,1的位置写入设置的颜色(画笔颜色),0的位置写入背景颜色,当背景颜色和刷屏颜色一样的时候,看起来就像是显示了数据一样(也可以不写入背景颜色,直接在1的位置写入画笔颜色,0的位置不管,这种情况下可以实现字体的透明效果)。

注4 :显示字符串函数LCD_ShowString

显示字符串函数实际就是频繁调用函数LCD_ShowChar,通过while循环来判断字符串的结尾,将结尾之前的数据全部写入后退出循环。有的厂家会提供完整的例程,里面包括显示数字,显示图像,其实本质都是通过判断点阵数据来写入画笔颜色和背景颜色。

(3)创建font.h,自己通过取模软件来添加字符的字模。

#ifndef _FONT_H_
#define _FONT_H_
//常用ASCII表
//阴码+逐列式+顺向+C51格式
const unsigned char asc2_1608[95][16]={    
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/
{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/
{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/
{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/
{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/
{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/
{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/
{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/
{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/
{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/
{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/
{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/
{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/
{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/
{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/
{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/
{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/
{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/
{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/
{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/
{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/
{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/
{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/
{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/
{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/
{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/
{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/
{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/
{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/
{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/
{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/
{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/
{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/
{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/
{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/
{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/
{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/
{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/
{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/
{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/
{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/
{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/
{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/
{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/
{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/
{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/
{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\\",60*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/
{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/
{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/
{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/
{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/
{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/
{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/
{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/
{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/
{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/
{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/
{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/
{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/
{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/
{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/
{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/
{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/
{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/
{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/
{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/
{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/
{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/
{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/
{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/
{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/
{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/
{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/
{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/
{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/
};


#endif
打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

LCD_REG = LCD_Reg ; //写入寄存器序号 LCD->LCD_RAM = LCD_RegValue ; //写入数据 }">
×
20
完善资料,
赚取积分