Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSP LCD display offset (BSP-611) #473

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
20 changes: 19 additions & 1 deletion bsp/esp_bsp_generic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bsp/esp_bsp_generic/idf_component.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions bsp/esp_bsp_generic/include/bsp/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
4 changes: 3 additions & 1 deletion bsp/esp_bsp_generic/src/esp_bsp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading