Skip to content

Commit

Permalink
doc: peripherals: stepper: stepper_set_event_callback function
Browse files Browse the repository at this point in the history
- Add missing SPDX headers
- Document set_event_callback function in steppers.rst
- Use the correct dtcompatible in release notes
- Rename tests from stepper_api to gpio_steppers

Signed-off-by: Jilay Pandya <[email protected]>
  • Loading branch information
jilaypandya committed Oct 30, 2024
1 parent cdf2f9a commit b067e13
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 2 additions & 0 deletions doc/hardware/peripherals/stepper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Control Stepper
- Run continuously with a **constant velocity** in a specific direction until
a stop is detected using :c:func:`stepper_enable_constant_velocity_mode`.
- Check if the stepper is **moving** using :c:func:`stepper_is_moving`.
- Register a **event callback** using :c:func:`stepper_set_event_callback`.

Device Tree
===========
Expand All @@ -36,6 +37,7 @@ be used in a boards devicetree to configure a stepper driver to its initial stat

See examples in:

- :dtcompatible:`zephyr,gpio-steppers`
- :dtcompatible:`adi,tmc5041`

Discord
Expand Down
2 changes: 1 addition & 1 deletion doc/releases/release-notes-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Drivers and Sensors
* Introduced stepper shell commands for controlling and configuring
stepper motors with :kconfig:option:`CONFIG_STEPPER_SHELL`
* Added support for ADI TMC5041 (:dtcompatible:`adi,tmc5041`)
* Added support for gpio-stepper-controller (:dtcompatible:`gpio-stepper-controller`)
* Added support for gpio-stepper-controller (:dtcompatible:`zephyr,gpio-steppers`)
* Added stepper api test-suite
* Added stepper shell test-suite

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(stepper_api)
target_sources(app PRIVATE
src/main.c
)
project(gpio_steppers)

target_sources(app PRIVATE src/main.c)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

CONFIG_GPIO=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

CONFIG_GPIO=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

CONFIG_ZTEST=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024 Jilay Sandeep Pandya
* SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -17,7 +17,7 @@ struct k_poll_event stepper_event;
void *user_data_received;

static void stepper_print_event_callback(const struct device *dev, enum stepper_event event,
void *user_data)
void *user_data)
{
user_data_received = user_data;
switch (event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
# SPDX-License-Identifier: Apache-2.0

tests:
Expand Down

0 comments on commit b067e13

Please sign in to comment.