pub struct MotorDriverBuilder<E1, E2, P1, P2> { /* private fields */ }Implementations§
Source§impl<E1, E2, P1, P2> MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> MotorDriverBuilder<E1, E2, P1, P2>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new motor driver builder with default settings.
§Example
let builder = MotorDriverBuilder::new()
.with_single_enable(enable_pin)
.with_single_pwm(pwm_channel, 1000);pub fn with_single_enable(self, enable: E1) -> Self
Sourcepub fn with_dual_enable(self, enable1: E1, enable2: E2) -> Self
pub fn with_dual_enable(self, enable1: E1, enable2: E2) -> Self
pub fn with_single_pwm(self, pwm: P1) -> Self
pub fn with_dual_pwm(self, pwm1: P1, pwm2: P2) -> Self
pub fn with_enable_pins(self, pins: EnablePins<E1, E2>) -> Self
pub fn with_pwm_channels(self, channels: PwmChannels<P1, P2>) -> Self
pub fn with_max_duty(self, max_duty: u16) -> Self
pub fn with_initial_speed(self, speed: i16) -> Self
pub fn with_initial_direction(self, direction: MotorDirection) -> Self
pub fn with_ppr(self, ppr: i16) -> Self
pub fn build(self) -> MotorDriverWrapper<E1, E2, P1, P2>
pub fn build_and_init( self, ) -> Result<MotorDriverWrapper<E1, E2, P1, P2>, MotorDriverError>
Trait Implementations§
Auto Trait Implementations§
impl<E1, E2, P1, P2> Freeze for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> RefUnwindSafe for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> Send for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> Sync for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> Unpin for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> UnsafeUnpin for MotorDriverBuilder<E1, E2, P1, P2>
impl<E1, E2, P1, P2> UnwindSafe for MotorDriverBuilder<E1, E2, P1, P2>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more