Skip to content

Commit cd16b54

Browse files
author
Sven Hädrich
committed
drivers: dali: add generic DALI driver
Add a DALI driver subsystem. Add a driver implementation for STM32 style PWM peripherals. Also, add an implementation for the NXP LPC11u68. Signed-off-by: Sven Haedrich <[email protected]>
1 parent c47926e commit cd16b54

21 files changed

+3179
-0
lines changed

drivers/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ add_subdirectory_ifdef(CONFIG_COUNTER counter)
3131
add_subdirectory_ifdef(CONFIG_CRYPTO crypto)
3232
add_subdirectory_ifdef(CONFIG_DAC dac)
3333
add_subdirectory_ifdef(CONFIG_DAI dai)
34+
add_subdirectory_ifdef(CONFIG_DALI dali)
3435
add_subdirectory_ifdef(CONFIG_DISPLAY display)
3536
add_subdirectory_ifdef(CONFIG_DMA dma)
3637
add_subdirectory_ifdef(CONFIG_DP_DRIVER dp)

drivers/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ source "drivers/counter/Kconfig"
2323
source "drivers/crypto/Kconfig"
2424
source "drivers/dac/Kconfig"
2525
source "drivers/dai/Kconfig"
26+
source "drivers/dali/Kconfig"
2627
source "drivers/disk/Kconfig"
2728
source "drivers/display/Kconfig"
2829
source "drivers/dma/Kconfig"

drivers/dali/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 by Sven Hädrich <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_library()
5+
# zephyr-keep-sorted-start
6+
zephyr_library_sources_ifdef(CONFIG_DALI_LPC11U6X dali_lpc11u6x.c)
7+
zephyr_library_sources_ifdef(CONFIG_DALI_PWM dali_pwm.c)
8+
# zephyr-keep-sorted-stop

drivers/dali/Kconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# DALI configuration options
2+
3+
# Copyright (c) 2025 by Sven Hädrich <[email protected]>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config DALI
7+
bool "Digital Addressable Lighting Interface (DALI) drivers"
8+
default y
9+
help
10+
Enable generic support for DALI bus (IEC 62386).
11+
12+
if DALI
13+
14+
config DALI_MAX_FRAMES_IN_QUEUE
15+
int "Max frames in DALI recv queue"
16+
default 3
17+
range 1 16
18+
help
19+
How many frames should be buffered in the recv queue
20+
21+
source "drivers/dali/Kconfig.lpc11u6x"
22+
source "drivers/dali/Kconfig.pwm"
23+
24+
module = DALI_LOW_LEVEL
25+
module-str = dali_low_level
26+
source "subsys/logging/Kconfig.template.log_config"
27+
endif # DALI

drivers/dali/Kconfig.lpc11u6x

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# LPC11U6x DALI configuration options
2+
3+
# Copyright (c) 2025 by Sven Hädrich <[email protected]>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config DALI_LPC11U6X
7+
bool "LPC11U6x DALI driver"
8+
default y
9+
depends on DT_HAS_NXP_DALI_ENABLED
10+
help
11+
Enable the DALI driver for LPC11U6X MCUs.
12+
13+
config DALI_LPC11U6X_PRIORITY
14+
int "DALI workqueue priority"
15+
depends on DT_HAS_NXP_DALI_ENABLED
16+
default 5
17+
help
18+
The priority of the workqueue used for the DALI driver.
19+
20+
config DALI_LPC11U6X_STACK_SIZE
21+
int "DALI driver workqueue thread stack size"
22+
depends on DT_HAS_NXP_DALI_ENABLED
23+
default 768
24+
help
25+
The thread stack size.

drivers/dali/Kconfig.pwm

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# PWM DALI configuration options
2+
3+
# Copyright (c) 2025 by Sven Hädrich <[email protected]>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config DALI_PWM
7+
bool "Generic PWM DALI driver"
8+
default y
9+
depends on DT_HAS_ZEPHYR_DALI_PWM_ENABLED
10+
select PWM
11+
select PWM_CAPTURE
12+
help
13+
Enable DALI driver for generic PWM MCUs.
14+
15+
if DALI_PWM
16+
17+
choice
18+
prompt "Thread for sending out"
19+
default DALI_PWM_OWN_THREAD
20+
21+
config DALI_PWM_GLOBAL_THREAD
22+
bool "Use global thread"
23+
24+
config DALI_PWM_OWN_THREAD
25+
bool "Use own thread"
26+
27+
endchoice
28+
29+
config DALI_PWM_THREAD_PRIORITY
30+
int "DALI send own thread priority"
31+
depends on DALI_PWM_OWN_THREAD
32+
default 10
33+
help
34+
The priority of the thread used for sending DALI frames.
35+
36+
config DALI_PWM_THREAD_STACK_SIZE
37+
int "DALI send own thread stack size"
38+
depends on DALI_PWM_OWN_THREAD
39+
default 1024
40+
help
41+
The thread stack size.
42+
43+
endif # DALI_PWM

0 commit comments

Comments
 (0)