Struct stm32l4xx_hal::spi::Spi
source · [−]pub struct Spi<SPI, PINS> { /* private fields */ }
Expand description
SPI peripheral operating in full duplex master mode
Implementations
sourceimpl<SCK, MISO, MOSI> Spi<SPI1, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI1, (SCK, MISO, MOSI)>
sourcepub fn spi1(
spi: SPI1,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI1 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI1>,
MISO: MisoPin<SPI1>,
MOSI: MosiPin<SPI1>,
pub fn spi1(
spi: SPI1,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI1 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI1>,
MISO: MisoPin<SPI1>,
MOSI: MosiPin<SPI1>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn spi1_slave(
spi: SPI1,
pins: (SCK, MISO, MOSI),
mode: Mode,
apb2: &mut <SPI1 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI1>,
MISO: MisoPin<SPI1>,
MOSI: MosiPin<SPI1>,
pub fn clear_overrun(&mut self)
sourceimpl<SCK, MISO, MOSI> Spi<SPI3, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI3, (SCK, MISO, MOSI)>
sourcepub fn spi3(
spi: SPI3,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI3 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI3>,
MISO: MisoPin<SPI3>,
MOSI: MosiPin<SPI3>,
pub fn spi3(
spi: SPI3,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI3 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI3>,
MISO: MisoPin<SPI3>,
MOSI: MosiPin<SPI3>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn spi3_slave(
spi: SPI3,
pins: (SCK, MISO, MOSI),
mode: Mode,
apb2: &mut <SPI3 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI3>,
MISO: MisoPin<SPI3>,
MOSI: MosiPin<SPI3>,
pub fn clear_overrun(&mut self)
sourceimpl<SCK, MISO, MOSI> Spi<SPI2, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI2, (SCK, MISO, MOSI)>
sourcepub fn spi2(
spi: SPI2,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI2 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI2>,
MISO: MisoPin<SPI2>,
MOSI: MosiPin<SPI2>,
pub fn spi2(
spi: SPI2,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: Hertz,
clocks: Clocks,
apb2: &mut <SPI2 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI2>,
MISO: MisoPin<SPI2>,
MOSI: MosiPin<SPI2>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn spi2_slave(
spi: SPI2,
pins: (SCK, MISO, MOSI),
mode: Mode,
apb2: &mut <SPI2 as RccBus>::Bus
) -> Self where
SCK: SckPin<SPI2>,
MISO: MisoPin<SPI2>,
MOSI: MosiPin<SPI2>,
pub fn clear_overrun(&mut self)
Trait Implementations
sourceimpl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>
impl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>
sourceimpl<PINS> FullDuplex<u8> for Spi<SPI3, PINS>
impl<PINS> FullDuplex<u8> for Spi<SPI3, PINS>
sourceimpl<PINS> FullDuplex<u8> for Spi<SPI2, PINS>
impl<PINS> FullDuplex<u8> for Spi<SPI2, PINS>
impl<PINS> Default<u8> for Spi<SPI1, PINS>
impl<PINS> Default<u8> for Spi<SPI1, PINS>
impl<PINS> Default<u8> for Spi<SPI3, PINS>
impl<PINS> Default<u8> for Spi<SPI3, PINS>
impl<PINS> Default<u8> for Spi<SPI2, PINS>
impl<PINS> Default<u8> for Spi<SPI2, PINS>
Auto Trait Implementations
impl<SPI, PINS> RefUnwindSafe for Spi<SPI, PINS> where
PINS: RefUnwindSafe,
SPI: RefUnwindSafe,
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,
impl<SPI, PINS> UnwindSafe for Spi<SPI, PINS> where
PINS: UnwindSafe,
SPI: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<W, S> Transfer<W> for S where
S: Default<W>,
W: Clone,
impl<W, S> Transfer<W> for S where
S: Default<W>,
W: Clone,
type Error = <S as FullDuplex<W>>::Error
type Error = <S as FullDuplex<W>>::Error
Error type
sourcefn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
fn transfer(
&mut self,
words: &'w mut [W]
) -> Result<&'w [W], <S as FullDuplex<W>>::Error>
Sends words
to the slave. Returns the words
received from the slave