Hello,
i have a 4" TFT Display with NT35510 Controller. The Example from Waveshare are runs. Now
i want use LittlevGL. But i dont understand, how i setup the driver forthe TFT.
Regards Sascha
Hello,
i have a 4" TFT Display with NT35510 Controller. The Example from Waveshare are runs. Now
i want use LittlevGL. But i dont understand, how i setup the driver forthe TFT.
Regards Sascha
Your display driver has a drawPixel function or something similar. You must add this to the _flush _cb function, as shown in the example. https://docs.littlevgl.com/en/html/porting/display.html
In my case (ili9325(fscm)+stm32f103v) it look like that:
void tft_init()
{
/*A static or global variable to store the buffers*/
static lv_disp_buf_t disp_buf1;
static lv_color_t buf_1[LV_HOR_RES_MAX * 10];
/*Static or global buffer(s). The second buffer is optional*/
/*Initialize `disp_buf` with the buffer(s) */
lv_disp_buf_init(&disp_buf1, buf_1, NULL, LV_HOR_RES_MAX*10);
ili9325_Init();
lv_disp_drv_init(&disp_drv1); /*Basic initialization*/
disp_drv1.buffer = &disp_buf1; /*Set an initialized buffer*/
disp_drv1.flush_cb = ili9325_flush_cb; /*Set a flush callback to draw to the display*/
lv_disp_drv_register(&disp_drv1); /*Register the driver and save the created display objects*/
}
static void ili9325_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
int32_t x, y;
for(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) {
ili9325_WritePixel(x, y,color_p->full);
color_p++;
}
}
lv_disp_flush_ready(disp_drv);
}
Сall tft_init() in main.c or somebody else. Your display ready to lvgl. After that you can try some demo or create your own GUI.
Thank. I’m building a new Project. But it compiled with a error:
E:/STM32CubeIDE/workspace_1.3.0/STM32F407_Liilevgl_NT35510/Debug/…/Core/Src/main.c:97: undefined reference to `lv_init’
I use STM32Cubeide. In the Project Setting, i have added the Inlude Path for lvgl:
…/lvgl
…/lvgl/src
In my main.c:
/* USER CODE BEGIN Includes */
#include “lvgl.h”
/* USER CODE END Includes */
How is my mistake?
It looks like you didn’t add the LittlevGL source files to your project, so they’re not being compiled/linked into your binary.
Hi,
I imported the entire folder lvgl. I have adapted the Inlude paths for the C compiler. What or where can I set what else?
Greetings Sascha