Skip to content

Commit 7e2e8df

Browse files
SvenHaedrichdkalowsk
authored andcommitted
drivers: dali: use shield definition
Use the definition for the Mikroe DALI 2 click shield. Signed-off-by: Sven Haedrich <sven.haedrich@sevenlab.de>
1 parent 32ac391 commit 7e2e8df

5 files changed

Lines changed: 39 additions & 53 deletions

File tree

samples/drivers/dali/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The sample can be build and executed for the
3232
:zephyr-app: samples/drivers/dali
3333
:board: nucleo_f091rc
3434
:goals: build flash
35+
:shield: arduino_uno_click,mikroe_dali_2_click
3536
:compact:
3637

3738
Building and Running for Nordic nRF52840
@@ -49,6 +50,7 @@ The sample can be build and executed for the
4950
:zephyr-app: samples/drivers/dali
5051
:board: nrf52840dk
5152
:goals: build flash
53+
:shield: arduino_uno_click,mikroe_dali_2_click
5254
:compact:
5355

5456
Sample output

samples/drivers/dali/boards/nrf52840dk_nrf52840.overlay

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,29 @@
22
* Copyright 2025 by Markus Becker
33
* SPDX-License-Identifier: Apache-2.0
44
*
5-
* add DALI 2 Click (MIKROE-2672)
6-
* via Arduino UNO click shield (MIKROE-1581)
7-
* to nRF52840 DK (pca10056)
8-
* DALI 2 Click
9-
* DALI TX 2
10-
* DALI RX 15
11-
* Arduino UNO click shield (slot 1)
12-
* DALI TX 2 > A3
13-
* DALI RX 15 > D2
14-
* nRF52840 DK:
15-
* DALI TX A3 > P0.29
16-
* DALI RX D2 > P1.03
5+
* You need to include the following shields:
6+
* arduino_uno_click
7+
* mikroe_dali_2_click
8+
*
179
*/
1810

19-
/ {
20-
dali0: dali {
21-
compatible = "zephyr,dali-pwm";
22-
status = "okay";
23-
counter = <&timer2>;
24-
chan-id-rx = <0>;
25-
chan-id-tx = <1>;
26-
pwms = <&pwm0 0 PWM_USEC(41) PWM_POLARITY_NORMAL>;
27-
rx-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; // D2
28-
tx-flank-shift-us = <(-38)>;
29-
rx-flank-shift-us = <(-59)>;
30-
tx-rx-propagation-max-us = <2400>;
31-
tx-prog-delay-us = <(-320)>;
32-
rx-max-latency-us = <80>;
33-
rx-grey-area-us = <800>;
34-
};
11+
&mikroe_dali2_click {
12+
tx-rx-propagation-max-us = <2400>;
13+
tx-prog-delay-us = <(-320)>;
14+
rx-max-latency-us = <80>;
15+
rx-grey-area-us = <800>;
3516
};
3617

3718
&pinctrl {
3819
pwm0_default_dali: pwm0_default_dali {
3920
group1 {
40-
psels = <NRF_PSEL(PWM_OUT0, 0, 29)>; // A3
21+
psels = <NRF_PSEL(PWM_OUT0, 0, 29)>; // mikrobus_header_1 2
4122
};
4223
};
4324

4425
pwm0_sleep_dali: pwm0_sleep_dali {
4526
group1 {
46-
psels = <NRF_PSEL(PWM_OUT0, 0, 29)>; // A3
27+
psels = <NRF_PSEL(PWM_OUT0, 0, 29)>; // mikrobus_header_1 2
4728
low-power-enable;
4829
};
4930
};

samples/drivers/dali/boards/nucleo_f091rc.overlay

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,21 @@
88
* DALI 2 Click
99
* DALI TX 2
1010
* DALI RX 15
11-
* Arduino UNO click shield (slot 2)
11+
* Arduino UNO click shield (slot 1)
1212
* DALI TX 2 > A3
1313
* DALI RX 15 > D2
1414
* STM32F091
1515
* DALI TX A3 > PB_0
1616
* DALI RX D2 > PA_10
1717
*/
1818

19-
/ {
20-
dali0: dali {
21-
compatible = "zephyr,dali-pwm";
22-
status = "okay";
23-
counter = <&counter2>;
24-
chan-id-rx = <0>;
25-
chan-id-tx = <1>;
26-
pwms = <&pwm3 3 PWM_USEC(41) PWM_POLARITY_NORMAL>;
27-
rx-gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
28-
tx-flank-shift-us = <(-46)>;
29-
rx-flank-shift-us = <(-68)>;
30-
tx-rx-propagation-max-us = <2400>;
31-
tx-prog-delay-us = <(-200)>;
32-
rx-max-latency-us = <80>;
33-
rx-grey-area-us = <800>;
34-
};
19+
&mikroe_dali2_click {
20+
counter = <&counter2>;
21+
pwms = <&pwm3 3 PWM_USEC(41) PWM_POLARITY_NORMAL>;
22+
tx-rx-propagation-max-us = <2400>;
23+
tx-prog-delay-us = <(-200)>;
24+
rx-max-latency-us = <80>;
25+
rx-grey-area-us = <800>;
3526
};
3627

3728
&timers2 {
@@ -52,7 +43,7 @@
5243
status = "okay";
5344

5445
pwm3: pwm {
55-
pinctrl-0 = <&tim3_ch3_pb0>;
46+
pinctrl-0 = <&tim3_ch3_pb0>; // microbus header 1
5647
pinctrl-names = "default";
5748
status = "okay";
5849
};

samples/drivers/dali/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <zephyr/logging/log.h>
1313
LOG_MODULE_REGISTER(main);
1414

15-
#define DALI_NODE DT_NODELABEL(dali0)
15+
#define DALI_NODE DT_ALIAS(dali)
1616

1717
int main(void)
1818
{

samples/drivers/dali/tests.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
sample:
22
description: Dali Zephyr driver application
33
name: dali-zephyr
4+
common:
5+
tags: dali
6+
filter: dt_nodelabel_enabled("dali0")
47
tests:
5-
sample.drivers.dali:
6-
tags: dali
7-
integration_platforms:
8+
sample.drivers.dali.nucleo_f091rc:
9+
platform_allow:
810
- nucleo_f091rc
11+
harness: console
12+
harness_config:
13+
type: one_line
14+
regex:
15+
- "Target board: (.*)"
16+
extra_args:
17+
- SHIELD=arduino_uno_click;mikroe_dali_2_click
18+
sample.drivers.dali.nrf52840dk:
19+
platform_allow:
920
- nrf52840dk/nrf52840
10-
filter: dt_nodelabel_enabled("dali0")
1121
harness: console
1222
harness_config:
1323
type: one_line
1424
regex:
1525
- "Target board: (.*)"
26+
extra_args:
27+
- SHIELD=arduino_uno_click;mikroe_dali_2_click

0 commit comments

Comments
 (0)