Struct stm32f4xx_hal::spi::Spi [−][src]
pub struct Spi<SPI, PINS, TRANSFER_MODE> { /* fields omitted */ }
Implementations
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI1, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI1, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI1, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI1, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI1, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI1, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI1, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI1, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI2, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI2, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI2, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI2, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI2, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI2, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI2, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI2, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI3, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI3, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI3, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI3, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI3, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI3, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI3, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI3, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI4, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI4, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI4, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI4, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI4, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI4, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI4, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI4, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI5, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI5, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI5, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI5, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI5, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI5, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI5, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI5, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI6, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI6, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI6, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI6, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI6, (SCK, MISO, MOSI), TransferModeNormal> where
SCK: PinSck<SPI6, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI6, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI6, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TransferModeNormal> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TransferModeNormal> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TransferModeBidi> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TransferModeBidi> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, TRANSFER_MODE, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TRANSFER_MODE> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
impl<SPI, SCK, MISO, MOSI, TRANSFER_MODE, const SCKA: u8, const MISOA: u8, const MOSIA: u8> Spi<SPI, (SCK, MISO, MOSI), TRANSFER_MODE> where
SPI: Instance,
SCK: PinSck<SPI, A = Const<SCKA>> + SetAlternate<SCKA>,
MISO: PinMiso<SPI, A = Const<MISOA>> + SetAlternate<MISOA>,
MOSI: PinMosi<SPI, A = Const<MOSIA>> + SetAlternate<MOSIA>,
Pre initializing the SPI bus.
Enable interrupts for the given event
:
- Received data ready to be read (RXNE)
- Transmit data register empty (TXE)
- Transfer error
Disable interrupts for the given event
:
- Received data ready to be read (RXNE)
- Transmit data register empty (TXE)
- Transfer error
Return true
if the TXE flag is set, i.e. new data to transmit
can be written to the SPI.
Return true
if the RXNE flag is set, i.e. new data has been received
and can be read from the SPI.
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)
Trait Implementations
impl<SPI, PINS> Write<u8> for Spi<SPI, PINS, TransferModeNormal> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> Write<u8> for Spi<SPI, PINS, TransferModeNormal> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> Write<u8> for Spi<SPI, PINS, TransferModeBidi> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> Write<u8> for Spi<SPI, PINS, TransferModeBidi> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> WriteIter<u8> for Spi<SPI, PINS, TransferModeNormal> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> WriteIter<u8> for Spi<SPI, PINS, TransferModeNormal> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
Sends words
to the slave, ignoring all the incoming words
impl<SPI, PINS> WriteIter<u8> for Spi<SPI, PINS, TransferModeBidi> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
impl<SPI, PINS> WriteIter<u8> for Spi<SPI, PINS, TransferModeBidi> where
Self: FullDuplex<u8, Error = Error>,
SPI: Instance,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
Sends words
to the slave, ignoring all the incoming words