Struct stm32f4xx_hal::pac::SPI2

source ·
pub struct SPI2 { /* private fields */ }
Expand description

Serial peripheral interface

Implementations§

source§

impl SPI2

source

pub const PTR: *const RegisterBlock = {0x40003800 as *const stm32f4::stm32f429::spi1::RegisterBlock}

Pointer to the register block

source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

Trait Implementations§

source§

impl Debug for SPI2

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for SPI2

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &<SPI2 as Deref>::Target

Dereferences the value.
source§

impl DualInstance for SPI2

§

type I2sExtPeripheral = I2S2EXT

The I2SEXT peripheral that extend the SPI peripheral
source§

impl Enable for SPI2

source§

fn enable(rcc: &RccRB)

Enables peripheral
source§

fn disable(rcc: &RccRB)

Disables peripheral
source§

fn is_enabled() -> bool

Check if peripheral enabled
source§

fn is_disabled() -> bool

Check if peripheral disabled
source§

unsafe fn enable_unchecked()

Safety Read more
source§

unsafe fn disable_unchecked()

Safety Read more
source§

impl I2sCommon for SPI2

§

type Ck = Ck

§

type Sd = Sd

§

type Ws = Ws

source§

impl I2sExtPin for SPI2

§

type ExtSd = ExtSd

source§

impl I2sFreq for SPI2

source§

fn i2s_freq(clocks: &Clocks) -> Hertz

source§

impl I2sMaster for SPI2

§

type Mck = Mck

source§

impl LPEnable for SPI2

source§

fn enable_in_low_power(rcc: &RccRB)

Enables peripheral in low power mode
source§

fn disable_in_low_power(rcc: &RccRB)

Disables peripheral in low power mode
source§

fn is_enabled_in_low_power() -> bool

Check if peripheral enabled in low power mode
source§

fn is_disabled_in_low_power() -> bool

Check if peripheral disabled in low power mode
source§

unsafe fn enable_in_low_power_unchecked()

Safety Read more
source§

unsafe fn disable_in_low_power_unchecked()

Safety Read more
source§

impl PeriAddress for SPI2

source§

fn address(&self) -> u32

Returns the address to be used by the DMA stream.
§

type MemSize = u8

Memory size of the peripheral.
source§

impl RccBus for SPI2

§

type Bus = APB1

Bus type;
source§

impl Reset for SPI2

source§

fn reset(rcc: &RccRB)

Resets peripheral
source§

unsafe fn reset_unchecked()

Safety Read more
source§

impl SpiCommon for SPI2

§

type Miso = Miso

§

type Mosi = Mosi

§

type Nss = Nss

§

type Sck = Sck

source§

impl DMASet<StreamX<DMA1, 3>, 0, PeripheralToMemory> for SPI2

source§

impl DMASet<StreamX<DMA1, 4>, 0, MemoryToPeripheral> for SPI2

source§

impl Instance for SPI2

source§

impl Instance for SPI2

source§

impl Send for SPI2

Auto Trait Implementations§

§

impl Freeze for SPI2

§

impl RefUnwindSafe for SPI2

§

impl !Sync for SPI2

§

impl Unpin for SPI2

§

impl UnwindSafe for SPI2

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> BusClock for T
where T: RccBus, <T as RccBus>::Bus: BusClock,

source§

fn clock(clocks: &Clocks) -> Rate<u32, 1, 1>

Calculates frequency depending on Clock state
source§

impl<T> BusTimerClock for T
where T: RccBus, <T as RccBus>::Bus: BusTimerClock,

source§

fn timer_clock(clocks: &Clocks) -> Rate<u32, 1, 1>

Calculates base frequency of timer depending on Clock state
source§

impl<SPI> DualI2sExt for SPI
where SPI: DualInstance,

source§

fn dual_i2s( self, i2s_ext: <SPI as DualInstance>::I2sExtPeripheral, pins: (impl Into<<SPI as I2sCommon>::Ws>, impl Into<<SPI as I2sCommon>::Ck>, impl Into<<SPI as I2sMaster>::Mck>, impl Into<<SPI as I2sCommon>::Sd>, impl Into<<SPI as I2sExtPin>::ExtSd>), clocks: &Clocks ) -> DualI2s<SPI>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<SPI> I2sExt for SPI
where SPI: Instance,

source§

fn i2s( self, pins: (impl Into<<SPI as I2sCommon>::Ws>, impl Into<<SPI as I2sCommon>::Ck>, impl Into<<SPI as I2sMaster>::Mck>, impl Into<<SPI as I2sCommon>::Sd>), clocks: &Clocks ) -> I2s<SPI>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<SPI> SpiExt for SPI
where SPI: Instance,

source§

fn spi( self, pins: (impl Into<<SPI as SpiCommon>::Sck>, impl Into<<SPI as SpiCommon>::Miso>, impl Into<<SPI as SpiCommon>::Mosi>), mode: impl Into<Mode>, freq: Rate<u32, 1, 1>, clocks: &Clocks ) -> Spi<SPI>

Enables the SPI clock, resets the peripheral, sets Alternate mode for pins and initialize the peripheral as SPI Master Normal mode.

§Note

Depending on freq you may need to set GPIO speed for pins (the Speed::Low is default for GPIO) before create Spi instance. Otherwise it may lead to the ‘wrong last bit in every received byte’ problem.

source§

fn spi_bidi( self, pins: (impl Into<<SPI as SpiCommon>::Sck>, impl Into<<SPI as SpiCommon>::Mosi>), mode: impl Into<Mode>, freq: Rate<u32, 1, 1>, clocks: &Clocks ) -> Spi<SPI, true>
where NoPin: Into<<SPI as SpiCommon>::Miso>,

Enables the SPI clock, resets the peripheral, sets Alternate mode for pins and initialize the peripheral as SPI Master BIDI mode.

§Note

Depending on freq you may need to set GPIO speed for pins (the Speed::Low is default for GPIO) before create Spi instance. Otherwise it may lead to the ‘wrong last bit in every received byte’ problem.

source§

fn spi_slave( self, pins: (impl Into<<SPI as SpiCommon>::Sck>, impl Into<<SPI as SpiCommon>::Miso>, impl Into<<SPI as SpiCommon>::Mosi>, Option<<SPI as SpiCommon>::Nss>), mode: impl Into<Mode> ) -> SpiSlave<SPI>

Enables the SPI clock, resets the peripheral, sets Alternate mode for pins and initialize the peripheral as SPI Slave Normal mode.

§Note

Depending on freq you may need to set GPIO speed for pins (the Speed::Low is default for GPIO) before create Spi instance. Otherwise it may lead to the ‘wrong last bit in every received byte’ problem.

source§

fn spi_bidi_slave( self, pins: (impl Into<<SPI as SpiCommon>::Sck>, impl Into<<SPI as SpiCommon>::Miso>, Option<<SPI as SpiCommon>::Nss>), mode: impl Into<Mode> ) -> SpiSlave<SPI, true>
where NoPin: Into<<SPI as SpiCommon>::Mosi>,

Enables the SPI clock, resets the peripheral, sets Alternate mode for pins and initialize the peripheral as SPI Slave BIDI mode.

§Note

Depending on freq you may need to set GPIO speed for pins (the Speed::Low is default for GPIO) before create Spi instance. Otherwise it may lead to the ‘wrong last bit in every received byte’ problem.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.