stm32 littlevg移植

开源GUIstm32 littlevg移植_第1张图片下载源码 链接

stm32 littlevg移植_第2张图片准备好一个基础的屏幕程序,我用的是野火霸道搭配3.2屏幕
源码重命名lvgl加入到工程中,并把lv_conf_template.h重命名lv_conf.h加入user中 打开工程添加src下面文件夹中的所有文件
stm32 littlevg移植_第3张图片打开工程添加src下面文件夹中的所有文件,proting中lv_port_disp_template.c文件

stm32 littlevg移植_第4张图片修改一下设置
stm32 littlevg移植_第5张图片修改lv_conf.h文件,使能文件,开头的0改为有1,之后还会遇到,屏幕大小,gpu是否使能,没有gpu改为0,修改lv_port_disp_template.h

stm32 littlevg移植_第6张图片
#define LV_USE_GPU 0

修改lv_port_disp_template.c,
1,使能文件,包含头文件并使能修改
2,函数修改
SetPointPixel ( x,y,color_p->full);是自己写的打点函数

/* 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*/

    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)*/
					
//					LTDC_Draw_Point(x,y,color_p->full);
					SetPointPixel ( 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);
}

stm32 littlevg移植_第7张图片

你可能感兴趣的:(stm32)