Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/esp_lvgl_port/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

### Features
- Added option to include a rounder callback

### Fixes
- Fixed deinitialization of the task which was created with caps - https://github.com/espressif/esp-bsp/issues/680
- Call lv_deinit() - https://github.com/espressif/esp-bsp/issues/635
Expand Down
1 change: 1 addition & 0 deletions components/esp_lvgl_port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Add an LCD screen to the LVGL. It can be called multiple times for adding multip
.monochrome = false,
.mipi_dsi = false,
.color_format = LV_COLOR_FORMAT_RGB565,
.rounder_cb = my_rounder_cb,
.rotation = {
.swap_xy = false,
.mirror_x = false,
Expand Down
6 changes: 6 additions & 0 deletions components/esp_lvgl_port/include/esp_lvgl_port_disp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ typedef struct {
bool mirror_y; /*!< LCD Screen mirrored Y (in esp_lcd driver) */
} lvgl_port_rotation_cfg_t;

/**
* @brief Rounder callback
*/
typedef void (*lvgl_port_rounder_cb_t)(lv_area_t *area);

/**
* @brief Configuration display structure
*/
Expand All @@ -51,6 +56,7 @@ typedef struct {
bool monochrome; /*!< True, if display is monochrome and using 1bit for 1px */

lvgl_port_rotation_cfg_t rotation; /*!< Default values of the screen rotation (Only HW state. Not supported for default SW rotation!) */
lvgl_port_rounder_cb_t rounder_cb; /*!< Rounder callback for display area */
#if LVGL_VERSION_MAJOR >= 9
lv_color_format_t color_format; /*!< The color format of the display */
#endif
Expand Down
6 changes: 6 additions & 0 deletions components/esp_lvgl_port/src/lvgl9/esp_lvgl_port_disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,12 @@ static void lvgl_port_disp_size_update_callback(lv_event_t *e)

static void lvgl_port_display_invalidate_callback(lv_event_t *e)
{
lvgl_port_display_ctx_t *disp_ctx = (lvgl_port_display_ctx_t *)lv_event_get_user_data(e);
lv_area_t *area = (lv_area_t *)lv_event_get_param(e);
if (area != NULL && disp_ctx != NULL && disp_ctx->rounder_cb != NULL) {
disp_ctx->rounder_cb(area);
}

/* Wake LVGL task, if needed */
lvgl_port_task_wake(LVGL_PORT_EVENT_DISPLAY, NULL);
}