SpiInner

Struct SpiInner 

Source
pub struct SpiInner<SPI, W> { /* private fields */ }

Implementations§

Source§

impl<SPI: Instance, W> SpiInner<SPI, W>

Source

pub fn bit_format(&mut self, format: SpiBitFormat)

Select which frame format is used for data transfers

Source

pub fn listen(&mut self, event: Event)

Starts listening to the SPI by enabling the Received data ready to be read (RXNE) interrupt and Transmit data register empty (TXE) interrupt

Source

pub fn unlisten(&mut self, event: Event)

Stops listening to the SPI by disabling the Received data ready to be read (RXNE) interrupt and Transmit data register empty (TXE) interrupt

Source

pub fn is_tx_empty(&self) -> bool

Returns true if the tx register is empty (and can accept data)

Source

pub fn is_rx_not_empty(&self) -> bool

Returns true if the rx register is not empty (and can be read)

Source

pub fn is_busy(&self) -> bool

Returns true if the transfer is in progress

Source

pub fn is_overrun(&self) -> bool

Returns true if data are received and the previous data have not yet been read from SPI_DR.

Source§

impl<SPI, W> SpiInner<SPI, W>
where SPI: Instance, W: FrameSize,

Source

pub fn read_nonblocking(&mut self) -> Result<W, Error>

Source

pub fn write_nonblocking(&mut self, data: W) -> Result<(), Error>

Source

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

Source

pub fn transfer_in_place(&mut self, words: &mut [W]) -> Result<(), Error>

Source

pub fn transfer(&mut self, buff: &mut [W], data: &[W]) -> Result<(), Error>

Source

pub fn flush(&mut self) -> Result<(), Error>

Source

pub fn read(&mut self, words: &mut [W]) -> Result<(), Error>

Auto Trait Implementations§

§

impl<SPI, W> Freeze for SpiInner<SPI, W>
where SPI: Freeze,

§

impl<SPI, W> RefUnwindSafe for SpiInner<SPI, W>

§

impl<SPI, W> Send for SpiInner<SPI, W>
where SPI: Send, W: Send,

§

impl<SPI, W> Sync for SpiInner<SPI, W>
where SPI: Sync, W: Sync,

§

impl<SPI, W> Unpin for SpiInner<SPI, W>
where SPI: Unpin, W: Unpin,

§

impl<SPI, W> UnwindSafe for SpiInner<SPI, W>
where SPI: UnwindSafe, W: 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, const R: u8> RFrom<T, R> for T

Source§

fn rfrom(value: T) -> T

Source§

impl<S, T, const R: u8> RInto<T, R> for S
where T: RFrom<S, R>,

Source§

fn rinto(self) -> T

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.