Struct Spi

Source
pub struct Spi<'d, T, M> { /* private fields */ }
Expand description

SPI peripheral driver

Implementations§

Source§

impl<'d, T> Spi<'d, T, FullDuplexMode>
where T: Instance,

Source

pub fn new<SCK, MOSI, MISO, CS>( spi: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = SCK> + 'd, mosi: impl Peripheral<P = MOSI> + 'd, miso: impl Peripheral<P = MISO> + 'd, cs: impl Peripheral<P = CS> + 'd, mode: SpiMode, ) -> Spi<'d, T, FullDuplexMode>
where SCK: InputPin, MOSI: InputPin, MISO: OutputPin, CS: InputPin,

Constructs an SPI instance in 8bit dataframe mode.

Trait Implementations§

Source§

impl<'d, C> WithDmaSpi2<'d, C> for Spi<'d, SPI2, FullDuplexMode>

Source§

fn with_dma(self, channel: Channel<'d, C>) -> SpiDma<'d, SPI2, C>

Auto Trait Implementations§

§

impl<'d, T, M> Freeze for Spi<'d, T, M>
where T: Freeze,

§

impl<'d, T, M> RefUnwindSafe for Spi<'d, T, M>

§

impl<'d, T, M> Send for Spi<'d, T, M>
where T: Send, M: Send,

§

impl<'d, T, M> Sync for Spi<'d, T, M>
where T: Sync, M: Sync,

§

impl<'d, T, M> Unpin for Spi<'d, T, M>
where T: Unpin, M: Unpin,

§

impl<'d, T, M> !UnwindSafe for Spi<'d, T, M>

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.