打印
[应用相关]

FMC+DAM驱动LVGL刷屏

[复制链接]
70|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
fm, FMC, DA, LVGL, AC, REA
前提条件
使用FMC驱动LCD刷屏

LVGL移植

























开启DMA



需要开启MEMTOMEMDMA。

开启MPU
有MPU时需要

使能I-cache D-cache时

使用DMA传输数据时要保证数据的完整行和准确性



修改代码
逻辑
等待DMA传输完成然后再刷屏。

修改
在DMA初始化函数中最后添加

注册DMA传输完成调用函数。

HAL_DMA_RegisterCallback(&hdma_memtomem_dma2_stream0, HAL_DMA_XFER_CPLT_CB_ID, LVGL_LCD_FSMC_DMA_pCallback);
1
修改disp_flush函数
/*Flush the content of the internal buffer the specific area on the display
*You can use DMA or any hardware acceleration to do this operation in the background but
*'lv_disp_flush_ready()' has to be called when finished.*/
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
    /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/

//     LCD_ShowPicture(area->x1, area->y1, area->x2 - area->x1+1, area->y2- area->y1+1, (uint16_t *)color_p);

        LCD_Address_Set(area->x1,area->y1,area->x2,area->y2); //写地址
       
        HAL_DMA_Start_IT(&hdma_memtomem_dma2_stream0, (uint32_t)color_p, Bank1_LCD_DATA, ((area->x2+1) - area->x1) * ((area->y2+1) - area->y1)); //写数据
    /*IMPORTANT!!!
//     *Inform the graphics library that you are ready with the flushing*/
//    lv_disp_flush_ready(disp_drv);
}



添加刷屏函数

刷屏函数

void LVGL_LCD_FSMC_DMA_pCallback(DMA_HandleTypeDef *_hdma)
{
        lv_disp_flush_ready(&disp_drv);
}
————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/qq_41555003/article/details/134221469

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

57

主题

4203

帖子

0

粉丝