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

How make rotation screen (Set portrait orientation) Driver ILI9488 #82

Closed
Djaison opened this issue Mar 17, 2020 · 10 comments
Closed

How make rotation screen (Set portrait orientation) Driver ILI9488 #82

Djaison opened this issue Mar 17, 2020 · 10 comments
Labels
stale This will not be worked on

Comments

@Djaison
Copy link

Djaison commented Mar 17, 2020

ESP-IDF version
last master

Development kit used
ESP-WROOM32

Development machine OS
Windows 10

Hello! How can I rotate the screen? I need to set portrait orientation.
I use display with driver ILI9488.

As I understand it, I need to change the starting coordinates of the rendering in the file ili9488.c :

`/* Column addresses */
uint8_t xb[] = {
(uint8_t) (area->x1 >> 8) & 0xFF,
(uint8_t) (area->x1) & 0xFF,
(uint8_t) (area->x2 >> 8) & 0xFF,
(uint8_t) (area->x2) & 0xFF,
};

/* Page addresses  */
uint8_t yb[] = {
    (uint8_t) (area->y1 >> 8) & 0xFF,
    (uint8_t) (area->y1) & 0xFF,
    (uint8_t) (area->y2 >> 8) & 0xFF,
    (uint8_t) (area->y2) & 0xFF,
};`

photo_2020-03-17_12-14-27

@Djaison
Copy link
Author

Djaison commented Mar 17, 2020

I made corrections to the void ili9488_init (void) function in the ili9488.с file, {ILI9488_CMD_MEMORY_ACCESS_CONTROL, {(0x20 | 0x08)}, 1}
I changed it to
{ILI9488_CMD_MEMORY_ACCESS_CONTROL, {0x48}, 1},

I think you can add this option to menuconfig

@C47D
Copy link
Collaborator

C47D commented Mar 17, 2020

Hi @Djaison,

Can you try swapping the values on this config?
lvgl_display_size

If that doesn't work i can add an option to the menuconfig as you've suggested.

Offtopic: Your interface looks really cool :)

@Djaison
Copy link
Author

Djaison commented Mar 17, 2020

If that doesn't work i can add an option to the menuconfig as you've suggested.

it does not work :)

now it looks like this

1584452436019

@C47D
Copy link
Collaborator

C47D commented Mar 17, 2020

Ok, I will try to add an option to set the display on portrait mode from the menuconfig, but it will be later today.

@an-erd
Copy link
Contributor

an-erd commented Mar 17, 2020

It would be good to add this option for the ILI9341, too. I just worked on this today and found that for the M5Stack Fire in the file externals\lv_port_esp32\components\lvgl_esp32_drivers\lvgl_tft\ili9341.c writing 0x08 (instead of 0x68) to 0x36 worked for me. With this the display shows in landscape, with the buttons on the bottom. I used this code:

#if ILI9341_INVERT_DISPLAY
uint8_t data[] = {0x08};
// this same command also sets rotation (portrait/landscape) and inverts colors.
// https://gist.github.com/motters/38a26a66020f674b6389063932048e4c#file-ili9844_defines-h-L24
ili9341_send_cmd(0x36);
ili9341_send_data(&data, 1);
#endif

Value taken from ILI9341 datasheet, section 8.2.29. Memory Access Control (36h). Also height and width must be swapped, too. I did it like this in file externals\lv_port_esp32\components\lvgl\lv_conf.h

#define LV_HOR_RES_MAX (CONFIG_LVGL_DISPLAY_HEIGHT)
#define LV_VER_RES_MAX (CONFIG_LVGL_DISPLAY_WIDTH)

@C47D
Copy link
Collaborator

C47D commented Mar 17, 2020

It would be good to add this option for the ILI9341, too.

Sure, I will add it later today, I'm at work right now.

@Djaison
Copy link
Author

Djaison commented Mar 19, 2020

I was able to configure the touch to the portrait orientation should also change the default settings in menuconfig, the operating settings such:
22

Result ;-)

ezgif com-video-to-gif

P.S. Touch driver is a FT6236

@C47D
Copy link
Collaborator

C47D commented Mar 19, 2020

It looks really nice :)

I was able to configure the touch to the portrait orientation should also change the default settings in menuconfig, the operating settings such

We can add a note for that on the README, I don't know if it can be done automagically based on the display orientation.

@Djaison
Copy link
Author

Djaison commented Mar 19, 2020

it can be added to menuсonfig as a function of the orientation of the display, and later I will be able to provide it after checking

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

stale bot commented Apr 9, 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 9, 2020
@stale stale bot closed this as completed Apr 17, 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

3 participants