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

Set rotation of display on menuconfig #88

Closed
C47D opened this issue Mar 24, 2020 · 15 comments
Closed

Set rotation of display on menuconfig #88

C47D opened this issue Mar 24, 2020 · 15 comments
Labels
stale This will not be worked on

Comments

@C47D
Copy link
Collaborator

C47D commented Mar 24, 2020

The rotation of the display should be available for all supported displays.

@C47D C47D mentioned this issue Apr 5, 2020
4 tasks
@stale
Copy link

stale bot commented Apr 14, 2020

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Apr 14, 2020
@C47D
Copy link
Collaborator Author

C47D commented Apr 14, 2020

Supported in ILI9341 and ST7789 so far.

@stale stale bot removed the stale This will not be worked on label Apr 14, 2020
@BFFonseca
Copy link

Hello.
Is there any way to set the rotation to 180º or 270º? This would be a good feature on menuconfig.

My display is upside down
photo_2020-05-04_12-13-44

Sorry if this isn't the right place to ask.

@C47D
Copy link
Collaborator Author

C47D commented May 4, 2020

@BFFonseca Hi, is that an ILI9341 based display?

@BFFonseca
Copy link

@BFFonseca Hi, is that an ILI9341 based display?

Yes! It is an ILI931 320x240 with an XPT2046.

I was able to rotate the screen by hardcoding on the ili_init_cmds[] structure's 0x36 command with a value of 0xE8, like so:
rotation_fix_hardcoded

@BFFonseca
Copy link

I am guessing this is not a very clean way to do it, but it was the only fix I could find.
I've started working on this lib only a couple days ago.
Would be nice if there was a way of getting the 4 possible rotations (0º, 90º, 180º and 270º) on the menuconfig.

@C47D
Copy link
Collaborator Author

C47D commented May 4, 2020

Don't worry, I just turned on my PC, I will let you know when I add the options to the menuconfig.

@BFFonseca
Copy link

Don't worry, I just turned on my PC, I will let you know when I add the options to the menuconfig.

Alright, looking forward to it.

By the way, I based myself on this library that I used in Arduino before: https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_Drivers/ILI9341_Rotation.h

@C47D
Copy link
Collaborator Author

C47D commented May 5, 2020

Thanks for the link I will check it. I'm pushing my changes here: https://github.com/littlevgl/lv_port_esp32/tree/ili9341_rotation

Problem is the four orientations seems to work on the Wrover Kit v4.1 (it have an embedded display with the same ILI9341 controller), but only landscape mode works on the display with the separated ILI9341 controller (like yours).

@C47D
Copy link
Collaborator Author

C47D commented May 6, 2020

@BFFonseca Hi, i think i found the root issue, commit d6f6e18 on the ili9341_rotation branch seems to fix all 4 rotations, can you test that branch and let me know if it works for you?

I've tested it locally but is better if you can test it as well.

@BFFonseca
Copy link

I can confirm it's fixed!
All 4 rotations and the touch work fine.
Touch coordinate are switched up, but that's to be expected.

Thank you! Excellent work.

Portrait:
portrait

Portrait Inverted:
portrait_inverted

Landscape:
landscape

Landscape Inverted:
landscape_inverted

Suggestion for future implementation: Auto-rotate the touch coordinated based on screen rotation.

@C47D
Copy link
Collaborator Author

C47D commented May 6, 2020

Thanks for testing it @BFFonseca :) , I think you can swap X and Y coordinates on the touch menu. I didn't tested it.

Sure, we could try to make the coordinate swap automagically, based on the rotation, let's leave that for another time.

EDIT
Can I use your pictures in case of adding them to the README?

@BFFonseca
Copy link

@C47D no problem. Was a feature I needed, so thank you!

Yes, that is what I did, and it's not hard to do anyway. I would be a nice to have feature, but indeed not a priority.

Yes, you can use my pictures on the README :)

@stale
Copy link

stale bot commented Jun 2, 2020

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Jun 2, 2020
@C47D
Copy link
Collaborator Author

C47D commented Jun 4, 2020

All displays with rotation support are currently available in the menuconfig.

@C47D C47D closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants