- void Get_GBK_DZK(uint8_t *code, uint8_t *dz_data)
- {
- uint8_t GBKH,GBKL;
- uint32_t offset;
- GBKH=*code;
- GBKL=*(code+1);
- if(GBKH>0XFE||GBKH<0X81)return;
- GBKH-=0x81;
- GBKL-=0x40;
- offset=((uint32_t)192*GBKH+GBKL)*32;
- W25Q16_Read(dz_data,offset+0x100,32);
- return;
- }
函数中,参数*code带入汉字的两字节编码,*dz_data是一个32个字节的数据,带入函数中,就可以得到任何一个汉字的字模了。例如:
- uint8_t buf[32];
- Get_GBK_DZK("瑞", buf);
|