diff --git a/bsp/esp_bsp_generic/Kconfig b/bsp/esp_bsp_generic/Kconfig index 16146a84..9307918c 100644 --- a/bsp/esp_bsp_generic/Kconfig +++ b/bsp/esp_bsp_generic/Kconfig @@ -700,7 +700,25 @@ menu "Board Support Package (generic)" default 240 help The height in pixels of the display. - + + config BSP_DISPLAY_HORIZONTAL_OFFSET + depends on BSP_DISPLAY_ENABLED + int + prompt "Display horizontal offset" + default 0 + help + Some displays has offset. First columns and rows are not visible on screen + (specific connection layout between screen and controler). + + config BSP_DISPLAY_VERTICAL_OFFSET + depends on BSP_DISPLAY_ENABLED + int + prompt "Display vertical offset" + default 0 + help + Some displays has offset. First columns and rows are not visible on screen + (specific connection layout between screen and controler). + config BSP_DISPLAY_BRIGHTNESS_LEDC_CH depends on BSP_DISPLAY_ENABLED && BSP_DISPLAY_BACKLIGHT_GPIO != -1 int "LEDC channel index for brightness control" diff --git a/bsp/esp_bsp_generic/idf_component.yml b/bsp/esp_bsp_generic/idf_component.yml index 03e17c6b..5ac0ef2c 100644 --- a/bsp/esp_bsp_generic/idf_component.yml +++ b/bsp/esp_bsp_generic/idf_component.yml @@ -1,5 +1,5 @@ -version: "2.0.0" +version: "2.0.1" description: Generic Board Support Package (BSP) url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp_bsp_generic diff --git a/bsp/esp_bsp_generic/include/bsp/display.h b/bsp/esp_bsp_generic/include/bsp/display.h index 8fdf13c3..72bb19f9 100644 --- a/bsp/esp_bsp_generic/include/bsp/display.h +++ b/bsp/esp_bsp_generic/include/bsp/display.h @@ -37,6 +37,8 @@ /* Display definition */ #define BSP_LCD_H_RES (CONFIG_BSP_DISPLAY_WIDTH) #define BSP_LCD_V_RES (CONFIG_BSP_DISPLAY_HEIGHT) +#define BSP_LCD_H_OFFSET (CONFIG_BSP_DISPLAY_HORIZONTAL_OFFSET) +#define BSP_LCD_V_OFFSET (CONFIG_BSP_DISPLAY_VERTICAL_OFFSET) #ifdef __cplusplus extern "C" { diff --git a/bsp/esp_bsp_generic/src/esp_bsp_generic.c b/bsp/esp_bsp_generic/src/esp_bsp_generic.c index 50d464a8..017bc5db 100644 --- a/bsp/esp_bsp_generic/src/esp_bsp_generic.c +++ b/bsp/esp_bsp_generic/src/esp_bsp_generic.c @@ -616,7 +616,9 @@ static lv_display_t *bsp_display_lcd_init(void) #endif } }; - +#if BSP_LCD_H_OFFSET || BSP_LCD_V_OFFSET + esp_lcd_panel_set_gap(panel_handle, (BSP_LCD_H_OFFSET), (BSP_LCD_V_OFFSET)); +#endif return lvgl_port_add_disp(&disp_cfg); }