Skip to content

Commit f1311e3

Browse files
adamkaliszanespzav
authored andcommitted
BSP offset
1 parent 85cd1d4 commit f1311e3

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

bsp/esp_bsp_generic/Kconfig

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,25 @@ menu "Board Support Package (generic)"
706706
default 240
707707
help
708708
The height in pixels of the display.
709-
709+
710+
config BSP_DISPLAY_HORIZONTAL_OFFSET
711+
depends on BSP_DISPLAY_ENABLED
712+
int
713+
prompt "Display horizontal offset"
714+
default 0
715+
help
716+
Some displays has offset. First columns and rows are not visible on screen
717+
(specific connection layout between screen and controler).
718+
719+
config BSP_DISPLAY_VERTICAL_OFFSET
720+
depends on BSP_DISPLAY_ENABLED
721+
int
722+
prompt "Display vertical offset"
723+
default 0
724+
help
725+
Some displays has offset. First columns and rows are not visible on screen
726+
(specific connection layout between screen and controler).
727+
710728
config BSP_DISPLAY_BRIGHTNESS_LEDC_CH
711729
depends on BSP_DISPLAY_ENABLED && BSP_DISPLAY_BACKLIGHT_GPIO != -1
712730
int "LEDC channel index for brightness control"

bsp/esp_bsp_generic/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
version: "2.0.0"
2+
version: "2.0.1"
33
description: Generic Board Support Package (BSP)
44
url: https://github.com/espressif/esp-bsp/tree/master/bsp/esp_bsp_generic
55

bsp/esp_bsp_generic/include/bsp/display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
/* Display definition */
3838
#define BSP_LCD_H_RES (CONFIG_BSP_DISPLAY_WIDTH)
3939
#define BSP_LCD_V_RES (CONFIG_BSP_DISPLAY_HEIGHT)
40+
#define BSP_LCD_H_OFFSET (CONFIG_BSP_DISPLAY_HORIZONTAL_OFFSET)
41+
#define BSP_LCD_V_OFFSET (CONFIG_BSP_DISPLAY_VERTICAL_OFFSET)
4042

4143
#ifdef __cplusplus
4244
extern "C" {

bsp/esp_bsp_generic/src/esp_bsp_generic.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,9 @@ static lv_display_t *bsp_display_lcd_init(void)
619619
#endif
620620
}
621621
};
622-
622+
#if BSP_LCD_H_OFFSET || BSP_LCD_V_OFFSET
623+
esp_lcd_panel_set_gap(panel_handle, (BSP_LCD_H_OFFSET), (BSP_LCD_V_OFFSET));
624+
#endif
623625
return lvgl_port_add_disp(&disp_cfg);
624626
}
625627

0 commit comments

Comments
 (0)