Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions drivers/led_strip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources_ifdef(CONFIG_LPD880X_STRIP lpd880x.c)
zephyr_sources_ifdef(CONFIG_WS2812_STRIP ws2812.c)
zephyr_sources_ifdef(CONFIG_WS2812B_SW ws2812b_sw.c)
zephyr_sources_ifdef(CONFIG_APA102_STRIP apa102.c)
zephyr_sources_ifdef(CONFIG_LPD880X_STRIP lpd880x.c)
zephyr_sources_ifdef(CONFIG_WS2812_STRIP_SPI ws2812_spi.c)
zephyr_sources_ifdef(CONFIG_WS2812_STRIP_GPIO ws2812_gpio.c)
zephyr_sources_ifdef(CONFIG_APA102_STRIP apa102.c)
2 changes: 0 additions & 2 deletions drivers/led_strip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ source "drivers/led_strip/Kconfig.lpd880x"

source "drivers/led_strip/Kconfig.ws2812"

source "drivers/led_strip/Kconfig.ws2812b_sw"

source "drivers/led_strip/Kconfig.apa102"

endif # LED_STRIP
98 changes: 20 additions & 78 deletions drivers/led_strip/Kconfig.ws2812
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 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:
Expand All @@ -7,93 +9,33 @@

menuconfig WS2812_STRIP
bool "Enable WS2812 (and compatible) LED strip driver"
depends on SPI
select LED_STRIP_RGB_SCRATCH
help
Enable LED strip driver for daisy chains of WS2812-ish
(or WS2812B, WS2813, SK6812, or compatible) devices.
These devices have a one-wire communications interface
which encodes bits using pulses. Short pulses indicate
zero bits, and long pulses indicate ones; refer to the
chip datasheets for precise specifications. To implement
this in a multitasking operating system, this driver
generates the pulses using a SPI peripheral.

if WS2812_STRIP

config WS2812_STRIP_MAX_PIXELS
int "Maximum number of pixels in a strip"
default 12
help
Set this to the maximum number of pixels you need
to control at once. There is an 8x memory penalty associated
with each increment of this value, so it's worth optimizing.

config WS2812_STRIP_ONE_FRAME
hex "SPI frame to shift out to signal a one bit"
default 0x7c if SOC_SERIES_STM32F4X
default 0x70 if SOC_FAMILY_NRF
help
When shifted out at the configured clock frequency,
this must generate a pulse whose width fits within the chipset
specifications for T1H, and whose interpulse timing meets low
times. It is recommended that the first and last bits in the
frame be zero; this "encourages" SPI IPs to leave MOSI low
between frames.

config WS2812_STRIP_ZERO_FRAME
hex "SPI frame to shift out to signal a zero bit"
default 0x60 if SOC_SERIES_STM32F4X
default 0x40 if SOC_FAMILY_NRF
help
When shifted out at the configured clock frequency,
this must generate a pulse whose width fits within the chipset
specifications for T0H, and whose interpulse timing meets low
times. It is recommended that the first and last bits in the
frame be zero; this "encourages" SPI IPs to leave MOSI low
between frames.

# By default, we use GRBW [sic] (and ignore W).
comment "The following options determine channel data order on the wire."

config WS2812_RED_ORDER
int "Order in which a red pixel should be shifted out"
default 1
range 0 3
help
If the red channel is shifted out first, specify 0.
If second, specify 1, and so on.
choice WS2812_STRIP_DRIVER
prompt "Driver backend"
default WS2812_STRIP_SPI

config WS2812_GRN_ORDER
int "Order in which a green pixel should be shifted out"
default 0
range 0 3
help
If the green channel is shifted out first, specify 0.
If second, specify 1, and so on.

config WS2812_BLU_ORDER
int "Order in which a blue pixel should be shifted out"
default 2
range 0 3
config WS2812_STRIP_SPI
bool "Enable the SPI driver"
depends on SPI
help
If the blue channel is shifted out first, specify 0.
If second, specify 1, and so on.
The SPI driver is portable, but requires significantly more
memory (1 byte of overhead per bit of pixel data).

config WS2812_HAS_WHITE_CHANNEL
bool "Does the chip have a white channel on wire?"
default y
config WS2812_STRIP_GPIO
bool "Enable the GPIO driver"
# Only an Cortex-M0 inline assembly implementation for the nRF51
# is supported currently.
depends on SOC_SERIES_NRF51X
help
If the chipset has a white channel, say y. White channels
are not used by the driver, but must be declared if expected
by the chip.
The GPIO driver does bit-banging with inline assembly,
and is not available on all SoCs.

config WS2812_WHT_ORDER
int "Order in which a white pixel should be shifted out"
default 3
range 0 3
depends on WS2812_HAS_WHITE_CHANNEL
help
If the blue channel is shifted out first, specify 0.
If second, specify 1, and so on.
endchoice

endif # WS2812_STRIP
endif
36 changes: 0 additions & 36 deletions drivers/led_strip/Kconfig.ws2812b_sw

This file was deleted.

209 changes: 0 additions & 209 deletions drivers/led_strip/ws2812.c

This file was deleted.

Loading