LVGL移植STM32\GD32的方法基本一样
1.下载LVGL,直接官网或github下载压缩包,也可以使用squareline studio生成的文件,但似乎新版的squareline studio生产的项目多了一些东西,没有完全适配
2.用GD32工程导入LVGL源代码和移植文件,添加头文件路径
3,修改配置文件lv_conf.h,lv_port_disp.c(显示设置),lv_port_indev.c(触摸设置),lv_port_fs.c(文件系统)
4.修改lv_port_disp.c中的disp_flush函数
最简单的(最慢的):
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) { if(disp_flush_enabled) { /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/ int32_t x; int32_t y; for(y = area->y1; y <= area->y2; y++) { for(x = area->x1; x <= area->x2; x++) { /*Put a pixel to the display. For example:*/ /*put_px(x, y, *color_p)*/ LCD_Fast_DrawPoint(x,y,color_p->full); color_p++; } } } /*IMPORTANT!!! *Inform the graphics library that you are ready with the flushing*/ lv_disp_flush_ready(disp_drv); }
5.生成一个简单的ui
6.编写main.c
标签:disp,lv,keil,color,STM32,GD32,flush,LVGL,port From: https://www.cnblogs.com/moneymaster/p/17150222.html