Skip to content

drivers: Add DALI drivers to Zephyr #88128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ add_subdirectory_ifdef(CONFIG_COUNTER counter)
add_subdirectory_ifdef(CONFIG_CRYPTO crypto)
add_subdirectory_ifdef(CONFIG_DAC dac)
add_subdirectory_ifdef(CONFIG_DAI dai)
add_subdirectory_ifdef(CONFIG_DALI dali)
add_subdirectory_ifdef(CONFIG_DISPLAY display)
add_subdirectory_ifdef(CONFIG_DMA dma)
add_subdirectory_ifdef(CONFIG_DP_DRIVER dp)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ source "drivers/counter/Kconfig"
source "drivers/crypto/Kconfig"
source "drivers/dac/Kconfig"
source "drivers/dai/Kconfig"
source "drivers/dali/Kconfig"
source "drivers/disk/Kconfig"
source "drivers/display/Kconfig"
source "drivers/dma/Kconfig"
Expand Down
8 changes: 8 additions & 0 deletions drivers/dali/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2025 by Sven Hädrich <[email protected]>
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
# zephyr-keep-sorted-start
zephyr_library_sources_ifdef(CONFIG_DALI_LPC11U6X dali_lpc11u6x.c)
zephyr_library_sources_ifdef(CONFIG_DALI_PWM dali_pwm.c)
# zephyr-keep-sorted-stop
26 changes: 26 additions & 0 deletions drivers/dali/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# DALI configuration options

# Copyright (c) 2025 by Sven Hädrich <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config DALI
bool "Digital Addressable Lighting Interface (DALI) drivers"
help
Enable generic support for DALI bus (IEC 62386).

if DALI

config DALI_MAX_FRAMES_IN_QUEUE
int "Max frames in DALI recv queue"
default 3
range 1 16
help
How many frames should be buffered in the recv queue

source "drivers/dali/Kconfig.lpc11u6x"
source "drivers/dali/Kconfig.pwm"

module = DALI_LOW_LEVEL
module-str = dali_low_level
source "subsys/logging/Kconfig.template.log_config"
endif # DALI
25 changes: 25 additions & 0 deletions drivers/dali/Kconfig.lpc11u6x
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LPC11U6x DALI configuration options

# Copyright (c) 2025 by Sven Hädrich <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config DALI_LPC11U6X
bool "LPC11U6x DALI driver"
default y
depends on DT_HAS_NXP_DALI_LPC11U6X_ENABLED
help
Enable the DALI driver for LPC11U6X MCUs.

config DALI_LPC11U6X_PRIORITY
int "DALI workqueue priority"
depends on DT_HAS_NXP_DALI_LPC11U6X_ENABLED
default 5
help
The priority of the workqueue used for the DALI driver.

config DALI_LPC11U6X_STACK_SIZE
int "DALI driver workqueue thread stack size"
depends on DT_HAS_NXP_DALI_LPC11U6X_ENABLED
default 768
help
The thread stack size.
43 changes: 43 additions & 0 deletions drivers/dali/Kconfig.pwm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PWM DALI configuration options

# Copyright (c) 2025 by Sven Hädrich <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config DALI_PWM
bool "Generic PWM DALI driver"
default y
depends on DT_HAS_ZEPHYR_DALI_PWM_ENABLED
select PWM
select PWM_CAPTURE
help
Enable DALI driver for generic PWM MCUs.

if DALI_PWM

choice
prompt "Thread for sending out"
default DALI_PWM_OWN_THREAD

config DALI_PWM_GLOBAL_THREAD
bool "Use global thread"

config DALI_PWM_OWN_THREAD
bool "Use own thread"

endchoice

config DALI_PWM_THREAD_PRIORITY
int "DALI send own thread priority"
depends on DALI_PWM_OWN_THREAD
default 10
help
The priority of the thread used for sending DALI frames.

config DALI_PWM_THREAD_STACK_SIZE
int "DALI send own thread stack size"
depends on DALI_PWM_OWN_THREAD
default 1024
help
The thread stack size.

endif # DALI_PWM
Loading
Loading