Skip to content

Commit 88b8c8b

Browse files
tests: zephyr: drivers: comparators: Add support for nRF7120
Add all support required for nRF7120 to compile tests successfully, can't be tested with FPGA. Signed-off-by: Robert Robinson <[email protected]>
1 parent e9d6ae8 commit 88b8c8b

File tree

9 files changed

+84
-0
lines changed

9 files changed

+84
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX=0
2+
CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX=5
3+
CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX=1
4+
CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX=0
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* Two loopbacks are used
2+
* Each loopback is between analog input and GPIO.
3+
* first-gpios (P0.02) -> AIN1 (P0.01)
4+
* second-gpios (P0.03, AIN3) -> (P0.00, AIN0)
5+
* AIN5 (P0.05) -> VDD
6+
*/
7+
8+
/ {
9+
aliases {
10+
test-comp = &comp;
11+
};
12+
13+
zephyr,user {
14+
first-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; // Link to CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX - Needs to loop to P0.01
15+
second-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; // Loopback to CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX
16+
};
17+
};
18+
19+
&gpio0 {
20+
status = "okay";
21+
};
22+
23+
&comp {
24+
status = "okay";
25+
psel = "AIN4";
26+
refsel = "AREF";
27+
extrefsel= "AIN3";
28+
sp-mode = "LOW";
29+
th-up = <36>;
30+
th-down = <30>;
31+
isource = "DISABLED";
32+
enable-hyst;
33+
};

tests/zephyr/boards/nrf/comp/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ tests:
1010
platform_allow:
1111
- nrf54lv10dk/nrf54lv10a/cpuapp
1212
- [email protected]/nrf54lv10a/cpuapp
13+
- nrf7120pdk/nrf7120/cpuapp
1314
integration_platforms:
1415
- nrf54lv10dk/nrf54lv10a/cpuapp
16+
- nrf7120pdk/nrf7120/cpuapp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <zephyr/dt-bindings/gpio/gpio.h>
2+
3+
/*
4+
* P0.03 looped back to P0.00
5+
*/
6+
7+
/ {
8+
aliases {
9+
test-comp = &comp;
10+
};
11+
12+
zephyr,user {
13+
test-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
14+
};
15+
};
16+
17+
&gpio0 {
18+
status = "okay";
19+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
&comp {
3+
main-mode = "SE";
4+
psel = "AIN0"; /* P0.00 */
5+
refsel = "INT_1V2";
6+
sp-mode = "HIGH";
7+
th-up = <63>;
8+
th-down = <59>;
9+
isource = "DISABLED";
10+
status = "okay";
11+
};

tests/zephyr/drivers/comparator/gpio_loopback/snippets/nrf_comp/snippet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ boards:
44
nrf54lv10dk/nrf54lv10a/cpuapp:
55
append:
66
EXTRA_DTC_OVERLAY_FILE: boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay
7+
nrf7120pdk/nrf7120/cpuapp:
8+
append:
9+
EXTRA_DTC_OVERLAY_FILE: boards/nrf7120pdk_nrf7120_cpuapp.overlay
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
&comp {
3+
compatible = "nordic,nrf-lpcomp";
4+
psel = "AIN0"; /* P0.00 */
5+
refsel = "VDD_4_8";
6+
status = "okay";
7+
};

tests/zephyr/drivers/comparator/gpio_loopback/snippets/nrf_lpcomp/snippet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ boards:
44
nrf54lv10dk/nrf54lv10a/cpuapp:
55
append:
66
EXTRA_DTC_OVERLAY_FILE: boards/nrf54lv10dk_nrf54lv10a_cpuapp.overlay
7+
nrf7120pdk/nrf7120/cpuapp:
8+
append:
9+
EXTRA_DTC_OVERLAY_FILE: boards/nrf7120pdk_nrf7120_cpuapp.overlay

tests/zephyr/drivers/comparator/gpio_loopback/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ common:
88
platform_allow:
99
- nrf54lv10dk/nrf54lv10a/cpuapp
1010
- [email protected]/nrf54lv10a/cpuapp
11+
- nrf7120pdk/nrf7120/cpuapp
1112
integration_platforms:
1213
- nrf54lv10dk/nrf54lv10a/cpuapp
14+
- nrf7120pdk/nrf7120/cpuapp
1315
tests:
1416
nrf.extended.drivers.comparator.gpio_loopback.nrf_comp:
1517
extra_args:

0 commit comments

Comments
 (0)