atsamd_hal::sercom::i2c

Struct Pads

Source
pub struct Pads<S, SDA, SCL>
where S: Sercom, SDA: IsI2cPad<PadNum = Pad0, Sercom = S>, SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,
{ /* private fields */ }
Expand description

Container for a set of SERCOM Pads

See the module-level documentation for more details on specifying a Pads type and creating instances.

Implementations§

Source§

impl<S, DI, CI> Pads<S, Pin<DI, <DI as GetPad<S, Pad0>>::PinMode>, Pin<CI, <CI as GetPad<S, Pad1>>::PinMode>>
where S: Sercom, DI: GetPad<S, Pad0>, CI: GetPad<S, Pad1>, Pad<S, Pad0, DI>: IsI2cPad<PadNum = Pad0, Sercom = S>, Pad<S, Pad1, CI>: IsI2cPad<PadNum = Pad1, Sercom = S>,

Source

pub fn new(sda: impl AnyPin<Id = DI>, scl: impl AnyPin<Id = CI>) -> Self

Create a new Pads struct. SDA must always be SERCOM pad 0, and SCL SERCOM pad 1.{

Source§

impl<S, SDA, SCL> Pads<S, SDA, SCL>
where S: Sercom, SDA: IsI2cPad<PadNum = Pad0, Sercom = S>, SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,

Source

pub fn free(self) -> (SDA, SCL)

Consume the Pads and return each individual Pin

Trait Implementations§

Source§

impl<S, SDA, SCL> PadSet for Pads<S, SDA, SCL>
where S: Sercom, SDA: IsI2cPad<PadNum = Pad0, Sercom = S>, SCL: IsI2cPad<PadNum = Pad1, Sercom = S>,

Source§

type Sercom = S

Source§

type Sda = SDA

Source§

type Scl = SCL

Auto Trait Implementations§

§

impl<S, SDA, SCL> Freeze for Pads<S, SDA, SCL>
where SDA: Freeze, SCL: Freeze,

§

impl<S, SDA, SCL> RefUnwindSafe for Pads<S, SDA, SCL>

§

impl<S, SDA, SCL> Send for Pads<S, SDA, SCL>
where SDA: Send, SCL: Send, S: Send,

§

impl<S, SDA, SCL> Sync for Pads<S, SDA, SCL>
where SDA: Sync, SCL: Sync, S: Sync,

§

impl<S, SDA, SCL> Unpin for Pads<S, SDA, SCL>
where SDA: Unpin, SCL: Unpin, S: Unpin,

§

impl<S, SDA, SCL> UnwindSafe for Pads<S, SDA, SCL>
where SDA: UnwindSafe, SCL: UnwindSafe, S: 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> Same for T

Source§

type Output = T

Should always be Self
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.