Skip to main content

MotorDriverWrapper

Struct MotorDriverWrapper 

Source
pub struct MotorDriverWrapper<E1, E2, P1, P2> { /* private fields */ }

Implementations§

Source§

impl<E1, E2, P1, P2> MotorDriverWrapper<E1, E2, P1, P2>
where E1: OutputPin, E2: OutputPin, P1: SetDutyCycle, P2: SetDutyCycle,

Source

pub fn builder() -> MotorDriverBuilder<E1, E2, P1, P2>

Trait Implementations§

Source§

impl<E1, E2, P1, P2> MotorDriver for MotorDriverWrapper<E1, E2, P1, P2>
where E1: OutputPin, E2: OutputPin, P1: SetDutyCycle, P2: SetDutyCycle,

Source§

type Error = MotorDriverError

The error type returned by this driver’s operations.
Source§

fn initialize(&mut self) -> Result<(), Self::Error>

Initializes the motor driver hardware. Read more
Source§

fn set_speed(&mut self, speed: i16) -> Result<(), Self::Error>

Sets the motor speed and direction. Read more
Source§

fn set_direction(&mut self, forward: bool) -> Result<(), Self::Error>

Sets the motor direction without changing speed magnitude. Read more
Source§

fn stop(&mut self) -> Result<(), Self::Error>

Stops the motor by setting PWM to zero (coast stop). Read more
Source§

fn brake(&mut self) -> Result<(), Self::Error>

Applies active braking to the motor. Read more
Source§

fn enable(&mut self) -> Result<(), Self::Error>

Enables the motor driver. Read more
Source§

fn disable(&mut self) -> Result<(), Self::Error>

Disables the motor driver. Read more
Source§

fn get_speed(&self) -> Result<i16, Self::Error>

Gets the current motor speed setting. Read more
Source§

fn get_direction(&self) -> Result<bool, Self::Error>

Gets the current motor direction. Read more
Source§

fn get_current(&self) -> Result<f32, Self::Error>

Gets the current motor current consumption. Read more
Source§

fn get_voltage(&self) -> Result<f32, Self::Error>

Gets the current motor supply voltage. Read more
Source§

fn get_temperature(&self) -> Result<f32, Self::Error>

Gets the current motor driver temperature. Read more
Source§

fn get_fault_status(&self) -> Result<u8, Self::Error>

Gets the current fault status of the motor driver. Read more
Source§

fn set_ppr(&mut self, ppr: i16) -> Result<bool, Self::Error>

Sets the pulses per revolution for encoder calculations. Read more
Source§

fn check_ppr(&mut self) -> Result<(), Self::Error>

Checks if the encoder pulse count matches the target position. Read more

Auto Trait Implementations§

§

impl<E1, E2, P1, P2> Freeze for MotorDriverWrapper<E1, E2, P1, P2>
where E1: Freeze, E2: Freeze, P1: Freeze, P2: Freeze,

§

impl<E1, E2, P1, P2> RefUnwindSafe for MotorDriverWrapper<E1, E2, P1, P2>

§

impl<E1, E2, P1, P2> Send for MotorDriverWrapper<E1, E2, P1, P2>
where E1: Send, E2: Send, P1: Send, P2: Send,

§

impl<E1, E2, P1, P2> Sync for MotorDriverWrapper<E1, E2, P1, P2>
where E1: Sync, E2: Sync, P1: Sync, P2: Sync,

§

impl<E1, E2, P1, P2> Unpin for MotorDriverWrapper<E1, E2, P1, P2>
where E1: Unpin, E2: Unpin, P1: Unpin, P2: Unpin,

§

impl<E1, E2, P1, P2> UnsafeUnpin for MotorDriverWrapper<E1, E2, P1, P2>

§

impl<E1, E2, P1, P2> UnwindSafe for MotorDriverWrapper<E1, E2, P1, P2>
where E1: UnwindSafe, E2: UnwindSafe, P1: UnwindSafe, P2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.