6699d4d4f9
Add driver that based on RPI-PICO's PIO feature for ws2812. This driver can handle WS2812 or compatible LED strips. The single PIO node can handle up to 4 strips. Any pins that can be configured for PIO can be used for strips. I verified the samples/driver/led_ws2812 sample working with WS2812(144 pcs) led strip using following patches. - samples/drivers/led_ws2812/boards/rpi_pico.overlay ``` / { aliases { led-strip = &ws2812; }; }; &pinctrl { ws2812_pio0_default: ws2812_pio0_default { ws2812 { pinmux = <PIO0_P21>; }; }; }; &pio0 { status = "okay"; pio-ws2812 { compatible = "worldsemi,ws2812-rpi_pico-pio"; status = "okay"; pinctrl-0 = <&ws2812_pio0_default>; pinctrl-names = "default"; bit-waveform = <3>, <3>, <4>; ws2812: ws2812 { status = "okay"; output-pin = <21>; chain-length = <144>; color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>; reset-delay = <280>; frequency = <800000>; }; }; }; ``` - samples/drivers/led_ws2812/boards/rpi_pico.conf ``` CONFIG_WS2812_STRIP_RPI_PICO_PIO=y ``` Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
57 lines
1.6 KiB
Plaintext
57 lines
1.6 KiB
Plaintext
# Copyright (c) 2017 Linaro Limited
|
|
# Copyright (c) 2019 Nordic Semiconductor ASA
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# The following blog post is an excellent resource about pulse timing:
|
|
#
|
|
# https://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/
|
|
|
|
menuconfig WS2812_STRIP
|
|
bool "WS2812 (and compatible) LED strip driver"
|
|
help
|
|
Enable LED strip driver for daisy chains of WS2812-ish (or WS2812B,
|
|
WS2813, SK6812, Everlight B1414, or compatible) devices.
|
|
|
|
choice WS2812_STRIP_DRIVER
|
|
prompt "Driver backend"
|
|
default WS2812_STRIP_SPI
|
|
depends on WS2812_STRIP
|
|
|
|
config WS2812_STRIP_SPI
|
|
bool "SPI driver"
|
|
depends on SPI
|
|
help
|
|
The SPI driver is portable, but requires significantly more
|
|
memory (1 byte of overhead per bit of pixel data).
|
|
|
|
config WS2812_STRIP_I2S
|
|
bool "I2S driver"
|
|
depends on I2S
|
|
help
|
|
Uses the I2S peripheral, memory usage is 4 bytes per color,
|
|
times the number of pixels. A few more for the start and end
|
|
delay. The reset delay has a coarse resolution of ~20us.
|
|
|
|
config WS2812_STRIP_GPIO
|
|
bool "GPIO driver"
|
|
# Only an Cortex-M0 inline assembly implementation for the nRF51
|
|
# is supported currently.
|
|
depends on SOC_SERIES_NRF51X
|
|
select LED_STRIP_RGB_SCRATCH
|
|
help
|
|
The GPIO driver does bit-banging with inline assembly,
|
|
and is not available on all SoCs.
|
|
|
|
Note that this driver is not compatible with the Everlight B1414
|
|
controller.
|
|
|
|
config WS2812_STRIP_RPI_PICO_PIO
|
|
bool "Raspberry Pi Pico PIO"
|
|
depends on DT_HAS_WORLDSEMI_WS2812_RPI_PICO_PIO_ENABLED
|
|
select PICOSDK_USE_PIO
|
|
help
|
|
Use the PIO feature available on RaspberryPi Pico devices.
|
|
|
|
endchoice
|