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

ST7789: Add mirrored display modes to support 2" rounded rectangle TFT LCD display 240*296 pixels #3180

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FedericoBusero
Copy link

@FedericoBusero FedericoBusero commented Feb 19, 2024

This pull request adds support for a new 2" TFT LCD display with a rounded rectangle form factor (240*296 pixels) and ST7789 command set.

The display can be used using following settings:

#define ST7789_DRIVER
#define TFT_HEIGHT 296
#define CGRAM_OFFSET
#define TFT_RGB_ORDER TFT_BGR
#define TFT_INVERSION_OFF
#define SPI_FREQUENCY  80000000

However, the image is mirrored and in some rotations, there is a 24-pixel offset. This pull request addresses these issues by adding support for four additional rotations (4-7) to the ST7789 driver to enable mirroring. In case CGRAM_OFFSET is defined and the height equals 296 pixels, the offset is set when the display is in a mirrored rotation mode.

An alternative implementation for the mirror issue could be the introduction of a define ST7789_MIRROR similar to M5STACK. Please indicate which solution is preferred.

Copy link

@cheops cheops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this change with a screen like this
works ok for me

Copy link

@cheops cheops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this change with a screen like this
works ok for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants