Skip to content

Commit f780df4

Browse files
jilaypandyakartben
authored andcommitted
tests: stepper_api: create a scaffold to generalize tests
This commit creates a scaffold for executing stepper_api tests on the existing step_dir drivers. Signed-off-by: Jilay Pandya <[email protected]>
1 parent e6a2869 commit f780df4

13 files changed

+223
-66
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2025 Jilay Sandeep Pandya
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/gpio/gpio.h>
7+
8+
/ {
9+
gpio1: gpio1 {
10+
compatible = "zephyr,gpio-emul";
11+
#gpio-cells = <0x2>;
12+
status = "okay";
13+
gpio-controller;
14+
};
15+
16+
gpio2: gpio2 {
17+
compatible = "zephyr,gpio-emul";
18+
#gpio-cells = <0x2>;
19+
status = "okay";
20+
gpio-controller;
21+
};
22+
23+
gpio3: gpio3 {
24+
compatible = "zephyr,gpio-emul";
25+
#gpio-cells = <0x2>;
26+
status = "okay";
27+
gpio-controller;
28+
};
29+
30+
gpio4: gpio4 {
31+
compatible = "zephyr,gpio-emul";
32+
#gpio-cells = <0x2>;
33+
status = "okay";
34+
gpio-controller;
35+
};
36+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Jilay Sandeep Pandya
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "native_sim.overlay"
7+
8+
/ {
9+
aliases {
10+
stepper = &adi_tmc2209;
11+
};
12+
};
13+
14+
/ {
15+
adi_tmc2209: adi_tmc2209 {
16+
status = "okay";
17+
compatible = "adi,tmc2209";
18+
micro-step-res = <32>;
19+
dir-gpios = <&gpio1 0 0>;
20+
step-gpios = <&gpio1 1 0>;
21+
en-gpios = <&gpio2 1 0>;
22+
msx-gpios = <&gpio3 0 0>, <&gpio4 1 0>;
23+
counter = <&counter0>;
24+
};
25+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 Jilay Sandeep Pandya
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "native_sim.overlay"
7+
8+
/ {
9+
aliases {
10+
stepper = &ti_drv8424;
11+
};
12+
};
13+
14+
/ {
15+
ti_drv8424: ti_drv8424 {
16+
status = "okay";
17+
compatible = "ti,drv8424";
18+
micro-step-res = <8>;
19+
dir-gpios = <&gpio1 0 0>;
20+
step-gpios = <&gpio1 1 0>;
21+
sleep-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
22+
en-gpios = <&gpio2 1 0>;
23+
m0-gpios = <&gpio3 0 0>;
24+
m1-gpios = <&gpio3 1 0>;
25+
counter = <&counter0>;
26+
};
27+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2025 Jilay Sandeep Pandya
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "native_sim.overlay"
7+
8+
/ {
9+
aliases {
10+
stepper = &zephyr_gpio_stepper;
11+
};
12+
};
13+
14+
/ {
15+
zephyr_gpio_stepper: zephyr_gpio_stepper {
16+
compatible = "zephyr,gpio-stepper";
17+
status = "okay";
18+
micro-step-res = <1>;
19+
gpios = <&gpio1 0 0>,
20+
<&gpio2 0 0>,
21+
<&gpio3 0 0>,
22+
<&gpio4 0 0>;
23+
};
24+
};

tests/drivers/stepper/stepper_api/boards/nucleo_f767zi.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/drivers/stepper/stepper_api/boards/nucleo_f767zi.overlay renamed to tests/drivers/stepper/stepper_api/boards/nucleo_f767zi_ti_drv8424.overlay

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <zephyr/dt-bindings/gpio/gpio.h>
77

88
/ {
9-
zephyr,user {
10-
stepper-motors = <&motor_1 0>;
11-
};
9+
aliases {
10+
stepper = &motor_1;
11+
};
1212
};
1313

1414
/ {
@@ -25,11 +25,6 @@
2525
m0-gpios = <&arduino_header 16 0>;
2626
m1-gpios = <&arduino_header 17 0>;
2727
counter = <&counter2>;
28-
29-
#address-cells = <1>;
30-
#size-cells = <0>;
31-
#stepper-motor-cells = <0>;
32-
3328
};
3429
};
3530

tests/drivers/stepper/stepper_api/boards/nucleo_g071rb.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/drivers/stepper/stepper_api/boards/nucleo_g071rb.overlay renamed to tests/drivers/stepper/stepper_api/boards/nucleo_g071rb_zephyr_gpio_stepper.overlay

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
/ {
7+
aliases {
8+
stepper = &motor_1;
9+
};
10+
};
11+
612
/ {
713
motor_1: motor_1 {
814
compatible = "zephyr,gpio-stepper";

tests/drivers/stepper/stepper_api/boards/qemu_x86_64.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/drivers/stepper/stepper_api/boards/qemu_x86_64.overlay

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)