[][src]Struct stm32f1xx_hal::spi::Spi

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

Implementations

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

pub fn spi1<F, POS>(
    spi: SPI1,
    pins: PINS,
    mapr: &mut MAPR,
    mode: Mode,
    freq: F,
    clocks: Clocks,
    apb: &mut APB2
) -> Self where
    F: Into<Hertz>,
    REMAP: Remap<Periph = SPI1>,
    PINS: Pins<REMAP, POS>, 
[src]

Constructs an SPI instance using SPI1 in 8bit dataframe mode.

The pin parameter tuple (sck, miso, mosi) should be (PA5, PA6, PA7) or (PB3, PB4, PB5) configured as (Alternate<PushPull>, Input<Floating>, Alternate<PushPull>).

You can also use NoSck, NoMiso or NoMosi if you don't want to use the pins

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

pub fn spi2<F, POS>(
    spi: SPI2,
    pins: PINS,
    mode: Mode,
    freq: F,
    clocks: Clocks,
    apb: &mut APB1
) -> Self where
    F: Into<Hertz>,
    REMAP: Remap<Periph = SPI2>,
    PINS: Pins<REMAP, POS>, 
[src]

Constructs an SPI instance using SPI2 in 8bit dataframe mode.

The pin parameter tuple (sck, miso, mosi) should be (PB13, PB14, PB15) configured as (Alternate<PushPull>, Input<Floating>, Alternate<PushPull>).

You can also use NoSck, NoMiso or NoMosi if you don't want to use the pins

impl<SPI, REMAP, PINS, FrameSize> Spi<SPI, REMAP, PINS, FrameSize> where
    SPI: Deref<Target = SpiRegisterBlock>,
    FrameSize: Copy
[src]

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

👎 Deprecated since 0.6.0:

Please use release instead

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

impl<SPI, REMAP, PINS> Spi<SPI, REMAP, PINS, u8> where
    SPI: Deref<Target = SpiRegisterBlock> + Enable + Reset,
    SPI::Bus: GetBusFreq
[src]

pub fn frame_size_16bit(self) -> Spi<SPI, REMAP, PINS, u16>[src]

Converts from 8bit dataframe to 16bit.

impl<SPI, REMAP, PINS> Spi<SPI, REMAP, PINS, u16> where
    SPI: Deref<Target = SpiRegisterBlock>, 
[src]

pub fn frame_size_8bit(self) -> Spi<SPI, REMAP, PINS, u8>[src]

Converts from 16bit dataframe to 8bit.

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

pub fn with_tx_dma(self, channel: C3) -> SpiTxDma<SPI1, REMAP, PINS, C3>[src]

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

pub fn with_tx_dma(self, channel: C5) -> SpiTxDma<SPI2, REMAP, PINS, C5>[src]

Trait Implementations

impl<SPI, REMAP, PINS, FrameSize> Default<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
    SPI: Deref<Target = SpiRegisterBlock>,
    FrameSize: Copy
[src]

impl<SPI, REMAP, PINS, FrameSize> FullDuplex<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
    SPI: Deref<Target = SpiRegisterBlock>,
    FrameSize: Copy
[src]

type Error = Error

An enumeration of SPI errors

impl<SPI, REMAP, PINS, FrameSize> SpiReadWrite<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
    SPI: Deref<Target = SpiRegisterBlock>,
    FrameSize: Copy
[src]

impl<SPI, REMAP, PINS> Write<u16> for Spi<SPI, REMAP, PINS, u16> where
    SPI: Deref<Target = SpiRegisterBlock>, 
[src]

type Error = Error

Error type

impl<SPI, REMAP, PINS> Write<u8> for Spi<SPI, REMAP, PINS, u8> where
    SPI: Deref<Target = SpiRegisterBlock>, 
[src]

type Error = Error

Error type

Auto Trait Implementations

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

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

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

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

Error type

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<W, S> Write<W> for S where
    S: Default<W>,
    W: Clone
[src]

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

Error type