1.. _stepper_api:
2
3Steppers
4########
5
6The stepper driver API provides a set of functions for controlling and configuring stepper drivers.
7
8Configure Stepper Driver
9========================
10
11- Configure **micro-stepping resolution** using :c:func:`stepper_set_micro_step_res`
12  and :c:func:`stepper_get_micro_step_res`.
13- Configure **reference position** in microsteps using :c:func:`stepper_set_reference_position`
14  and :c:func:`stepper_get_actual_position`.
15- Set **max velocity** in micro-steps per second using :c:func:`stepper_set_max_velocity`
16- **Enable** the stepper driver using :c:func:`stepper_enable`.
17
18Control Stepper
19===============
20
21- **Move by** +/- micro-steps also known as **relative movement** using :c:func:`stepper_move_by`.
22- **Move to** a specific position also known as **absolute movement** using :c:func:`stepper_move_to`.
23- Run continuously with a **constant velocity** in a specific direction until
24  a stop is detected using :c:func:`stepper_run`.
25- Check if the stepper is **moving** using :c:func:`stepper_is_moving`.
26- Register an **event callback** using :c:func:`stepper_set_event_callback`.
27
28Device Tree
29===========
30
31In the context of stepper controllers  device tree provides the initial hardware
32configuration for stepper drivers on a per device level. Each device must specify
33a device tree binding in Zephyr, and ideally, a set of hardware configuration options
34for things such as current settings, ramp parameters and furthermore. These can then
35be used in a boards devicetree to configure a stepper driver to its initial state.
36
37See examples in:
38
39- :dtcompatible:`zephyr,gpio-stepper`
40- :dtcompatible:`adi,tmc5041`
41
42Discord
43=======
44
45Zephyr has a `stepper discord`_ channel for stepper related discussions, which
46is open to all.
47
48.. _stepper-api-reference:
49
50API Reference
51*************
52
53A common set of functions which should be implemented by all stepper drivers.
54
55.. doxygengroup:: stepper_interface
56
57Stepper controller specific APIs
58********************************
59
60Trinamic
61========
62
63.. doxygengroup:: trinamic_stepper_interface
64
65.. _stepper discord:
66   https://discord.com/channels/720317445772017664/1278263869982375946
67