-
Notifications
You must be signed in to change notification settings - Fork 48
rgb_display rotate error #115
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
Comments
Now I now this rotate error is cause by st7701 don't support hardware rotate, it just can be rotated by software. |
I tried to modify flush_cb,but it's still somthing wrong |
The st7701 display DOES support hardware rotation but because we have not gotten the SPI portion of the code working yet you are going to be limited to software rotation. I am working on the software rotation part of the code. LVGL has removed this functionality in version 9.x and I am messing about with working around the problem using a different mechanism. I should have a fix for the software rotation today.... |
I checked the ST7701 manual, and even if the SPI is working properly, there doesn't seem to be any command to rotate the display. It appears that rotation for RGB screens is typically done through software. However, I came up with a good method to achieve rotation using the following two statements. But I don't know how to integrate them into the source code to generate the MicroPython firmware. I hope this can give you an idea.
By combining parameters, it is possible to achieve rotation in four directions. I tested it in ESP-IDF, and it works effectively. |
I have to double check the spec sheet for the display to see if it is able to be done. I know there is the COLMOD command, I am not sure if there is a MADCTL command to handle it. But for the time being I just pushed a commit that will hopefully correct the issue with the software rotation for the RGB displays. |
using the The other thing when dealing with software rotation is it is going to be faster if the bytes are written to the buffer in the correct order instead of having to rearrange them after the fact. That is what I am trying to achieve doing it the way I am in the last commit. Check it out and see if it works. |
I just checked the datasheet for the ST7701S and it in fact DOES support hardware rotation.... check it out https://focuslcds.com/wp-content/uploads/Drivers/ST7701S.pdf#page=214 |
edit that last comment. It supports the command but not setting the bits that allow the rotation to occur. |
|
I think this code it easier. Although it's relatively slow and the frame rate has decreased, it is indeed a feasible method. |
the problem with using that method is if the user changes out the screen for a different one because the rotation will default back to what it was... no one said that software rotation isn't slow. it is very slow. I don't know how LVGL handles rendering a rotated object. If there is a drop in performance then it must be rotating it after it has been rendered and not while it is being rendered. I was hoping it was the latter but it appears not. I can write some C code to handle the rotation and it would be faster than what LVGL does because LVGL's rotation is not written to handle angle changes that are locked to 90° steps. Have you tried the code in the repo? If you have does it work?. I did just update the code again to change the anchor point and to fix a problem I had in it. I also relocated the code to a different location. Give it a try and see if it works. |
give it another try. |
I don't know how to deal with this,still some mistakes.
I change to:
|
I've decided to abandon using software methods to rotate the screen on the ESP32-S3. Even if successful, it would result in a very low frame rate. It seems that the ESP32-S3 is only suitable for RGB screens that don't require rotation. Thank you for your efforts during this time. Below, I'll share the MicroPython method I wrote for implementing 9-bit 3-wire SPI purely through pin control. I hope it can help those in need. https://github.com/jd3096-mpy/micropython-3-wire-spi-soft/ |
hey hey hey chill out there speedy. I am working on some modifications to the driver that will utilize 2 full display frame buffers and a single partial frame buffer. The partial one is what LVGL would fill so when a small update gets made the entire display doesn't have to be redrawn. I am hammering out the code right now for the rotation which will do the rotation and the copy of the partial buffer to one of the full frame buffers. Once the copy is done I will then swap the 2 full frame buffers. If 2 partial updates happen before a full frame buffer is able to be sent that's ok because both partials can be written to the idle frame buffer with no problems. To make this all work properly I have copied the RGB panel code form the ESP-IDF that I am stripping down and modifying to turn it into an actual bus driver instead of a panel driver. I am going to add the needed things that will allow me to keep all the buffers in sync. This will greatly improve the performance when working with RGB displays. |
Rotaion screen by
display.set_rotation(lv.DISPLAY_ROTATION._90)
https://github.com/lvgl-micropython/lvgl_micropython/blob/main/api_drivers/common_api_drivers/display/rgb_display.py
line 17
self._disp_drv.set_orientation(value)
shoule be
self._disp_drv.set_rotation(value)
??I modify and it show like this ,still some mistake:

I test st7796 too, it works good.
By the way,you haven't send me address yet.
The text was updated successfully, but these errors were encountered: