[][src]Struct e310x_hal::spi::Spi

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

SPI abstraction

Methods

impl<SPI: SpiX, PINS> Spi<SPI, PINS>[src]

pub fn new(
    spi: SPI,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Self where
    PINS: Pins<SPI>, 
[src]

Configures the SPI peripheral to operate in full duplex master mode Defaults to using AUTO CS in FRAME mode if PINS configuration allows it

pub fn set_tx_watermark(&mut self, value: u8)[src]

Sets transmit watermark level

pub fn set_rx_watermark(&mut self, value: u8)[src]

Sets receive watermark level

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

Returns transmit watermark event status

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

Returns receive watermark event status

pub fn listen_tx_wm(&mut self)[src]

Starts listening for transmit watermark interrupt event

pub fn listen_rx_wm(&mut self)[src]

Starts listening for receive watermark interrupt event

pub fn unlisten_tx_wm(&mut self)[src]

Stops listening for transmit watermark interrupt event

pub fn unlisten_rx_wm(&mut self)[src]

Stops listening for receive watermark interrupt event

pub fn cs_mode_word(&mut self)[src]

Set AUTO CS mode to per-word operation

pub fn cs_mode_frame(&mut self)[src]

Set AUTO CS mode to per-frame operation

pub fn end_transfer(&mut self)[src]

Finishes transfer by deasserting CS (only for hardware-controlled CS)

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

Releases the SPI peripheral and associated pins

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

pub fn spi0(
    spi: QSPI0,
    pins: PINS,
    mode: Mode,
    freq: Hertz,
    clocks: Clocks
) -> Self where
    PINS: Pins<QSPI0>, 
[src]

Deprecated:

Please use Spi::new function instead

Configures the SPI peripheral to operate in full duplex master mode

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

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

Deprecated:

Please use Spi::new function instead

Configures the SPI peripheral to operate in full duplex master mode

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

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

Deprecated:

Please use Spi::new function instead

Configures the SPI peripheral to operate in full duplex master mode

Trait Implementations

impl<SPI: SpiX, PINS> FullDuplex<u8> for Spi<SPI, PINS>[src]

type Error = Infallible

An enumeration of SPI errors

impl<SPI: SpiX, PINS> Transfer<u8> for Spi<SPI, PINS>[src]

type Error = Infallible

Error type

impl<SPI: SpiX, PINS> Write<u8> for Spi<SPI, PINS>[src]

type Error = Infallible

Error type

impl<SPI: SpiX, PINS> WriteIter<u8> for Spi<SPI, PINS>[src]

type Error = Infallible

Error type

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

impl<SPI, PINS> Unpin for Spi<SPI, PINS> where
    PINS: 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<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

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

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

Error type