Struct stepper_driver::MotorDriver
[−]
[src]
pub struct MotorDriver<D, DIR, STEP, CHIP> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
CHIP: Params, { /* fields omitted */ }
A stepper motor driver generic struct
Methods
impl<D, DIR, STEP, CHIP> MotorDriver<D, DIR, STEP, CHIP> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
CHIP: Params,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
CHIP: Params,
pub fn set_speed(&mut self, rpm: f32)
[src]
Sets the speed in revolutions per minute (1-200 is a reasonable range)
pub fn move_instant(&mut self, steps_to_move: u64)
[src]
Moves the motor steps_to_move steps
pub fn move_smooth(
&mut self,
steps_to_move: u64,
steps_acc: u64,
steps_dec: u64
)
[src]
&mut self,
steps_to_move: u64,
steps_acc: u64,
steps_dec: u64
)
Moves the motor smoothly steps_to_move
steps.
Increasing speed during the steps_acc
and decreasing during steps_dec
steps.
pub fn set_direction(&mut self, clock_work: bool)
[src]
Set the direction
impl<D, DIR, STEP> MotorDriver<D, DIR, STEP, a4988> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
pub fn a4988(
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
[src]
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
Specialized constructor
impl<D, DIR, STEP> MotorDriver<D, DIR, STEP, drv8825> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
pub fn drv8825(
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
[src]
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
Specialized constructor
impl<D, DIR, STEP> MotorDriver<D, DIR, STEP, drv8834> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
pub fn drv8834(
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
[src]
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
Specialized constructor
impl<D, DIR, STEP> MotorDriver<D, DIR, STEP, drv8880> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
pub fn drv8880(
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
[src]
delay: D,
dir_pin: DIR,
step_pin: STEP,
number_of_steps: u16,
step_division: u8,
rpm: f32
) -> Self
Specialized constructor
Trait Implementations
impl<D: Debug, DIR: Debug, STEP: Debug, CHIP: Debug> Debug for MotorDriver<D, DIR, STEP, CHIP> where
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
CHIP: Params,
[src]
D: DelayUs<u32>,
DIR: OutputPin,
STEP: OutputPin,
CHIP: Params,