diff --git a/docs/details/integration/driver/display/gen_mipi.rst b/docs/details/integration/driver/display/gen_mipi.rst index c5ac3a72bd..55cfbc8277 100644 --- a/docs/details/integration/driver/display/gen_mipi.rst +++ b/docs/details/integration/driver/display/gen_mipi.rst @@ -118,6 +118,12 @@ Example static void my_lcd_send_color(lv_display_t *disp, const uint8_t *cmd, size_t cmd_size, uint8_t *param, size_t param_size) { ... + + /* This must be called to signal that the transfer has finished. + * It is typically called in a "DMA transfer complete" callback + * long after `my_lcd_send_color` has returned. + */ + lv_display_flush_ready(disp); } int main(int argc, char ** argv) diff --git a/src/drivers/display/lcd/lv_lcd_generic_mipi.c b/src/drivers/display/lcd/lv_lcd_generic_mipi.c index e27e4c8607..f589ce9dfd 100644 --- a/src/drivers/display/lcd/lv_lcd_generic_mipi.c +++ b/src/drivers/display/lcd/lv_lcd_generic_mipi.c @@ -160,6 +160,7 @@ static void send_color(lv_lcd_generic_mipi_driver_t * drv, uint8_t cmd, uint8_t { uint8_t cmdbuf = cmd; /* MIPI uses 8 bit commands */ drv->send_color(drv->disp, &cmdbuf, 1, param, param_size); + /* note: LVGL waits for your callback to call `lv_display_flush_ready` to know when the transfer has finished. */ } /** diff --git a/src/drivers/display/lcd/lv_lcd_generic_mipi.h b/src/drivers/display/lcd/lv_lcd_generic_mipi.h index 95fbf67949..4c1422b520 100644 --- a/src/drivers/display/lcd/lv_lcd_generic_mipi.h +++ b/src/drivers/display/lcd/lv_lcd_generic_mipi.h @@ -179,7 +179,8 @@ typedef struct { * @param ver_res vertical resolution * @param flags default configuration settings (mirror, RGB ordering, etc.) * @param send_cmd platform-dependent function to send a command to the LCD controller (usually uses polling transfer) - * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer: must implement a 'ready' callback) + * @param send_color platform-dependent function to send pixel data to the LCD controller (usually uses DMA transfer). + * `lv_display_flush_ready` must be called after the transfer has finished. * @return pointer to the created display */ lv_display_t * lv_lcd_generic_mipi_create(uint32_t hor_res, uint32_t ver_res, lv_lcd_flag_t flags,