pub struct Spi<SPI, PINS> { /* private fields */ }
Implementations§
Source§impl<SPI, PINS> Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
impl<SPI, PINS> Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
pub fn init(self, mode: Mode, freq: Hertz, clock: Hertz) -> Self
Sourcepub fn listen(&mut self, event: Event)
pub fn listen(&mut self, event: Event)
Enable interrupts for the given event
:
- Received data ready to be read (RXNE)
- Transmit data register empty (TXE)
- Transfer error
Sourcepub fn unlisten(&mut self, event: Event)
pub fn unlisten(&mut self, event: Event)
Disable interrupts for the given event
:
- Received data ready to be read (RXNE)
- Transmit data register empty (TXE)
- Transfer error
Sourcepub fn is_txe(&self) -> bool
pub fn is_txe(&self) -> bool
Return true
if the TXE flag is set, i.e. new data to transmit
can be written to the SPI.
Sourcepub fn is_rxne(&self) -> bool
pub fn is_rxne(&self) -> bool
Return true
if the RXNE flag is set, i.e. new data has been received
and can be read from the SPI.
Sourcepub fn is_modf(&self) -> bool
pub fn is_modf(&self) -> bool
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)
Sourcepub fn is_ovr(&self) -> bool
pub fn is_ovr(&self) -> bool
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)
Trait Implementations§
Source§impl<SPI, PINS> FullDuplex<u8> for Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
impl<SPI, PINS> FullDuplex<u8> for Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
impl<SPI, PINS> Default<u8> for Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
impl<SPI, PINS> Default<u8> for Spi<SPI, PINS>where
SPI: Deref<Target = RegisterBlock>,
Auto Trait Implementations§
impl<SPI, PINS> Freeze for Spi<SPI, PINS>
impl<SPI, PINS> RefUnwindSafe for Spi<SPI, PINS>where
SPI: RefUnwindSafe,
PINS: RefUnwindSafe,
impl<SPI, PINS> Send for Spi<SPI, PINS>
impl<SPI, PINS> Sync for Spi<SPI, PINS>
impl<SPI, PINS> Unpin for Spi<SPI, PINS>
impl<SPI, PINS> UnwindSafe for Spi<SPI, PINS>where
SPI: UnwindSafe,
PINS: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more