Skip to content

Commit 75463fe

Browse files
jbehrensnxkartben
authored andcommitted
drivers: stepper: test: Added drv8424 to stepper_api and build_all tests
Adds the drv8424 stepper driver to the build_all/stepper test and the stepper_api test. The later test is also modified to ensure compatibility. Signed-off-by: Jan Behrens <[email protected]>
1 parent 4bd2ab7 commit 75463fe

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

tests/drivers/build_all/stepper/gpio.dtsi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@ test_tmc2209: tmc2209_motor {
2323
step-gpios = <&test_gpio 0 0>;
2424
dir-gpios = <&test_gpio 0 0>;
2525
};
26+
27+
drv8424: drv8424 {
28+
status = "okay";
29+
compatible = "ti,drv8424";
30+
31+
dir-gpios = <&test_gpio 0 0>;
32+
step-gpios = <&test_gpio 0 0>;
33+
sleep-gpios = <&test_gpio 0 0>;
34+
en-gpios = <&test_gpio 0 0>;
35+
m0-gpios = <&test_gpio 0 0>;
36+
m1-gpios = <&test_gpio 0 0>;
37+
counter = <&counter0>;
38+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2024 Navimatix GmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_GPIO=y
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2024 Navimatix GmbH
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/gpio/gpio.h>
7+
8+
/ {
9+
zephyr,user {
10+
stepper-motors = <&motor_1 0>;
11+
};
12+
};
13+
14+
/ {
15+
16+
motor_1: motor_1 {
17+
status = "okay";
18+
compatible = "ti,drv8424";
19+
20+
21+
dir-gpios = <&arduino_header 18 0>; /* D12 */
22+
step-gpios = <&arduino_header 19 0>; /* D13 */
23+
sleep-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */
24+
en-gpios = <&arduino_header 14 0>; /* D8 */
25+
m0-gpios = <&arduino_header 16 0>;
26+
m1-gpios = <&arduino_header 17 0>;
27+
counter = <&counter2>;
28+
29+
#address-cells = <1>;
30+
#size-cells = <0>;
31+
#stepper-motor-cells = <0>;
32+
33+
};
34+
};
35+
36+
&timers2 {
37+
status = "okay";
38+
counter2: counter {
39+
status = "okay";
40+
};
41+
};

tests/drivers/stepper/stepper_api/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static void *stepper_setup(void)
5050
&stepper_signal);
5151
user_data_received = NULL;
5252
zassert_not_null(fixture.dev);
53+
(void)stepper_enable(fixture.dev, true);
5354
return &fixture;
5455
}
5556

tests/drivers/stepper/stepper_api/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ tests:
99
- api
1010
platform_allow:
1111
- nucleo_g071rb
12+
- nucleo_f767zi
1213
- qemu_x86_64

0 commit comments

Comments
 (0)