2017-10-16 23:28:15 -04:00
|
|
|
# Copyright (c) 2017 Linaro Limited
|
2019-11-06 09:28:54 -08:00
|
|
|
# Copyright (c) 2019 Nordic Semiconductor ASA
|
|
|
|
#
|
2017-10-16 23:28:15 -04:00
|
|
|
# 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/
|
|
|
|
|
2019-11-06 09:28:54 -08:00
|
|
|
config WS2812_STRIP_SPI
|
2024-03-12 09:37:33 +09:00
|
|
|
bool "WS2812 LED strip SPI driver"
|
|
|
|
default y
|
|
|
|
depends on DT_HAS_WORLDSEMI_WS2812_SPI_ENABLED
|
2024-03-09 21:50:36 +09:00
|
|
|
select SPI if $(dt_compat_on_bus,$(DT_COMPAT_WORLDSEMI_WS2812_SPI),spi)
|
2017-10-16 23:28:15 -04:00
|
|
|
help
|
2024-03-12 09:37:33 +09:00
|
|
|
Enable driver for WS2812 (and compatibles) LED strip using SPI.
|
2019-11-06 09:28:54 -08:00
|
|
|
The SPI driver is portable, but requires significantly more
|
|
|
|
memory (1 byte of overhead per bit of pixel data).
|
2017-10-16 23:28:15 -04:00
|
|
|
|
2022-11-07 21:42:43 +01:00
|
|
|
config WS2812_STRIP_I2S
|
2024-03-12 09:37:33 +09:00
|
|
|
bool "WS2812 LED strip I2S driver"
|
|
|
|
default y
|
|
|
|
depends on DT_HAS_WORLDSEMI_WS2812_I2S_ENABLED
|
2024-03-09 21:50:36 +09:00
|
|
|
select I2S if $(dt_compat_on_bus,$(DT_COMPAT_WORLDSEMI_WS2812_I2S),i2s)
|
2022-11-07 21:42:43 +01:00
|
|
|
help
|
2024-03-12 09:37:33 +09:00
|
|
|
Enable driver for WS2812 (and compatibles) LED strip using I2S.
|
2022-11-07 21:42:43 +01:00
|
|
|
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.
|
|
|
|
|
2019-11-06 09:28:54 -08:00
|
|
|
config WS2812_STRIP_GPIO
|
2024-03-12 09:37:33 +09:00
|
|
|
bool "WS2812 LED strip GPIO driver"
|
2024-04-28 13:27:44 +02:00
|
|
|
# Only an Cortex-M inline assembly implementation for the nRF91, nRF51,
|
|
|
|
# nRF52 and nRF53 is supported currently.
|
2024-03-12 09:37:33 +09:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_WORLDSEMI_WS2812_GPIO_ENABLED
|
2024-04-28 13:27:44 +02:00
|
|
|
depends on (SOC_SERIES_NRF91X || SOC_SERIES_NRF51X || SOC_SERIES_NRF52X || SOC_SERIES_NRF53X)
|
2023-10-28 18:55:41 +01:00
|
|
|
select LED_STRIP_RGB_SCRATCH
|
2017-10-16 23:28:15 -04:00
|
|
|
help
|
2024-04-28 13:27:44 +02:00
|
|
|
Enable driver for WS2812 (and compatibles) LED strip directly
|
|
|
|
controlling with GPIO. The GPIO driver does bit-banging with inline
|
|
|
|
assembly, and is not available on all SoCs.
|
2017-10-16 23:28:15 -04:00
|
|
|
|
2021-05-19 12:19:38 +02:00
|
|
|
Note that this driver is not compatible with the Everlight B1414
|
|
|
|
controller.
|
|
|
|
|
2024-04-28 13:27:44 +02:00
|
|
|
if WS2812_STRIP_GPIO
|
|
|
|
|
|
|
|
DT_CHOSEN_LED_STRIP := zephyr,led-strip
|
|
|
|
DT_CHOSEN_LED_STRIP_PATH := $(dt_chosen_path,$(DT_CHOSEN_LED_STRIP))
|
|
|
|
|
|
|
|
config DELAY_T1H
|
|
|
|
int "Delay 1 bit high pulse"
|
|
|
|
default $(dt_node_int_prop_int,$(DT_CHOSEN_LED_STRIP_PATH),delay-t1h) \
|
|
|
|
if $(dt_node_has_prop,$(DT_CHOSEN_LED_STRIP_PATH),delay-t1h)
|
|
|
|
default $(div,$(mul,700,$(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)),1000000000) \
|
|
|
|
if $(dt_node_has_prop,/cpus/cpu@0,clock-frequency)
|
|
|
|
default 7
|
|
|
|
help
|
|
|
|
Number of NOP assembly operations to create a delay for a 1 bit, high voltage period (default 700 nsec)
|
|
|
|
|
|
|
|
config DELAY_T1L
|
|
|
|
int "Delay 1 bit low pulse"
|
|
|
|
default $(dt_node_int_prop_int,$(DT_CHOSEN_LED_STRIP_PATH),delay-t1l) \
|
|
|
|
if $(dt_node_has_prop,$(DT_CHOSEN_LED_STRIP_PATH),delay-t1l)
|
|
|
|
default $(div,$(mul,600,$(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)),1000000000) \
|
|
|
|
if $(dt_node_has_prop,/cpus/cpu@0,clock-frequency)
|
|
|
|
default 6
|
|
|
|
help
|
|
|
|
Number of NOP assembly operations to create a delay for a 1 bit, low voltage period (default 600 nsec)
|
|
|
|
|
|
|
|
config DELAY_T0H
|
|
|
|
int "Delay 0 bit high pulse"
|
|
|
|
default $(dt_node_int_prop_int,$(DT_CHOSEN_LED_STRIP_PATH),delay-t0h) \
|
|
|
|
if $(dt_node_has_prop,$(DT_CHOSEN_LED_STRIP_PATH),delay-t0h)
|
|
|
|
default $(div,$(mul,350,$(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)),1000000000) \
|
|
|
|
if $(dt_node_has_prop,/cpus/cpu@0,clock-frequency)
|
|
|
|
default 3
|
|
|
|
help
|
|
|
|
Number of NOP assembly operations to create a delay for a 0 bit, high voltage period (default 350 nsec)
|
|
|
|
|
|
|
|
config DELAY_T0L
|
|
|
|
int "Delay 0 bit low pulse"
|
|
|
|
default $(dt_node_int_prop_int,$(DT_CHOSEN_LED_STRIP_PATH),delay-t0l) \
|
|
|
|
if $(dt_node_has_prop,$(DT_CHOSEN_LED_STRIP_PATH),delay-t0l)
|
|
|
|
default $(div,$(mul,800,$(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)),1000000000) \
|
|
|
|
if $(dt_node_has_prop,/cpus/cpu@0,clock-frequency)
|
|
|
|
default 8
|
|
|
|
help
|
|
|
|
Number of NOP assembly operations to create a delay for a 0 bit, low voltage period (default 800 nsec)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2023-02-25 09:00:59 +09:00
|
|
|
config WS2812_STRIP_RPI_PICO_PIO
|
2024-03-12 09:37:33 +09:00
|
|
|
bool "WS2812 LED strip Raspberry Pi Pico PIO driver"
|
|
|
|
default y
|
2023-02-25 09:00:59 +09:00
|
|
|
depends on DT_HAS_WORLDSEMI_WS2812_RPI_PICO_PIO_ENABLED
|
|
|
|
select PICOSDK_USE_PIO
|
|
|
|
help
|
2024-03-12 09:37:33 +09:00
|
|
|
Enable driver for WS2812 (and compatibles) LED strip using
|
2025-03-30 22:25:21 +01:00
|
|
|
the Raspberry Pi Pico's PIO.
|