Struct ChipSelectActiveLow

Source
pub struct ChipSelectActiveLow<Pin>(/* private fields */);
Expand description

A chip select pin with active-low behavior.

Implementations§

Source§

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

Source

pub const fn new(pin: Pin) -> Self

Initialize the chip select.

Source

pub fn select(&mut self)

Selects the chip, driving the line low.

Source

pub fn deselect(&mut self)

Deselects the chip, driving the line high.

Source

pub fn into_inner(self) -> Pin

Consumes self and returns the wrapped pin.

Source

pub fn select_guard(&mut self) -> DeselectOnDrop<'_, Self>

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

Trait Implementations§

Source§

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

Source§

fn select(&mut self)

Selects the chip, driving the line low.
Source§

fn deselect(&mut self)

Deselects the chip, driving the line high.
Source§

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

Source§

fn select_guard(&mut self) -> DeselectOnDrop<'_, Self>

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

Source§

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

A guard that, when dropped, deselects the chip.
Source§

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

Source§

fn from(value: Pin) -> Self

Converts to this type from the input type.
Source§

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

Auto Trait Implementations§

§

impl<Pin> Freeze for ChipSelectActiveLow<Pin>
where Pin: Freeze,

§

impl<Pin> RefUnwindSafe for ChipSelectActiveLow<Pin>
where Pin: RefUnwindSafe,

§

impl<Pin> Send for ChipSelectActiveLow<Pin>
where Pin: Send,

§

impl<Pin> Sync for ChipSelectActiveLow<Pin>
where Pin: Sync,

§

impl<Pin> Unpin for ChipSelectActiveLow<Pin>
where Pin: Unpin,

§

impl<Pin> UnwindSafe for ChipSelectActiveLow<Pin>
where Pin: 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.