Type Alias ParallelDriverType

Source
pub type ParallelDriverType<IN1, IN2, IN3, IN4, SLEEP, FAULT> = MotorDriver<ParallelDriver<IN1, IN2, IN3, IN4>, Option<SLEEP>, FAULT>;

Aliased Type§

pub struct ParallelDriverType<IN1, IN2, IN3, IN4, SLEEP, FAULT> { /* private fields */ }

Implementations§

Source§

impl<IN1, IN2, IN3, IN4, SLEEP, FAULT> ParallelDriverType<IN1, IN2, IN3, IN4, SLEEP, FAULT>
where IN1: OutputPin, IN2: OutputPin, IN3: OutputPin, IN4: OutputPin, SLEEP: OutputPin, FAULT: InputPin,

Source

pub fn new_parallel( in1: IN1, in2: IN2, in3: IN3, in4: IN4, sleep: Option<SLEEP>, fault: Option<FAULT>, ) -> ParallelDriverType<IN1, IN2, IN3, IN4, SLEEP, FAULT>
where IN1: OutputPin, IN2: OutputPin, IN3: OutputPin, IN4: OutputPin,

Creates a new instance of MotorDriver in parallel control mode.

In this mode, both bridges are driven with the same inputs, causing them to behave identically. The primary advantage of this mode is that it effectively doubles the current output when the bridges are physically connected in parallel, with IN1 connected to IN3 and IN2 connected to IN4.

§Example:
use drv8833_driver::driver::MotorDriver;

let in1 = PinDriver::output(peripherals.pins.gpio5)?;
let in2 = PinDriver::output(peripherals.pins.gpio4)?;
let in3 = PinDriver::output(peripherals.pins.gpio18)?;
let in4 = PinDriver::output(peripherals.pins.gpio19)?;
let sleep = PinDriver::output(peripherals.pins.gpio3)?;

let mut motor = MotorDriver::new_parallel(
    in1, in2, in3, in4, Some(sleep), None::<PinDriver<AnyInputPin, Input>>,
);