-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Support for ESP32-S3 peripherals #605
Comments
Thanks for suggestion and pointers. |
If I understand the adafruit infos correctly, the LCD driver unit is basically an evolution of the esp32 "secret I2S feature" to drive 8x/16x parallel outputs? So it might be possible to get up to 16 parallel led outputs on -S3 from the lcd unit? |
@softhack007 Yes, this is my understanding. BUT it seems they wrapped the details into a driver model that only exposes LCD API rather than a data API. When I get bits of time I am still investigating, and it is helpful if others come upon details to link them here for me to review. Searching seems to be like finding a needle in a haystack. |
@Makuna I'd like to dig into this, based on the parallel LCD support for FastLED here https://github.com/hpwit/I2SClockLessLedDriveresp32s3 Do you have any advice on how you would approach this? |
That example implementation is a good reference, and I found the adafruit one to be a bit more readable: https://github.com/adafruit/Adafruit_NeoPXL8/blob/master/Adafruit_NeoPXL8.cpp (Note that there are multiple implementations there for multiple microcontrollers). I wrote a driver using the adafruit code as reference for the LCD peripheral, FastLED code for the transpose logic, and custom color order and gamma tables: https://github.com/chroma-tech/micropython/blob/fern/ports/esp32/usermodules/modcanopy/driver.h (You wouldn't need to deal with the color order and gamma stuff if porting to NPB) |
Review the CoreShaderBeta or work within that branch, as that is going to be next major release and some of this has changed. NPB does color order, luminance, and gamma at a higher level, so the methods are just about getting the bits out. |
I've managed to implement code for my specific use-case: S3 using the LCD peripheral to drive 8 parallel WS2812x strips with WLED. |
@coliniuliano Thanks! I will take a look at the PR as soon as I can, but don't expect it this week. |
@coliniuliano Good work on the PR. Let me know if you can (willing) to apply the requested changes. Alternately I can provide a branch (for the changes to master) that you can provide the pull to, and I will merge and fixup before merging into main. |
Just an update. There is a branch that takes Colin changes but there are some things that still need to be cleaned up.
|
Optimizations checked into the Esp32S3Led branch. This current work is based on a 3 step cadence (1/3, 2/3 pulse ratio timing). While this uses less memory, it also slows down processing time since it requires byte level access to data. The I2s Parallel uses a 4 step cadence (1/4, 3/4 pulse ratio timing) so everything is word aligned, and native element size is used to copy/clear (faster). I am leaving this as a 3 step as memory seems to be a bigger problem with parallel than speed. It does raise another memory optimization option that could be done to the i2s parallel. |
Merged in, with example. |
@Makuna Sorry for leaving this half finished and thank you so much for driving it home! |
There is already support for RMT and SPI on ESP32-S3 and it would be great to take it a few steps further:
DotStarEsp32DmaSpiMethod
ESP32-S3 support includes SPI2 with up to 4 bit transfers, and doesn't support SPI3Related to #598 and #559
The text was updated successfully, but these errors were encountered: