Trait stepper::traits::MotionControl [−][src]
Implemented by drivers that have motion control capabilities
A software-based fallback implementation exists in the motion_control
module, for drivers that implement SetDirection and Step.
Associated Types
type Velocity: Copy
[src]
The type used by the driver to represent velocity
type Error
[src]
The type error that can happen when using this trait
Required methods
fn move_to_position(
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>
[src]
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>
Move to the given position
This method must arrange for the motion to start, but must not block
until it is completed. If more attention is required during the motion,
this should be handled in MotionControl::update
.
fn reset_position(&mut self, step: i32) -> Result<(), Self::Error>
[src]
Reset internal position to the given value
This method must not start a motion. Its only purpose is to change the driver’s internal position value, for example for homing.
fn update(&mut self) -> Result<bool, Self::Error>
[src]
Update an ongoing motion
This method may contain any code required to maintain an ongoing motion, if required, or it might just check whether a motion is still ongoing.
Return true
, if motion is ongoing, false
otherwise. If false
is
returned, the caller may assume that this method doesn’t need to be
called again, until starting another motion.
Implementors
impl<'r, T> MotionControl for RefMut<'r, T> where
T: MotionControl,
[src]
T: MotionControl,
type Velocity = T::Velocity
type Error = T::Error
fn move_to_position(
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>
[src]
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>
fn reset_position(&mut self, step: i32) -> Result<(), Self::Error>
[src]
fn update(&mut self) -> Result<bool, Self::Error>
[src]
impl<Driver, Timer, Profile, Convert> MotionControl for SoftwareMotionControl<Driver, Timer, Profile, Convert> where
Driver: SetDirection + Step,
Profile: MotionProfile,
Timer: CountDown,
Profile::Velocity: Copy,
Convert: DelayToTicks<Profile::Delay, Ticks = Timer::Time>,
Convert::Ticks: TryFrom<Nanoseconds> + Sub<Output = Convert::Ticks>,
[src]
Driver: SetDirection + Step,
Profile: MotionProfile,
Timer: CountDown,
Profile::Velocity: Copy,
Convert: DelayToTicks<Profile::Delay, Ticks = Timer::Time>,
Convert::Ticks: TryFrom<Nanoseconds> + Sub<Output = Convert::Ticks>,
type Velocity = Profile::Velocity
type Error = Error<<Driver as SetDirection>::Error, <Driver as Step>::Error, Timer::Error, <Timer::Time as TryFrom<Nanoseconds>>::Error, Convert::Error>
fn move_to_position(
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>
[src]
&mut self,
max_velocity: Self::Velocity,
target_step: i32
) -> Result<(), Self::Error>