[程序源码] RA8889/RA8876显示自定义ASCII字符方法

[复制链接]
 楼主| harchy 发表于 2024-4-2 15:57 | 显示全部楼层 |阅读模式
本帖最后由 harchy 于 2024-4-2 16:05 编辑

本文介绍用户自己生成的ASCII字库如何通过RA8889/RA8876显示到液晶屏上。

先上一张实例效果图:



再上程序代码:
  1. int main(void)
  2. {
  3.         unsigned short x,y;
  4.         
  5.         /* System Clocks Configuration */
  6.         RCC_Configuration();
  7.         delay_init(72);  
  8.         GPIO_Configuration();        
  9.         //NVIC_Configuration();        
  10.         //SPI_Peripheral_Init();

  11.         /* Enable the FSMC Clock */
  12.         RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  13.         delay_ms(1);
  14.         FSMC_LCD_Init_H();        

  15.         /*RA8889初始化*/
  16.         RA8889_Initial();
  17.         
  18.         /*清屏,填充黑色0x0*/
  19.         BTE_Solid_Fill(0,canvas_image_width,0,0,0x0,LCD_Width,LCD_Height);
  20.         
  21.         /*MCU写入ASCII字符功能例程测试,不支持MCU_16bit_ColorDepth_24bpp_Mode_1 */
  22.         x=30;
  23.         y=50;
  24.         lcdPutString8x12(x,y,color65k_black,color65k_yellow,0,"The things I want to know are in books, my best friend is the man ");
  25.         lcdPutString16x24(x,y+20,color65k_black,color65k_yellow,0,"who'll get me a book I ain't read.");
  26.         lcdPutString16x24(x+16*14,y+50,color65k_green,color65k_yellow,1," --Abraham Lincoln ");
  27.         lcdPutString32x48(x,y+100,color65k_white,color65k_yellow,1,"ASCII font lib is ");
  28.         lcdPutString32x48(x,y+150,color65k_white,color65k_yellow,1,"stored in the MCU's");
  29.         lcdPutString32x48(x,y+200,color65k_white,color65k_yellow,1,"FLASH.");

  30.         while(1);
  31. }

程序流程图:


该方法是将制作好的ASCII字库放在MCU的FLASH中进行引用,字符数量为95个,编码区间0x20~0x7E,通过编码即可索引,并调用相应的数据,通过RA8889/RA8876描点显示出来。

该地址可下载源代码
http://www.lcdvision.com.cn/html/2024/application_0402/63.html

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
您需要登录后才可以回帖 登录 | 注册

本版积分规则

15

主题

29

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部