3
3
Steppers
4
4
########
5
5
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:
7
7
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.
10
24
11
- - Configure **micro-stepping resolution ** using :c:func: `stepper_set_micro_step_res `
12
- and :c:func: `stepper_get_micro_step_res `.
13
25
- Configure **reference position ** in microsteps using :c:func: `stepper_set_reference_position `
14
26
and :c:func: `stepper_get_actual_position `.
15
27
- 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
-
22
28
- **Move by ** +/- micro-steps also known as **relative movement ** using :c:func: `stepper_move_by `.
23
29
- **Move to ** a specific position also known as **absolute movement ** using :c:func: `stepper_move_to `.
24
30
- Run continuously with a **constant step interval ** in a specific direction until
@@ -27,6 +33,18 @@ Control Stepper
27
33
- Check if the stepper is **moving ** using :c:func: `stepper_is_moving `.
28
34
- Register an **event callback ** using :c:func: `stepper_set_event_callback `.
29
35
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
+
30
48
Device Tree
31
49
===========
32
50
@@ -36,18 +54,14 @@ a device tree binding in Zephyr, and ideally, a set of hardware configuration op
36
54
for things such as current settings, ramp parameters and furthermore. These can then
37
55
be used in a boards devicetree to configure a stepper driver to its initial state.
38
56
39
- See examples in:
40
-
41
- - :dtcompatible: `zephyr,h-bridge-stepper `
42
- - :dtcompatible: `adi,tmc50xx `
43
-
44
57
Discord
45
58
=======
46
59
47
60
Zephyr has a `stepper discord `_ channel for stepper related discussions, which
48
61
is open to all.
49
62
50
63
.. _stepper-api-reference :
64
+ .. _stepper-drv-api-reference :
51
65
52
66
Stepper API Test Suite
53
67
======================
@@ -93,6 +107,10 @@ API Reference
93
107
94
108
A common set of functions which should be implemented by all stepper drivers.
95
109
110
+ .. doxygengroup :: stepper_drv_interface
111
+
112
+ A common set of functions which should be implemented by all stepper controllers.
113
+
96
114
.. doxygengroup :: stepper_interface
97
115
98
116
Stepper controller specific APIs
0 commit comments