Skip to content

Commit

Permalink
BSP offset
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkaliszan committed Jan 10, 2025
1 parent a9620d5 commit ce52cbb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
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

0 comments on commit ce52cbb

Please sign in to comment.