求这段程序的含义STM32控制LCD,主要是求解释HZ_CODE16是怎么定义的?Hz_Code16[k].Hz_Index[0]是什意思const HZ_CODE16 Hz_Code16[]={"你",0x90,0x00,0x90,0x01,0x88,0x20,0xC8,0x7F,0x44,0x20,0x2C,0x12,0x16,0x02,0x45,0x0A,0xC4,0x12,0x44,0x12,0x24,0x22,0x24,0x62,0x14,0x22,0x84,0x02,0x04,0x01,0x00,0x00,"好",0x08,0x00,0x88,0x3F,0x08,0x20,0x08,0x10,0x3F,0x08,0x24,0x04,0x24,0x24,0xE4,0x7F,0x24,0x04,0x22,0x04,0x14,0x04,0x08,0x04,0x14,0x04,0x22,0x04,0x21,0x05,0x00,0x02,//结束符0xff,0xff,0,};for(k=0;Hz

问题描述:

求这段程序的含义STM32控制LCD,主要是求解释HZ_CODE16是怎么定义的?Hz_Code16[k].Hz_Index[0]是什意思
const HZ_CODE16 Hz_Code16[]=
{
"你",
0x90,0x00,0x90,0x01,0x88,0x20,0xC8,0x7F,0x44,0x20,0x2C,0x12,0x16,0x02,0x45,0x0A,
0xC4,0x12,0x44,0x12,0x24,0x22,0x24,0x62,0x14,0x22,0x84,0x02,0x04,0x01,0x00,0x00,
"好",
0x08,0x00,0x88,0x3F,0x08,0x20,0x08,0x10,0x3F,0x08,0x24,0x04,0x24,0x24,0xE4,0x7F,
0x24,0x04,0x22,0x04,0x14,0x04,0x08,0x04,0x14,0x04,0x22,0x04,0x21,0x05,0x00,0x02,
//结束符
0xff,0xff,0,
};
for(k=0;Hz_Code16[k].Hz_Index[0]!= 0xff;k++)
{ ;}

这些数字就是在LCD上显示的点.
比如“你”的第一个数字0x90,转换为二进制是10010000,那么对应的第一个像素点是显示,第二个和第三个是不显示,第四个显示.,以此类推,根据该数字设置屏幕上点的显示与不显示,最后就可以出现文字了.
这个定义可以使用字库生成程序来完成.
Hz_Code16[k].Hz_Index[0]是汉字区位的定义,前面的k为区,后面的0(当然也是可变的)是位,解析一个汉字的区位码可以得到0xXX区和0xXX位,然后根据这个区位的数字到数组中取得像素点,就可以显示在LCD上了.