RA8889/RA8876显示自定义ASCII字符方法

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

先上一张实例效果图:
在这里插入图片描述
再上程序代码:

int main(void)
{
	unsigned short x,y;
	
	/* System Clocks Configuration */
	RCC_Configuration(); 
	delay_init(72);  
	GPIO_Configuration();	
	//NVIC_Configuration();	
	//SPI_Peripheral_Init();
 
	/* Enable the FSMC Clock */
	RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
	delay_ms(1);
	FSMC_LCD_Init_H();	

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

	while(1);
}

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

点击访问源代码下载地址

相关推荐

  1. ROS2】实现定义服务接口

    2024-04-02 17:14:06       47 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-02 17:14:06       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-02 17:14:06       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-02 17:14:06       82 阅读
  4. Python语言-面向对象

    2024-04-02 17:14:06       91 阅读

热门阅读

  1. 力扣(数组)第三大数

    2024-04-02 17:14:06       40 阅读
  2. android QtScrcpy 共享屏幕 获取本地Address

    2024-04-02 17:14:06       33 阅读
  3. Docker中安装PostgreSQL

    2024-04-02 17:14:06       42 阅读
  4. Github 2024-03-30 Rust开源项目日报 Top10

    2024-04-02 17:14:06       39 阅读
  5. Kafka安装

    2024-04-02 17:14:06       39 阅读
  6. Rust---复合数据类型之字符串(1)

    2024-04-02 17:14:06       40 阅读
  7. LeetCode题练习与总结:最大子数组和

    2024-04-02 17:14:06       46 阅读
  8. 微信的个人号接口

    2024-04-02 17:14:06       46 阅读