pub struct ChipSelectPolar<'a, P: Output> {
pub pin: &'a P,
pub polarity: Polarity,
}
Expand description
A convenience wrapper type around Output
GPIO pins that implements IntoChipSelect
for both ActiveLow
and
ActiveHigh
.
Fields§
§pin: &'a P
The underlying chip select “pin”.
polarity: Polarity
The polarity from which this wrapper was derived using
IntoChipSelect
.
Implementations§
Source§impl<P: Output> ChipSelectPolar<'_, P>
impl<P: Output> ChipSelectPolar<'_, P>
When wrapping a GPIO pin that implements
gpio::Output
, users can use the
activate
and
deactivate
methods to automatically set
or clear the chip select pin based on the stored polarity.
Sourcepub fn deactivate(&self)
pub fn deactivate(&self)
Deactivate the chip select pin.
High if active low, low if active high.
Trait Implementations§
Source§impl<P: Output> Clone for ChipSelectPolar<'_, P>
impl<P: Output> Clone for ChipSelectPolar<'_, P>
Source§impl<'a, P: Output, A: ChipSelectActivePolarity> IntoChipSelect<ChipSelectPolar<'a, P>, A> for &'a P
impl<'a, P: Output, A: ChipSelectActivePolarity> IntoChipSelect<ChipSelectPolar<'a, P>, A> for &'a P
fn into_cs(self) -> ChipSelectPolar<'a, P>
impl<P: Output> Copy for ChipSelectPolar<'_, P>
Auto Trait Implementations§
impl<'a, P> Freeze for ChipSelectPolar<'a, P>
impl<'a, P> RefUnwindSafe for ChipSelectPolar<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for ChipSelectPolar<'a, P>where
P: Sync,
impl<'a, P> Sync for ChipSelectPolar<'a, P>where
P: Sync,
impl<'a, P> Unpin for ChipSelectPolar<'a, P>
impl<'a, P> UnwindSafe for ChipSelectPolar<'a, P>where
P: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more