Skip to content

Commit 92eee51

Browse files
committed
doc: stepper: introduce stepper_drv api in documentation
add information about stepper_drv api and relevant functions in stepper documentation. rename zephyr,gpio-stepper to zephyr,h-bridge-stepper Signed-off-by: Jilay Pandya <[email protected]>
1 parent 7fb6aa2 commit 92eee51

File tree

1 file changed

+34
-16
lines changed

1 file changed

+34
-16
lines changed

doc/hardware/peripherals/stepper.rst

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,28 @@
33
Steppers
44
########
55

6-
The stepper driver API provides a set of functions for controlling and configuring stepper drivers.
6+
The stepper driver subsystem consists of two device driver APIs:
77

8-
Configure Stepper Driver
9-
========================
8+
Stepper Driver API
9+
==================
10+
11+
The stepper driver API provides a common interface for stepper drivers.
12+
13+
- Configure **micro-stepping resolution** using :c:func:`stepper_drv_set_micro_step_res`
14+
and :c:func:`stepper_drv_get_micro_step_res`.
15+
- **Enable** the stepper driver using :c:func:`stepper_drv_enable`.
16+
- **Disable** the stepper driver using :c:func:`stepper_drv_disable`.
17+
- Set the **direction** of the stepper using :c:func:`stepper_drv_set_direction`.
18+
- **Step** a single step using :c:func:`stepper_drv_step`.
19+
20+
Stepper API
21+
===========
22+
23+
The stepper API provides a common interface for stepper controllers.
1024

11-
- Configure **micro-stepping resolution** using :c:func:`stepper_set_micro_step_res`
12-
and :c:func:`stepper_get_micro_step_res`.
1325
- Configure **reference position** in microsteps using :c:func:`stepper_set_reference_position`
1426
and :c:func:`stepper_get_actual_position`.
1527
- Set **step interval** in nanoseconds between steps using :c:func:`stepper_set_microstep_interval`
16-
- **Enable** the stepper driver using :c:func:`stepper_enable`.
17-
- **Disable** the stepper driver using :c:func:`stepper_disable`.
18-
19-
Control Stepper
20-
===============
21-
2228
- **Move by** +/- micro-steps also known as **relative movement** using :c:func:`stepper_move_by`.
2329
- **Move to** a specific position also known as **absolute movement** using :c:func:`stepper_move_to`.
2430
- Run continuously with a **constant step interval** in a specific direction until
@@ -27,6 +33,18 @@ Control Stepper
2733
- Check if the stepper is **moving** using :c:func:`stepper_is_moving`.
2834
- Register an **event callback** using :c:func:`stepper_set_event_callback`.
2935

36+
37+
Driver Composition Scenarios
38+
============================
39+
40+
Below are two typical scenarios:
41+
42+
- **Combined Driver:** Implements both ``stepper`` and ``stepper_drv`` APIs in a single driver. For instance,
43+
:dtcompatible:`adi,tmc50xx`
44+
- **Separated Drivers:** A motion control driver implements ``stepper`` API, for instance,
45+
:dtcompatible:`zephyr,stepper-motion-control` and a hardware driver implements ``stepper_drv`` API, for instance,
46+
:dtcompatible:`ti,drv84xx` or :dtcompatible:`zephyr,h-bridge-stepper`.
47+
3048
Device Tree
3149
===========
3250

@@ -36,18 +54,14 @@ a device tree binding in Zephyr, and ideally, a set of hardware configuration op
3654
for things such as current settings, ramp parameters and furthermore. These can then
3755
be used in a boards devicetree to configure a stepper driver to its initial state.
3856

39-
See examples in:
40-
41-
- :dtcompatible:`zephyr,h-bridge-stepper`
42-
- :dtcompatible:`adi,tmc50xx`
43-
4457
Discord
4558
=======
4659

4760
Zephyr has a `stepper discord`_ channel for stepper related discussions, which
4861
is open to all.
4962

5063
.. _stepper-api-reference:
64+
.. _stepper-drv-api-reference:
5165

5266
Stepper API Test Suite
5367
======================
@@ -93,6 +107,10 @@ API Reference
93107

94108
A common set of functions which should be implemented by all stepper drivers.
95109

110+
.. doxygengroup:: stepper_drv_interface
111+
112+
A common set of functions which should be implemented by all stepper controllers.
113+
96114
.. doxygengroup:: stepper_interface
97115

98116
Stepper controller specific APIs

0 commit comments

Comments
 (0)