Struct serpente::sercom::v2::spi::Pads

source ·
pub struct Pads<S, DI = NoneT, DO = NoneT, CK = NoneT, SS = NoneT>where
    S: Sercom,
    DI: OptionalPad,
    DO: OptionalPad,
    CK: OptionalPad,
    SS: OptionalPad,{ /* private fields */ }
Expand description

Container for a set of SERCOM pads

See the module-level documentation for more details on declaring and instantiating Pads types.

Implementations§

source§

impl<S, DI, DO, CK, SS> Pads<S, DI, DO, CK, SS>where S: Sercom, DI: OptionalPad, DO: OptionalPad, CK: OptionalPad, SS: OptionalPad,

source

pub fn free(self) -> (DI, DO, CK, SS)

Consume the Pads and return each individual Pin

source§

impl<S, DI, DO, CK, SS> Pads<S, DI, DO, CK, SS>where S: Sercom, DI: OptionalPad, DO: OptionalPad, CK: OptionalPad, SS: OptionalPad,

source

pub fn data_in<I>( self, pin: impl AnyPin<Id = I> ) -> Pads<S, Pin<I, <I as GetPad<S>>::PinMode>, DO, CK, SS>where I: GetPad<S>, Pin<I, <I as GetPad<S>>::PinMode>: IsPad,

Set the DI pad

In a MasterMode, this is MISO. In Slave OpMode, this is MOSI.

source

pub fn data_out<I>( self, pin: impl AnyPin<Id = I> ) -> Pads<S, DI, Pin<I, <I as GetPad<S>>::PinMode>, CK, SS>where I: GetPad<S>, Pin<I, <I as GetPad<S>>::PinMode>: IsPad,

Set the DO pad

In a MasterMode, this is MOSI. In Slave OpMode, this is MISO.

source

pub fn sclk<I>( self, pin: impl AnyPin<Id = I> ) -> Pads<S, DI, DO, Pin<I, <I as GetPad<S>>::PinMode>, SS>where I: GetPad<S>, Pin<I, <I as GetPad<S>>::PinMode>: IsPad,

Set the SCK pad

source

pub fn ss<I>( self, pin: impl AnyPin<Id = I> ) -> Pads<S, DI, DO, CK, Pin<I, <I as GetPad<S>>::PinMode>>where I: GetPad<S>, Pin<I, <I as GetPad<S>>::PinMode>: IsPad,

Set the SS pad

Trait Implementations§

source§

impl<S> Default for Pads<S, NoneT, NoneT, NoneT, NoneT>where S: Sercom,

source§

fn default() -> Pads<S, NoneT, NoneT, NoneT, NoneT>

Returns the “default value” for a type. Read more
source§

impl<S, DI, DO, CK, SS> DipoDopo for Pads<S, DI, DO, CK, SS>where S: Sercom, DI: OptionalPad, DO: OptionalPad, CK: OptionalPad, SS: OptionalPad, (<DI as OptionalPad>::PadNum, <DO as OptionalPad>::PadNum, <CK as OptionalPad>::PadNum, <SS as OptionalPad>::PadNum): DipoDopo,

Lift the implementations of DipoDopo from four-tuples of OptionalPadNums to the corresponding Pads types.

source§

const DIPO_DOPO: (u8, u8) = <(DI::PadNum, DO::PadNum, CK::PadNum, SS::PadNum)>::DIPO_DOPO

source§

impl<S, DI, DO, CK, SS> PadSet for Pads<S, DI, DO, CK, SS>where S: Sercom, DI: OptionalPad, DO: OptionalPad, CK: OptionalPad, SS: OptionalPad,

§

type Sercom = S

§

type DataIn = DI

§

type DataOut = DO

§

type Sclk = CK

§

type SS = SS

source§

impl<S, DI, DO, CK, SS> ValidPads for Pads<S, DI, DO, CK, SS>where S: Sercom, DI: SomePad, DO: SomePad, CK: SomePad, SS: OptionalPad, Pads<S, DI, DO, CK, SS>: DipoDopo,

source§

impl<S, DI, CK, SS> ValidPads for Pads<S, DI, NoneT, CK, SS>where S: Sercom, DI: SomePad, CK: SomePad, SS: OptionalPad, Pads<S, DI, NoneT, CK, SS>: DipoDopo,

source§

impl<S, DO, CK, SS> ValidPads for Pads<S, NoneT, DO, CK, SS>where S: Sercom, DO: SomePad, CK: SomePad, SS: OptionalPad, Pads<S, NoneT, DO, CK, SS>: DipoDopo,

Auto Trait Implementations§

§

impl<S, DI, DO, CK, SS> RefUnwindSafe for Pads<S, DI, DO, CK, SS>where CK: RefUnwindSafe, DI: RefUnwindSafe, DO: RefUnwindSafe, S: RefUnwindSafe, SS: RefUnwindSafe,

§

impl<S, DI, DO, CK, SS> Send for Pads<S, DI, DO, CK, SS>where CK: Send, DI: Send, DO: Send, S: Send, SS: Send,

§

impl<S, DI, DO, CK, SS> Sync for Pads<S, DI, DO, CK, SS>where CK: Sync, DI: Sync, DO: Sync, S: Sync, SS: Sync,

§

impl<S, DI, DO, CK, SS> Unpin for Pads<S, DI, DO, CK, SS>where CK: Unpin, DI: Unpin, DO: Unpin, S: Unpin, SS: Unpin,

§

impl<S, DI, DO, CK, SS> UnwindSafe for Pads<S, DI, DO, CK, SS>where CK: UnwindSafe, DI: UnwindSafe, DO: UnwindSafe, S: UnwindSafe, SS: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.