Steppers
The stepper driver API provides a set of functions for controlling and configuring stepper drivers.
Configure Stepper Driver
Configure micro-stepping resolution using
stepper_set_micro_step_res()
andstepper_get_micro_step_res()
.Configure actual position a.k.a step count in microsteps using
stepper_set_actual_position()
andstepper_get_actual_position()
.Set max velocity in micro-steps per second using
stepper_set_max_velocity()
Enable the stepper driver using
stepper_enable()
.
Control Stepper
Move by +/- micro-steps also known as relative movement using
stepper_move()
.Move to a specific position also known as absolute movement using
stepper_set_target_position()
.Run continuously with a constant velocity in a specific direction until a stop is detected using
stepper_enable_constant_velocity_mode()
.Check if the stepper is moving using
stepper_is_moving()
.
Device Tree
In the context of stepper controllers device tree provides the initial hardware configuration for stepper drivers on a per device level. Each device must specify a device tree binding in Zephyr, and ideally, a set of hardware configuration options for things such as current settings, ramp parameters and furthermore. These can then be used in a boards devicetree to configure a stepper driver to its initial state.
See examples in:
Discord
Zephyr has a stepper discord channel for stepper related discussions, which is open to all.
API Reference
A common set of functions which should be implemented by all stepper drivers.