Trait ChipSelectGuarded

Source
pub trait ChipSelectGuarded: ChipSelect {
    type Guard<'a>
       where Self: 'a;

    // Required method
    fn select_guard(&mut self) -> Self::Guard<'_>;
}
Expand description

A chip-select trait.

Required Associated Types§

Source

type Guard<'a> where Self: 'a

A guard that, when dropped, deselects the chip.

Required Methods§

Source

fn select_guard(&mut self) -> Self::Guard<'_>

Selects the device and returns a guard that, when dropped, deselects the chip.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Pin> ChipSelectGuarded for ChipSelectActiveHigh<Pin>
where Pin: OutputPin,

Source§

type Guard<'a> = DeselectOnDrop<'a, ChipSelectActiveHigh<Pin>> where Pin: 'a

Source§

impl<Pin> ChipSelectGuarded for ChipSelectActiveLow<Pin>
where Pin: OutputPin,

Source§

type Guard<'a> = DeselectOnDrop<'a, ChipSelectActiveLow<Pin>> where Pin: 'a