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 <jan.behrens@navimatix.de>
This commit is contained in:
Jan Behrens 2024-12-18 15:33:18 +01:00 committed by Benjamin Cabé
parent 4bd2ab7e1d
commit 75463fe950
5 changed files with 60 additions and 0 deletions

View file

@ -23,3 +23,16 @@ test_tmc2209: tmc2209_motor {
step-gpios = <&test_gpio 0 0>;
dir-gpios = <&test_gpio 0 0>;
};
drv8424: drv8424 {
status = "okay";
compatible = "ti,drv8424";
dir-gpios = <&test_gpio 0 0>;
step-gpios = <&test_gpio 0 0>;
sleep-gpios = <&test_gpio 0 0>;
en-gpios = <&test_gpio 0 0>;
m0-gpios = <&test_gpio 0 0>;
m1-gpios = <&test_gpio 0 0>;
counter = <&counter0>;
};

View file

@ -0,0 +1,4 @@
# Copyright (c) 2024 Navimatix GmbH
# SPDX-License-Identifier: Apache-2.0
CONFIG_GPIO=y

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2024 Navimatix GmbH
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/gpio/gpio.h>
/ {
zephyr,user {
stepper-motors = <&motor_1 0>;
};
};
/ {
motor_1: motor_1 {
status = "okay";
compatible = "ti,drv8424";
dir-gpios = <&arduino_header 18 0>; /* D12 */
step-gpios = <&arduino_header 19 0>; /* D13 */
sleep-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */
en-gpios = <&arduino_header 14 0>; /* D8 */
m0-gpios = <&arduino_header 16 0>;
m1-gpios = <&arduino_header 17 0>;
counter = <&counter2>;
#address-cells = <1>;
#size-cells = <0>;
#stepper-motor-cells = <0>;
};
};
&timers2 {
status = "okay";
counter2: counter {
status = "okay";
};
};

View file

@ -50,6 +50,7 @@ static void *stepper_setup(void)
&stepper_signal);
user_data_received = NULL;
zassert_not_null(fixture.dev);
(void)stepper_enable(fixture.dev, true);
return &fixture;
}

View file

@ -9,4 +9,5 @@ tests:
- api
platform_allow:
- nucleo_g071rb
- nucleo_f767zi
- qemu_x86_64