Skip to content

Commit

Permalink
LVGL: Updated BSPs and examples for new ESP LVGL Port (LVGL9)
Browse files Browse the repository at this point in the history
  • Loading branch information
espzav committed May 22, 2024
1 parent b5f68c3 commit ff17327
Show file tree
Hide file tree
Showing 121 changed files with 1,290 additions and 723 deletions.
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_c3_lcdkit/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32c3
dependencies:
idf: ">=4.4"
esp32_c3_lcdkit: "*"
esp32_c3_lcdkit: "==1.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s2
dependencies:
idf: ">=4.4"
esp32_s2_kaluga_kit: "*"
esp32_s2_kaluga_kit: "==3.0.1"
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s2_kaluga_kit/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s2"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_eye/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp32_s3_eye: "*"
esp32_s3_eye: "==3.0.4"
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_eye/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_korvo_2/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp32_s3_korvo_2: "*"
esp32_s3_korvo_2: "==2.1.2"
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_korvo_2/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: ESP-BSP SquareLine LVGL Example
targets:
- esp32s3
dependencies:
esp32_s3_lcd_ev_board: "*"
esp32_s3_lcd_ev_board: "==2.1.0"
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_usb_otg/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp32_s3_usb_otg: "*"
esp32_s3_usb_otg: "==1.5.1"
2 changes: 1 addition & 1 deletion SquareLine/boards/esp32_s3_usb_otg/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp-box: "*"
esp-box: "==3.0.5"
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox_3/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp-box-3: "*"
esp-box-3: "==1.1.3"
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox_3/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox_lite/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=4.4"
esp-box-lite: "*"
esp-box-lite: "==2.0.4"
2 changes: 1 addition & 1 deletion SquareLine/boards/espbox_lite/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ CONFIG_IDF_TARGET="esp32s3"
CONFIG_LV_COLOR_16_SWAP=y
CONFIG_LV_MEM_CUSTOM=y
CONFIG_LV_MEMCPY_MEMSET_STD=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_PERF_MONITOR=y
2 changes: 1 addition & 1 deletion SquareLine/boards/espwroverkit/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32
dependencies:
idf: ">=4.4"
esp_wrover_kit: "^1.0.0"
esp_wrover_kit: "==1.5.1"
2 changes: 1 addition & 1 deletion SquareLine/boards/m5stack_core_s3/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ targets:
- esp32s3
dependencies:
idf: ">=5.0"
m5stack_core_s3: "*"
m5stack_core_s3: "==1.0.0"
15 changes: 9 additions & 6 deletions bsp/esp-box-3/esp-box-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static const ili9341_lcd_init_cmd_t vendor_specific_init[] = {
{0, (uint8_t []){0}, 0xff, 0},
};

static lv_disp_t *disp;
static lv_display_t *disp;
static lv_indev_t *disp_indev = NULL;
static esp_lcd_touch_handle_t tp; // LCD touch handle
static esp_lcd_panel_handle_t panel_handle = NULL;
Expand Down Expand Up @@ -424,7 +424,7 @@ esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_hand
return ret;
}

static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
esp_lcd_panel_io_handle_t io_handle = NULL;
Expand Down Expand Up @@ -454,6 +454,9 @@ static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
.flags = {
.buff_dma = cfg->flags.buff_dma,
.buff_spiram = cfg->flags.buff_spiram,
#if LVGL_VERSION_MAJOR >= 9
.swap_bytes = (BSP_LCD_BIGENDIAN ? true : false),
#endif
}
};

Expand Down Expand Up @@ -534,7 +537,7 @@ esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t
return ESP_OK;
}

static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
static lv_indev_t *bsp_display_indev_init(lv_display_t *disp)
{
BSP_ERROR_CHECK_RETURN_NULL(bsp_touch_new(NULL, &tp));
assert(tp);
Expand All @@ -548,7 +551,7 @@ static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
return lvgl_port_add_touch(&touch_cfg);
}

lv_disp_t *bsp_display_start(void)
lv_display_t *bsp_display_start(void)
{
bsp_display_cfg_t cfg = {
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
Expand All @@ -566,7 +569,7 @@ lv_disp_t *bsp_display_start(void)
return bsp_display_start_with_config(&cfg);
}

lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg));
Expand All @@ -585,7 +588,7 @@ lv_indev_t *bsp_display_get_input_dev(void)
return disp_indev;
}

void bsp_display_rotate(lv_disp_t *disp, lv_disp_rot_t rotation)
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation)
{
lv_disp_set_rotation(disp, rotation);
}
Expand Down
3 changes: 1 addition & 2 deletions bsp/esp-box-3/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

version: "1.1.3"
version: "1.2.0"
description: Board Support Package (BSP) for ESP32-S3-BOX-3
url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp-box-3

Expand All @@ -14,7 +14,6 @@ dependencies:
esp_lcd_touch_tt21100: "^1"
esp_lcd_touch_gt911: "^1"
esp_lcd_ili9341: "^1"
lvgl/lvgl: "^8"

espressif/esp_lvgl_port:
version: "^2"
Expand Down
6 changes: 3 additions & 3 deletions bsp/esp-box-3/include/bsp/esp-box-3.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ esp_err_t bsp_sdcard_unmount(void);
*
* @return Pointer to LVGL display or NULL when error occurred
*/
lv_disp_t *bsp_display_start(void);
lv_display_t *bsp_display_start(void);

/**
* @brief Initialize display
Expand All @@ -363,7 +363,7 @@ lv_disp_t *bsp_display_start(void);
*
* @return Pointer to LVGL display or NULL when error occurred
*/
lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg);
lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg);

/**
* @brief Get pointer to input device (touch, buttons, ...)
Expand Down Expand Up @@ -419,7 +419,7 @@ esp_err_t bsp_display_exit_sleep(void);
* @param[in] disp Pointer to LVGL display
* @param[in] rotation Angle of the display rotation
*/
void bsp_display_rotate(lv_disp_t *disp, lv_disp_rot_t rotation);
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation);
/**************************************************************************************************
*
* Button
Expand Down
15 changes: 9 additions & 6 deletions bsp/esp-box-lite/esp-box-lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_hand
return ret;
}

static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
esp_lcd_panel_io_handle_t io_handle = NULL;
Expand Down Expand Up @@ -363,13 +363,16 @@ static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
.flags = {
.buff_dma = cfg->flags.buff_dma,
.buff_spiram = cfg->flags.buff_spiram,
#if LVGL_VERSION_MAJOR >= 9
.swap_bytes = (BSP_LCD_BIGENDIAN ? true : false),
#endif
}
};

return lvgl_port_add_disp(&disp_cfg);
}

static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
static lv_indev_t *bsp_display_indev_init(lv_display_t *disp)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
/* Initialize ADC and get ADC handle */
Expand All @@ -387,7 +390,7 @@ static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
return lvgl_port_add_navigation_buttons(&btns);
}

lv_disp_t *bsp_display_start(void)
lv_display_t *bsp_display_start(void)
{
bsp_display_cfg_t cfg = {
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
Expand All @@ -405,9 +408,9 @@ lv_disp_t *bsp_display_start(void)
return bsp_display_start_with_config(&cfg);
}

lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
{
lv_disp_t *disp;
lv_display_t *disp;
assert(cfg != NULL);
BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg));

Expand All @@ -425,7 +428,7 @@ lv_indev_t *bsp_display_get_input_dev(void)
return disp_indev;
}

void bsp_display_rotate(lv_disp_t *disp, lv_disp_rot_t rotation)
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation)
{
lv_disp_set_rotation(disp, rotation);
}
Expand Down
3 changes: 1 addition & 2 deletions bsp/esp-box-lite/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2.0.4"
version: "2.1.0"
description: Board Support Package (BSP) for ESP32-S3-BOX-Lite
url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp-box-lite

Expand All @@ -10,7 +10,6 @@ tags:

dependencies:
idf: ">=4.4.5"
lvgl/lvgl: "^8"

button:
version: ">=2.4"
Expand Down
6 changes: 3 additions & 3 deletions bsp/esp-box-lite/include/bsp/esp-box-lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ esp_err_t bsp_spiffs_unmount(void);
*
* @return Pointer to LVGL display or NULL when error occurred
*/
lv_disp_t *bsp_display_start(void);
lv_display_t *bsp_display_start(void);

/**
* @brief Initialize display
Expand All @@ -308,7 +308,7 @@ lv_disp_t *bsp_display_start(void);
*
* @return Pointer to LVGL display or NULL when error occurred
*/
lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg);
lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg);

/**
* @brief Get pointer to input device (touch, buttons, ...)
Expand Down Expand Up @@ -342,7 +342,7 @@ void bsp_display_unlock(void);
* @param[in] disp Pointer to LVGL display
* @param[in] rotation Angle of the display rotation
*/
void bsp_display_rotate(lv_disp_t *disp, lv_disp_rot_t rotation);
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation);

/**************************************************************************************************
*
Expand Down
15 changes: 9 additions & 6 deletions bsp/esp-box/esp-box.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const char *TAG = "ESP-BOX";
_Static_assert(CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS > 0, "Touch buttons must be supported for this BSP");
/** @endcond */

static lv_disp_t *disp;
static lv_display_t *disp;
static lv_indev_t *disp_indev = NULL;
static esp_lcd_touch_handle_t tp; // LCD touch handle
static bool i2c_initialized = false;
Expand Down Expand Up @@ -318,7 +318,7 @@ esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_hand
return ret;
}

static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
esp_lcd_panel_io_handle_t io_handle = NULL;
Expand Down Expand Up @@ -349,6 +349,9 @@ static lv_disp_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg)
.flags = {
.buff_dma = cfg->flags.buff_dma,
.buff_spiram = cfg->flags.buff_spiram,
#if LVGL_VERSION_MAJOR >= 9
.swap_bytes = (BSP_LCD_BIGENDIAN ? true : false),
#endif
}
};

Expand Down Expand Up @@ -382,7 +385,7 @@ esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t
return esp_lcd_touch_new_i2c_tt21100(tp_io_handle, &tp_cfg, ret_touch);
}

static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
static lv_indev_t *bsp_display_indev_init(lv_display_t *disp)
{
BSP_ERROR_CHECK_RETURN_NULL(bsp_touch_new(NULL, &tp));
assert(tp);
Expand All @@ -396,7 +399,7 @@ static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp)
return lvgl_port_add_touch(&touch_cfg);
}

lv_disp_t *bsp_display_start(void)
lv_display_t *bsp_display_start(void)
{
bsp_display_cfg_t cfg = {
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
Expand All @@ -414,7 +417,7 @@ lv_disp_t *bsp_display_start(void)
return bsp_display_start_with_config(&cfg);
}

lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg)
{
assert(cfg != NULL);
BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg));
Expand All @@ -433,7 +436,7 @@ lv_indev_t *bsp_display_get_input_dev(void)
return disp_indev;
}

void bsp_display_rotate(lv_disp_t *disp, lv_disp_rot_t rotation)
void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation)
{
lv_disp_set_rotation(disp, rotation);
}
Expand Down
3 changes: 1 addition & 2 deletions bsp/esp-box/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

version: "3.0.5"
version: "3.1.0"
description: Board Support Package (BSP) for ESP-BOX
url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp-box

Expand All @@ -12,7 +12,6 @@ tags:
dependencies:
idf: ">=4.4.5"
esp_lcd_touch_tt21100: "^1"
lvgl/lvgl: "^8"

espressif/esp_lvgl_port:
version: "^2"
Expand Down
Loading

0 comments on commit ff17327

Please sign in to comment.