Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the FAQ and read the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
I activate ILI9488 but I can’t open it in LVGL. As far as I’ve read on the forum, I need to use my disp flsuh function. Is there an example for this?
What MCU/Processor/Board and compiler are you using?
STM32F407 Discovery /Cube IDE
What LVGL version are you using?
LVGL v8.3
What do you want to achieve?
IRunning ILI9488 from FSMC mode using stm32f4 discovery
What have you tried so far?
I tested TFT from this library and tried to add the run My disp flush function to this library
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
static void tft_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
/Return if the area is out the screen/
if(area->x2 < 0) return;
if(area->y2 < 0) return;
if(area->x1 > ILI9488_LCD_PIXEL_WIDTH - 1) return;
if(area->y1 > ILI9488_LCD_PIXEL_HEIGHT - 1) return;
/*Truncate the area to the screen*/
int32_t act_x1 = area->x1 < 0 ? 0 : area->x1;
int32_t act_y1 = area->y1 < 0 ? 0 : area->y1;
int32_t act_x2 = area->x2 > ILI9488_LCD_PIXEL_WIDTH - 1 ? ILI9488_LCD_PIXEL_WIDTH - 1 : area->x2;
int32_t act_y2 = area->y2 > ILI9488_LCD_PIXEL_HEIGHT - 1 ? ILI9488_LCD_PIXEL_HEIGHT - 1 : area->y2;
x1_flush = act_x1;
y1_flush = act_y1;
x2_flush = act_x2;
y2_fill = act_y2;
y_fill_act = act_y1;
buf_to_flush = color_p;
/*##-7- Start the DMA transfer using the interrupt mode #*/
/* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */
/* Enable All the DMA interrupts */
}
static volatile uint32_t t_saved = 0;
void monitor_cb(lv_disp_drv_t * d, uint32_t t, uint32_t p)
{
t_saved = t;
}
void tft_init(){
static lv_color_t disp_buf1[ILI9488_LCD_PIXEL_WIDTH * 30];
static lv_color_t disp_buf2[ILI9488_LCD_PIXEL_HEIGHT * 30];
static lv_disp_draw_buf_t buf;
lv_disp_draw_buf_init(&buf, disp_buf1, disp_buf2, (10UL * 1024UL)/2);
lv_disp_drv_init(&disp_drv);
ili9488_Init();
disp_drv.draw_buf = &buf;
disp_drv.flush_cb = tft_flush;
disp_drv.monitor_cb = monitor_cb;
disp_drv.hor_res = ILI9488_LCD_PIXEL_WIDTH;
disp_drv.ver_res = ILI9488_LCD_PIXEL_HEIGHT;
lv_disp_drv_register(&disp_drv);
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.