LED Strip (Driver chip WS2812b) API for nRF52840

Hi

I am currently using an nRF52840 SoC and I already have both I2C buses in use, as my application requires multiple I2C sensors with the same address. That means I can't use the SPI peripheral.

However, I also need to control some led strips (ws2812b) in my app. I found here that there are already two APIs to control the led strips using nRF SoCs (one uses SPI and the other uses GPIO). So my question is: can I use the GPIO API or is this just for the nRF51 series? I dug a bit inside the ws2812_gpio.c file inside <drivers/led_strip> and from what I understood this only works for the nRF51 series because this was implemented using hard-code aka using assembly instructions for Cortex-M0  to implement some delays and the nRF52840 use Cortex-M4.

What are my options here? Make my own API using GPIO (with some timers, control the output bits to the GPIO pin) or maybe use an I2C Mux to group all the I2C sensors on the same I2C bus to have the option of using the SPI peripheral and the ws2812_spi.c API?

best regards.

edit: well, I just realize that nRF52840 SoC has 3 SPI peripheral so I can't use the SPI1, SPI2 but can use the SPI3 peripheral right?

Parents Reply Children
No Data
Related