Module traits

Module traits 

Source
Expand description

Traits that can be implemented by Stepper drivers

Users are generally not expected to use these traits directly, except to specify trait bounds, where necessary. Please check out Stepper, which uses these traits to provide a unified API.

There are two kinds of traits in this module:

  1. Those that provide a minimal and low-level interface over a specific capability (like controlling the microstepping mode).
  2. Those that provide an API for enabling these capabilities, taking ownership of the resources that are required to do so.

When constructed, drivers usually do not provide access to any of their capabilities. This means users can specifically enable the capabilities they need, and do not have have to provide hardware resources (like output pins) for capabilities that they are not going to use.

This approach also provides a lot of flexibility for non-standard use cases, for example if not all driver capabilities are controlled by software.

Traitsยง

EnableDirectionControl
Enable direction control for a driver
EnableMotionControl
Enable motion control for a driver
EnableStepControl
Enable step control for a driver
EnableStepModeControl
Enable microstepping mode control for a driver
MotionControl
Implemented by drivers that have motion control capabilities
SetDirection
Implemented by drivers that support controlling the DIR signal
SetStepMode
Implemented by drivers that support controlling the microstepping mode
Step
Implemented by drivers that support controlling the STEP signal