Skip to content

st7735s add CONFIG_LV_TFT_DISPLAY_OFFSETS #205

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

Open
wants to merge 1 commit 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
3 changes: 3 additions & 0 deletions lvgl_tft/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,15 @@ menu "LVGL TFT Display controller"
int "X offset"
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_LANDSCAPE || LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_PORTRAIT || LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 26 if LV_TFT_DISPLAY_USER_CONTROLLER_ST7735S
default 0

config LV_TFT_DISPLAY_Y_OFFSET
depends on LV_TFT_DISPLAY_OFFSETS
int "Y offset"
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_LANDSCAPE || LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_PORTRAIT || LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 1 if LV_TFT_DISPLAY_USER_CONTROLLER_ST7735S
default 0


Expand Down Expand Up @@ -303,6 +305,7 @@ menu "LVGL TFT Display controller"
bool "ST7735S"
select LV_TFT_DISPLAY_CONTROLLER_ST7735S
select LV_TFT_DISPLAY_PROTOCOL_SPI
select LV_TFT_DISPLAY_OFFSETS
config LV_TFT_DISPLAY_USER_CONTROLLER_HX8357
bool "HX8357"
select LV_TFT_DISPLAY_CONTROLLER_HX8357
Expand Down
6 changes: 4 additions & 2 deletions lvgl_tft/st7735s.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ extern "C" {
// https://github.com/adafruit/Adafruit-ST7735-Library
//
#define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 / 1 offset)
#define COLSTART 26
#define ROWSTART 1
#if (CONFIG_LV_TFT_DISPLAY_OFFSETS)
#define COLSTART CONFIG_LV_TFT_DISPLAY_X_OFFSET
#define ROWSTART CONFIG_LV_TFT_DISPLAY_Y_OFFSET
#endif

// Delay between some initialisation commands
#define TFT_INIT_DELAY 0x80
Expand Down