Skip to content

LVGL graphics library

lbuild module: modm:lvgl

LVGL is a free and open-source graphics library providing everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.


LVGL defines defaults for all it's configuration settings, which you can find in the configuration template.

This module generates a lv_conf.h file to define the options necessary for integration with modm which are:

  • LV_MEM_CUSTOM = 1: Heap is provided by the modm:platform:heap module.
  • LV_TICK_CUSTOM = 1: Tick is implemented via the modm:platform:clock module.
  • LV_LOG_PRINTF = 0: logging is redirected to MODM_LOG_* if the modm:debug module is included and LV_USE_LOG = 1.
  • typedef int16_t lv_coord_t;: Hardcoded choice for now.

To add your own configuration you can create a <lv_conf_local.h> file which will automatically be included at the beginning of our lv_conf.h.

Example <lv_conf_local.h> configuration:

// Maximal resolutions
#define LV_HOR_RES_MAX  240
#define LV_VER_RES_MAX  320
#define LV_DPI          200

/* Color depth:
 * - 1:  1 byte per pixel
 * - 8:  RGB332
 * - 16: RGB565
 * - 32: ARGB8888
#define LV_COLOR_DEPTH  16

// Enable logging at INFO level
#define LV_USE_LOG    1

// Disable anti-aliasing
#define LV_ANTIALIAS  0


modm:lvgl modm_lvgl modm: lvgl modm_architecture_clock modm: architecture: clock modm_lvgl->modm_architecture_clock modm_platform_heap modm: platform: heap modm_lvgl->modm_platform_heap