Type Alias SplitDriverType

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

Aliased Type§

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

Implementations§

Source§

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

Source

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

Creates a new MotorDriver instance with split control mode.

In split mode, each bridge of the motor driver can be controlled independently.

§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_split(
    in1, in2, in3, in4, Some(sleep), None::<PinDriver<AnyInputPin, Input>>,
);