[−][src]Struct e310x_hal::spi::Spi
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]
spi: SPI,
pins: PINS,
mode: Mode,
freq: Hertz,
clocks: Clocks
) -> Self where
PINS: Pins<SPI>,
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]
spi: QSPI0,
pins: PINS,
mode: Mode,
freq: Hertz,
clocks: Clocks
) -> Self where
PINS: Pins<QSPI0>,
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]
spi: QSPI1,
pins: PINS,
mode: Mode,
freq: Hertz,
clocks: Clocks
) -> Self where
PINS: Pins<QSPI1>,
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]
spi: QSPI2,
pins: PINS,
mode: Mode,
freq: Hertz,
clocks: Clocks
) -> Self where
PINS: Pins<QSPI2>,
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
fn read(&mut self) -> Result<u8, Infallible>
[src]
fn send(&mut self, byte: u8) -> Result<(), Infallible>
[src]
impl<SPI: SpiX, PINS> Transfer<u8> for Spi<SPI, PINS>
[src]
type Error = Infallible
Error type
fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error>
[src]
impl<SPI: SpiX, PINS> Write<u8> for Spi<SPI, PINS>
[src]
impl<SPI: SpiX, PINS> WriteIter<u8> for Spi<SPI, PINS>
[src]
type Error = Infallible
Error type
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
[src]
WI: IntoIterator<Item = u8>,
Auto Trait Implementations
impl<SPI, PINS> Send for Spi<SPI, PINS> where
PINS: Send,
SPI: Send,
PINS: Send,
SPI: Send,
impl<SPI, PINS> Sync for Spi<SPI, PINS> where
PINS: Sync,
SPI: Sync,
PINS: Sync,
SPI: Sync,
impl<SPI, PINS> Unpin for Spi<SPI, PINS> where
PINS: Unpin,
SPI: Unpin,
PINS: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<W, S> Transfer<W> for S where
S: Default<W>,
W: Clone,
[src]
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
Error type
fn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
[src]
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<W, S> Write<W> for S where
S: Default<W>,
W: Clone,
[src]
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
Error type
fn write(&mut self, words: &[W]) -> Result<(), <S as FullDuplex<W>>::Error>
[src]
impl<W, S> WriteIter<W> for S where
S: Default<W>,
W: Clone,
[src]
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
Error type
fn write_iter<WI>(
&mut self,
words: WI
) -> Result<(), <S as FullDuplex<W>>::Error> where
WI: IntoIterator<Item = W>,
[src]
&mut self,
words: WI
) -> Result<(), <S as FullDuplex<W>>::Error> where
WI: IntoIterator<Item = W>,