Struct l298n::Motor [−][src]
pub struct Motor<INF, INS, PWM> where
INF: OutputPin,
INS: OutputPin,
PWM: PwmPin, { /* fields omitted */ }
Expand description
Struct for single bridge
Implementations
impl<INF, INS, PWM> Motor<INF, INS, PWM> where
INF: OutputPin,
INS: OutputPin,
PWM: PwmPin,
[src]
impl<INF, INS, PWM> Motor<INF, INS, PWM> where
INF: OutputPin,
INS: OutputPin,
PWM: PwmPin,
[src]pub fn new(in1: INF, in2: INS, pwm: PWM) -> Motor<INF, INS, PWM> where
INF: OutputPin,
INS: OutputPin,
PWM: PwmPin,
[src]
pub fn new(in1: INF, in2: INS, pwm: PWM) -> Motor<INF, INS, PWM> where
INF: OutputPin,
INS: OutputPin,
PWM: PwmPin,
[src]Creates a new single Motor
controller
pub fn brake(&mut self) -> &mut Self
[src]
pub fn brake(&mut self) -> &mut Self
[src]Brakes the motor - Fast Motor Stop with Ven = H then C = D Fast Motor Stop
pub fn stop(&mut self) -> &mut Self
[src]
pub fn stop(&mut self) -> &mut Self
[src]Stops the motor - Free Running Motor Stop Ven = L then with C = X ; D = X
pub fn forward(&mut self) -> &mut Self
[src]
pub fn forward(&mut self) -> &mut Self
[src]Makes the motor forward direction with Ven = H then C = H ; D = L Forward
pub fn reverse(&mut self) -> &mut Self
[src]
pub fn reverse(&mut self) -> &mut Self
[src]Makes the motor reverse direction with Ven = H then C = L ; D = H Reverse
pub fn get_max_duty(&self) -> PWM::Duty
[src]
pub fn get_max_duty(&self) -> PWM::Duty
[src]Returns the maximum
pub fn get_current_duty(&self) -> PWM::Duty
[src]
pub fn get_current_duty(&self) -> PWM::Duty
[src]Get the actual motor speed
Trait Implementations
Auto Trait Implementations
impl<INF, INS, PWM> Send for Motor<INF, INS, PWM> where
INF: Send,
INS: Send,
PWM: Send,
INF: Send,
INS: Send,
PWM: Send,
impl<INF, INS, PWM> Sync for Motor<INF, INS, PWM> where
INF: Sync,
INS: Sync,
PWM: Sync,
INF: Sync,
INS: Sync,
PWM: Sync,
impl<INF, INS, PWM> Unpin for Motor<INF, INS, PWM> where
INF: Unpin,
INS: Unpin,
PWM: Unpin,
INF: Unpin,
INS: Unpin,
PWM: Unpin,