nopnop2002 / esp-idf-ili9340

SPI TFT and XPT2046 touch screen controller driver for esp-idf
MIT License
163 stars 34 forks source link

display is mirrored #42

Closed Matheus-Korth closed 1 year ago

Matheus-Korth commented 1 year ago

WhatsApp Image 2022-11-23 at 08 47 30 WhatsApp Image 2022-11-23 at 08 47 29 (1) WhatsApp Image 2022-11-23 at 08 47 29 (2) WhatsApp Image 2022-11-23 at 08 47 29

Matheus-Korth commented 1 year ago

I managed to solve my problem

At startup I used the command "Memory Access Control " page 84

image

On page 201 of the data sheet you will find the possible cases of inversion or mirroring, in my case this one

image

So all I did was replace MY MX MV parameters to 0 0 1, after that I just invert width by height

If anyone has the same problem as me, you can replace this parameter to 0x20 https://github.com/nopnop2002/esp-idf-ili9340/blob/ca910910ea37e38809f9820ee0a23417cc0e61b0/main/ili9340.c#L370

Here is the datasheet datasheet.pdf

WhatsApp Image 2022-11-23 at 14 40 04 (1) WhatsApp Image 2022-11-23 at 14 40 04 WhatsApp Image 2022-11-23 at 14 40 05 (1) WhatsApp Image 2022-11-23 at 14 40 05