On Thu, May 18, 2023 at 9:31 PM Tomek CEDRO wrote: > 2. WS2812 timing pains. I know it is possible to drive WS2812 from > ESP32 because I have done that already on MicroPyhon both with GPIO > bitbang and even better with RMT peripheral that makes it walk in the > park (we can make one for NuttX!!) :-)
Okay, I think I got it better now with you hints guys, thank you! This is my loud learning curve so please remain calm :-P :-P So currently there is a SPI and non-SPI (aka gpio bitnabg) WS2812 driver. GPIO bitbang driver is most generic but uses underlying layers of application -> device_file -> upper_half -> lower_half -> MCU_SDK and that is too slow for most implementations to generate nanosecond pulses. It _may_ work for really fast MCU but it will probably not work for most implementations..? I did not manage to compile code for SPI driver for ESP32 (build error speed unsupported). But it still may work and is quite generic approach on the chips that have SPI peripheral with desired speed support. Yet another approach, that would provide "proven-to-work" trademark , is providing arch/chip specific lower half driver? For instance ESP32 could use RMT peripheral, that would be implemented in arch/chip level for all ESP32 based boards. So verified solution would be using arch/chip code, and user could use SPI or bitbang as alternate fallback that _may_ work if the arch/chip code is not available for a given chip? We would then have kind of compatibility matrix / verified hardware notification at glance :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info