From a1f23a0c802128e98dc85a0258871db6ec20898b Mon Sep 17 00:00:00 2001 From: C47D Date: Sun, 7 Feb 2021 17:55:20 -0600 Subject: [PATCH] lvgl_helpers: Add comment about DISP_BUF_SIZE --- lvgl_helpers.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lvgl_helpers.h b/lvgl_helpers.h index 9c622f7..15eb645 100644 --- a/lvgl_helpers.h +++ b/lvgl_helpers.h @@ -21,6 +21,19 @@ extern "C" { /********************* * DEFINES *********************/ + +/* DISP_BUF_SIZE value doesn't have an special meaning, but it's the size + * of the buffer(s) passed to LVGL as display buffers. The default values used + * were the values working for the contributor of the display controller. + * + * As LVGL supports partial display updates the DISP_BUF_SIZE doesn't + * necessarily need to be equal to the display size. + * + * When using RGB displays the display buffer size will also depends on the + * color format being used, for RGB565 each pixel needs 2 bytes. + * When using the mono theme, the display pixels can be represented in one bit, + * so the buffer size can be divided by 8, e.g. see SSD1306 display size. */ + #if defined (CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7789) #define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40) #elif defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7735S