Skip to content

Commit b13ffc2

Browse files
committed
[nrf fromlist] tests: comparator: nordic: Align boards overlays for changed input types
Align samples and tests boards overlays for changed comparator input types. Upstream PR #: 95106 Signed-off-by: Jakub Zymelka <[email protected]>
1 parent 2d7b664 commit b13ffc2

24 files changed

+83
-39
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
2+
13
&comp {
24
compatible = "nordic,nrf-lpcomp";
3-
psel = "AIN4";
5+
psel = <NRF_COMP_AIN4>;
46
refsel = "VDD_4_8";
57
status = "okay";
68
};

tests/boards/nrf/comp/boards/bl54l15_dvk_nrf54l15_cpuapp.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
9+
810
/ {
911
aliases {
1012
test-comp = &comp;
@@ -30,9 +32,9 @@
3032

3133
&comp {
3234
status = "okay";
33-
psel = "AIN4";
35+
psel = <NRF_COMP_AIN4>;
3436
refsel = "AREF";
35-
extrefsel = "AIN3";
37+
extrefsel = <NRF_COMP_AIN3>;
3638
sp-mode = "NORMAL";
3739
th-up = <36>;
3840
th-down = <30>;

tests/boards/nrf/comp/boards/bl54l15u_dvk_nrf54l15_cpuapp.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
9+
810
/ {
911
aliases {
1012
test-comp = &comp;
@@ -30,9 +32,9 @@
3032

3133
&comp {
3234
status = "okay";
33-
psel = "AIN4";
35+
psel = <NRF_COMP_AIN4>;
3436
refsel = "AREF";
35-
extrefsel = "AIN3";
37+
extrefsel = <NRF_COMP_AIN3>;
3638
sp-mode = "NORMAL";
3739
th-up = <36>;
3840
th-down = <30>;

tests/boards/nrf/comp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
8+
79
/ {
810
aliases {
911
test-comp = &comp;
@@ -25,9 +27,9 @@
2527

2628
&comp {
2729
status = "okay";
28-
psel = "AIN5";
30+
psel = <NRF_COMP_AIN5>;
2931
refsel = "AREF";
30-
extrefsel = "AIN1";
32+
extrefsel = <NRF_COMP_AIN1>;
3133
sp-mode = "HIGH";
3234
th-up = <36>;
3335
th-down = <30>;

tests/boards/nrf/comp/boards/nrf54l15dk_nrf54l15_cpuapp.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
8+
79
/ {
810
aliases {
911
test-comp = &comp;
@@ -29,9 +31,9 @@
2931

3032
&comp {
3133
status = "okay";
32-
psel = "AIN4";
34+
psel = <NRF_COMP_AIN4>;
3335
refsel = "AREF";
34-
extrefsel = "AIN3";
36+
extrefsel = <NRF_COMP_AIN3>;
3537
sp-mode = "NORMAL";
3638
th-up = <36>;
3739
th-down = <30>;

tests/boards/nrf/comp/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* AIN4 (P1.06) tied to VDD
66
*/
77

8+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
9+
810
/ {
911
aliases {
1012
test-comp = &comp;
@@ -22,9 +24,9 @@
2224

2325
&comp {
2426
status = "okay";
25-
psel = "AIN4";
27+
psel = <NRF_COMP_AIN4>;
2628
refsel = "AREF";
27-
extrefsel = "AIN3";
29+
extrefsel = <NRF_COMP_AIN3>;
2830
sp-mode = "NORMAL";
2931
th-up = <36>;
3032
th-down = <30>;

tests/boards/nrf/comp/src/test.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <zephyr/ztest.h>
8+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
89
#include <zephyr/drivers/comparator/nrf_comp.h>
910
#include <zephyr/drivers/gpio.h>
1011
#include <zephyr/kernel.h>
@@ -13,14 +14,11 @@ static const struct device *test_dev = DEVICE_DT_GET(DT_ALIAS(test_comp));
1314
static const struct gpio_dt_spec test_pin_1 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), first_gpios);
1415
static const struct gpio_dt_spec test_pin_2 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), second_gpios);
1516

16-
#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \
17-
CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX)
18-
#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \
19-
CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX)
20-
#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \
21-
CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX)
22-
#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \
23-
CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX)
17+
#define TEST_COMP_SE_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX)
18+
#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX)
19+
#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX)
20+
#define TEST_COMP_DIFF_EXTREFSEL_AIN \
21+
_CONCAT(NRF_COMP_AIN, CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX)
2422

2523
struct comp_nrf_comp_se_config comp_se_config = {
2624
.psel = TEST_COMP_SE_PSEL_AIN,

tests/drivers/build_all/comparator/nrf_comp/diff.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
8+
79
&comp {
810
main-mode = "DIFF";
9-
psel = "AIN0";
10-
extrefsel = "AIN1";
11+
psel = <NRF_COMP_AIN0>;
12+
extrefsel = <NRF_COMP_AIN1>;
1113
sp-mode = "HIGH";
1214
isource = "DISABLED";
1315
status = "okay";

tests/drivers/build_all/comparator/nrf_comp/se.overlay

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
8+
79
&comp {
810
main-mode = "SE";
9-
psel = "AIN0";
11+
psel = <NRF_COMP_AIN0>;
1012
refsel = "INT_1V2";
1113
sp-mode = "HIGH";
1214
th-up = <36>;

tests/drivers/build_all/comparator/nrf_comp/se_aref.overlay

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/comparator/nrf-comp.h>
8+
79
&comp {
810
main-mode = "SE";
9-
psel = "AIN0";
10-
extrefsel = "AIN1";
11+
psel = <NRF_COMP_AIN0>;
12+
extrefsel = <NRF_COMP_AIN1>;
1113
refsel = "AREF";
1214
sp-mode = "HIGH";
1315
th-up = <36>;

0 commit comments

Comments
 (0)