Spi

Struct Spi 

Source
pub struct Spi<SPI, PINS> { /* private fields */ }
Expand description

SPI abstraction

Implementations§

Source§

impl<PINS> Spi<SPI1, PINS>

Source

pub fn spi1<F>( spi: SPI1, pins: PINS, mode: Mode, speed: F, clocks: Clocks, ) -> Self
where PINS: Pins<SPI1>, F: Into<Hertz>,

Source

pub fn release(self) -> (SPI1, PINS)

Trait Implementations§

Source§

impl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>

Source§

type Error = Error

An enumeration of SPI errors
Source§

fn read(&mut self) -> Result<u8, Error>

Reads the word stored in the shift register Read more
Source§

fn send(&mut self, byte: u8) -> Result<(), Error>

Sends a word to the slave
Source§

impl<PINS> Default<u8> for Spi<SPI1, PINS>

Source§

impl<PINS> Default<u8> for Spi<SPI1, PINS>

Auto Trait Implementations§

§

impl<SPI, PINS> Freeze for Spi<SPI, PINS>
where SPI: Freeze, PINS: Freeze,

§

impl<SPI, PINS> RefUnwindSafe for Spi<SPI, PINS>
where SPI: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<SPI, PINS> Send for Spi<SPI, PINS>
where SPI: Send, PINS: Send,

§

impl<SPI, PINS> Sync for Spi<SPI, PINS>
where SPI: Sync, PINS: Sync,

§

impl<SPI, PINS> Unpin for Spi<SPI, PINS>
where SPI: Unpin, PINS: Unpin,

§

impl<SPI, PINS> UnwindSafe for Spi<SPI, PINS>
where SPI: UnwindSafe, PINS: 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.
Source§

impl<W, S> Transfer<W> for S
where S: Default<W>, W: Clone,

Source§

type Error = <S as FullDuplex<W>>::Error

Error type
Source§

fn transfer<'w>( &mut self, words: &'w mut [W], ) -> Result<&'w [W], <S as FullDuplex<W>>::Error>

Sends words to the slave. Returns the words received from the slave
Source§

impl<W, S> Write<W> for S
where S: Default<W>, W: Clone,

Source§

type Error = <S as FullDuplex<W>>::Error

Error type
Source§

fn write(&mut self, words: &[W]) -> Result<(), <S as FullDuplex<W>>::Error>

Sends words to the slave, ignoring all the incoming words