Rotate display on Sunton ESP32 2432S028#9340
Conversation
|
@tannewt Please let me know if there are any concerns with this PR. |
|
Thank you! |
|
@occasional-contributor Let me know if you have a discord handle, I'd rather talk there than a closed issue :/ Is there any chance you could post the identifying string from the back side of your board? After applying this PR, my display is rotated 270 degrees in a portrait mode, just like your "Before" photo so it appears our two devices have different rotation requirements. If the ID on your board is the same as mine, I'll just submit a PR that adds a comment to the board.c file indicating that rotation variable may need to be modified and a custom firmware built depending on how the particular board was designed. @SeanTheITGuy FYI... |
|
@RetiredWizard That's mildly infuriating. I will post a pic of the backside when I'm home. I was on Discord, once upon a time. Then I went on an IM/social media detox trip. I am using my board with stock xtouch firmware, and there are no rotation issues there. So it may be your unit that's a bit different. |
|
The difference I see is that the original one I configured only has the one
usb port and this one, with the same model number, has both micro and type
c, and also a differently configured LCD, apparently.
…On Wed, Aug 28, 2024, 7:35 p.m. Occasional Contributor < ***@***.***> wrote:
PXL_20240828_223158275.2.jpg (view on web)
<https://github.com/user-attachments/assets/f29d5b7c-f6b1-4e3f-9a91-add8185cd312>
—
Reply to this email directly, view it on GitHub
<#9340 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4JCGZZBLPL6ZPW6U5RUSDZTZGCVAVCNFSM6AAAAABJMDDDBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWGM2TONRTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I suggest we create two different boards. I am not sure if more variants exist and/or how to tell them apart without visual inspection. |
|
There are so many versions of this board on AliExpress. There's no way to identify the display driver chip, is there? |
|
I don't think it's worth trying to set up different firmware variants for these CYD boards that have the same silk screened model number. They appear to be cloned left and right and who knows what other differences may show up. The screen orientation can probably be dealt with in software by releasing the board.DISPLAY object and re-initializing the display with the proper rotation. |
|
Is it possible to add a display rotation property to |
I suspect settings.toml is read prior to the execution of board.c (I'm not sure though). Even if it is, it's probably not worth adding the additional code (firmware space) to the core to carry a parameter forward to support screen rotation options. That being said, it is possible to rotate the screen after the board boots with the following code.py: import displayio
import board
import fourwire
import adafruit_ili9341
import digitalio
displayio.release_displays()
spi = board.LCD_SPI()
disp_bus = fourwire.FourWire(spi,command=board.LCD_DC,chip_select=board.LCD_CS)
display=adafruit_ili9341.ILI9341(disp_bus,width=320,height=240)
bl = digitalio.DigitalInOut(board.LCD_BCKL)
bl.direction = digitalio.Direction.OUTPUT
bl.value=1One thing to note, is that with the merging of this PR, the default rotation of the display is not the same as that used by the adafruit_ili9341 library. |
|
The settings.toml is read every time you access a variable defined in it, so I think there should be no problem getting it in board.c. I have done a similar thing on my PewPew M4 boards that can use displays with different initialization requirements, but in their case the display parameter is stored in the UF2 bootloader: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/pewpew_m4/board.c#L93-L95 |


The display is 240w x 320h. We could swap the width and height, or rotate it by 270 degrees.
Before
After