[][src]Struct nucleo_f401re::spi::Spi

pub struct Spi<SPI, PINS> { /* fields omitted */ }

Methods

impl<PINS> Spi<SPI1, PINS>[src]

pub fn spi1(
    spi: SPI1,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Spi<SPI1, PINS> where
    PINS: Pins<SPI1>, 
[src]

impl<PINS> Spi<SPI2, PINS>[src]

pub fn spi2(
    spi: SPI2,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Spi<SPI2, PINS> where
    PINS: Pins<SPI2>, 
[src]

impl<PINS> Spi<SPI3, PINS>[src]

pub fn spi3(
    spi: SPI3,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Spi<SPI3, PINS> where
    PINS: Pins<SPI3>, 
[src]

impl<PINS> Spi<SPI4, PINS>[src]

pub fn spi4(
    spi: SPI4,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Spi<SPI4, PINS> where
    PINS: Pins<SPI4>, 
[src]

impl<SPI, PINS> Spi<SPI, PINS> where
    SPI: Deref<Target = RegisterBlock>, 
[src]

pub fn init(self, mode: Mode, freq: Hertz, clock: Hertz) -> Spi<SPI, PINS>[src]

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

Enable interrupts for the given event:

  • Received data ready to be read (RXNE)
  • Transmit data register empty (TXE)
  • Transfer error

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

Disable interrupts for the given event:

  • Received data ready to be read (RXNE)
  • Transmit data register empty (TXE)
  • Transfer error

pub fn is_txe(&self) -> bool[src]

Return true if the TXE flag is set, i.e. new data to transmit can be written to the SPI.

pub fn is_rxne(&self) -> bool[src]

Return true if the RXNE flag is set, i.e. new data has been received and can be read from the SPI.

pub fn is_modf(&self) -> bool[src]

Return true if the MODF flag is set, i.e. the SPI has experienced a Master Mode Fault. (see chapter 28.3.10 of the STM32F4 Reference Manual)

pub fn is_ovr(&self) -> bool[src]

Return true if the OVR flag is set, i.e. new data has been received while the receive data register was already filled.

pub fn free(self) -> (SPI, PINS)[src]

Trait Implementations

impl<SPI, PINS> Default<u8> for Spi<SPI, PINS> where
    SPI: Deref<Target = RegisterBlock>, 
[src]

impl<SPI, PINS> Default<u8> for Spi<SPI, PINS> where
    SPI: Deref<Target = RegisterBlock>, 
[src]

impl<SPI, PINS> Debug for Spi<SPI, PINS> where
    PINS: Debug,
    SPI: Debug
[src]

impl<SPI, PINS> FullDuplex<u8> for Spi<SPI, PINS> where
    SPI: Deref<Target = RegisterBlock>, 
[src]

type Error = Error

An enumeration of SPI errors

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

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

Error type

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

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

Error type

impl<T> Same for T

type Output = T

Should always be Self