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

stm32f4 ili9486 finally works but sum confusion #15

Open
bm16ton opened this issue Nov 14, 2022 · 2 comments
Open

stm32f4 ili9486 finally works but sum confusion #15

bm16ton opened this issue Nov 14, 2022 · 2 comments

Comments

@bm16ton
Copy link

bm16ton commented Nov 14, 2022

Hello,
I have a ili9486 rasp pi tft with the spi shifter (I know you lament releasing the schematics to make that possible but I love mine THANK YOU!) I kept having the issues of everything coming from gud/usb being rotated by 180 degrees and colors being sorta inverted. Im all arm64 these days so I thought maybe it was an endian problem. I added __builtin_bswap16 and it fixed everything! But when i finally was able to test on x86 it had exact same problems and needed the same bswap fix. So now im convinced I did something else wrong and this is hackishly getting around it. Didnt know but maybe a common thing?
One last question on the ili9486 with spi shifter subject. I see from your code comments and replies to issues that sum data needs to be sent 16bit and sum 8bit. Unfortunately im to new to firmly grasp the wording. Does that mean the displays you worked on didnt need all data sent as 16bit with the 8bit data being padded? I have to send everything 16bit with all 8 bit values padded (hope im using "padded" correctly here, i mean i use "foo >> 8" on everything 8bit) Because my screen definitely needs everything that way, but possibly those 8bit values are still called 8bit after being padded. Im just not sure how the wording/naming works here.
Again thank you this has been a lot of fun for me. I would offer a pr to the libopencm3 variants but im afraid my code is extremely hackish, ugly, and just plane bad (tho it works).

@notro
Copy link
Owner

notro commented Nov 17, 2022

What do mean by rotated, the whole frame?

Pixel data coming from the host is in little endian format, so it depends on what you do with it. I assume your microcontroller is little endian as well so it should just work. If you configure the SPI controller for 8-bit width, you'll get into trouble however since the bus will put out the individual bytes one by one resulting in big endian order.

As for the shifting and padding it's a long time since I looked at that, but I think the 8-bit commands and 8-bit command data needs to be padded to 16-bit, but pixel data is already 16-bit so needs no padding.

@bm16ton
Copy link
Author

bm16ton commented Nov 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants