diff --git a/Kconfig b/Kconfig index 970b79190b..6fefb5fc32 100644 --- a/Kconfig +++ b/Kconfig @@ -711,6 +711,10 @@ menu "LVGL configuration" bool "Enable matrix support" default n select LV_USE_FLOAT + + config LV_USE_PRIVATE_API + bool "Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default" + default n endmenu menu "Font Usage" diff --git a/lv_conf_template.h b/lv_conf_template.h index ddf71cd13d..66462c0310 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -448,6 +448,9 @@ *Requires `LV_USE_FLOAT = 1`*/ #define LV_USE_MATRIX 0 +/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ +#define LV_USE_PRIVATE_API 0 + /*================== * FONT USAGE *===================*/ diff --git a/lvgl.h b/lvgl.h index 17549c9b1c..df6140e29a 100644 --- a/lvgl.h +++ b/lvgl.h @@ -120,6 +120,10 @@ extern "C" { #include "src/lv_api_map_v9_0.h" #include "src/lv_api_map_v9_1.h" +#if LV_USE_PRIVATE_API +#include "src/lvgl_private.h" +#endif + /********************* * DEFINES *********************/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index f8002f6781..b147f9a3be 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -1313,6 +1313,15 @@ #endif #endif +/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ +#ifndef LV_USE_PRIVATE_API + #ifdef CONFIG_LV_USE_PRIVATE_API + #define LV_USE_PRIVATE_API CONFIG_LV_USE_PRIVATE_API + #else + #define LV_USE_PRIVATE_API 0 + #endif +#endif + /*================== * FONT USAGE *===================*/