#include "stm32f10x.h"
#include "bsp_ili9341_lcd.h"
#include "bsp_usart1.h"
extern void Lcd_Delay(__IO uint32_t nCount);
typedef struct
{
unsigned char Index[2];
unsigned char Msk[32];
/* data */
}typFont_GB16;
const typFont_GB16 ChnChar_16[]=
{
"这",
0x00,0x80,0x20,0x40,0x10,0x40,0x17,0xFC,0x00,0x10,0x02,0x10,0xF1,0x20,0x10,0xA0,
0x10,0x40,0x10,0xA0,0x11,0x10,0x12,0x08,0x14,0x08,0x28,0x00,0x47,0xFE,0x00,0x00,
"是",
0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x10,0x1F,0xF0,0x00,0x00,
0xFF,0xFE,0x01,0x00,0x11,0x00,0x11,0xF8,0x11,0x00,0x29,0x00,0x45,0x00,0x83,0xFE,
"一",
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
uint32_t n;
/**
* @brief 主函数
* @param 无
* @retval 无
*/
int main(void)
{
unsigned char k, *cn= "是";
LCD_Init();
LCD_Clear(0, 0, 240, 320, BACKGROUND);
for(k=0; k<3; k++)
{
if((ChnChar_16[k].Index[0] == cn[0]) && (ChnChar_16[k].Index[1] == cn[1]))
{
LCD_DispChar(60, 60, 'Y', RED);
break;
}
}
LCD_DispStr(10, 10, (uint8_t *)"This is a lcd demo to display ascii", RED);
LCD_DispStr(40, 100, (uint8_t *)"count:", RED);
for( n=0; n<500000; n++ )
{
LCD_DisNum(100, 100, n, RED);
Lcd_Delay(0xAFFf>>4);
}
while( 1 ){}
}
在ISO-V2开发板配套的例程《11、 FSMC-液晶显示-英文》修改的,可以进入
if((ChnChar_16[k].Index[0] == cn[0]) && (ChnChar_16[k].Index[1] == cn[1])) { LCD_DispChar(60, 60, 'Y', RED); break; } 可以想到的方法就是把有中文的C文件用记事本打开(打开就好,不用改内容),直接另存为:ANSI编码格式
|