Skip to content

Commit db18424

Browse files
tests: drivers: comparator: stm32 comparator support
add support for nucleo_g474re and nucleo_h745zi_q boards Signed-off-by: Alexander Kozhinov <[email protected]>
1 parent 6597539 commit db18424

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright (c) 2025 Alexander Kozhinov <[email protected]>
4+
*/
5+
6+
#include <zephyr/dt-bindings/gpio/gpio.h>
7+
8+
/ {
9+
aliases {
10+
test-comp = &comp1;
11+
};
12+
13+
zephyr,user {
14+
/* connected also to green led and will toggle it */
15+
test-gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
16+
};
17+
};
18+
19+
/*
20+
* IMPORTANT: CN8.A1 (PA1) shall be connected to CN5.D13 (PA5) by a jumper wire
21+
*/
22+
23+
&comp1 {
24+
status = "okay";
25+
pinctrl-0 = <&comp1_inp_pa1 &comp1_out_pa6>;
26+
pinctrl-names = "default";
27+
positive-input = "IN0";
28+
negative-input = "1_4VREFINT";
29+
invert-output = "NONINVERTED";
30+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright (c) 2025 Alexander Kozhinov <[email protected]>
4+
*/
5+
6+
#include <zephyr/dt-bindings/gpio/gpio.h>
7+
8+
/*
9+
* IMPORTANT: D33 (PB0) shall be connected to D27 (PB2) by a jumper wire
10+
*/
11+
12+
/ {
13+
aliases {
14+
test-comp = &comp1_ch1;
15+
};
16+
17+
zephyr,user {
18+
/* connected also to green led and will toggle it */
19+
test-gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
20+
};
21+
};
22+
23+
&comp1_ch1 {
24+
status = "okay";
25+
pinctrl-0 = <&comp1_inp_pb2 &comp1_out_pe12>;
26+
pinctrl-names = "default";
27+
positive-input = "IN1";
28+
negative-input = "1_4VREFINT";
29+
invert-output = "NONINVERTED";
30+
};

tests/drivers/comparator/gpio_loopback/testcase.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ tests:
3737
- nrf54l15dk/nrf54l15/cpuapp
3838
- nrf54lm20dk/nrf54lm20a/cpuapp
3939
- ophelia4ev/nrf54l15/cpuapp
40+
drivers.comparator.gpio_loopback.stm32_comp:
41+
platform_allow:
42+
- nucleo_h745zi_q/stm32h745xx/m7
43+
- nucleo_g474re/stm32g474xx

0 commit comments

Comments
 (0)