[−][src]Struct stm32f1xx_hal::spi::Spi
Implementations
impl<REMAP, PINS> Spi<SPI1, REMAP, PINS, u8>
[src]
pub fn spi1<F, POS>(
spi: SPI1,
pins: PINS,
mapr: &mut MAPR,
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB2
) -> Self where
F: Into<Hertz>,
REMAP: Remap<Periph = SPI1>,
PINS: Pins<REMAP, POS>,
[src]
spi: SPI1,
pins: PINS,
mapr: &mut MAPR,
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB2
) -> Self where
F: Into<Hertz>,
REMAP: Remap<Periph = SPI1>,
PINS: Pins<REMAP, POS>,
Constructs an SPI instance using SPI1 in 8bit dataframe mode.
The pin parameter tuple (sck, miso, mosi) should be (PA5, PA6, PA7)
or (PB3, PB4, PB5)
configured as (Alternate<PushPull>, Input<Floating>, Alternate<PushPull>)
.
You can also use NoSck
, NoMiso
or NoMosi
if you don't want to use the pins
impl<REMAP, PINS> Spi<SPI2, REMAP, PINS, u8>
[src]
pub fn spi2<F, POS>(
spi: SPI2,
pins: PINS,
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
REMAP: Remap<Periph = SPI2>,
PINS: Pins<REMAP, POS>,
[src]
spi: SPI2,
pins: PINS,
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
REMAP: Remap<Periph = SPI2>,
PINS: Pins<REMAP, POS>,
Constructs an SPI instance using SPI2 in 8bit dataframe mode.
The pin parameter tuple (sck, miso, mosi) should be (PB13, PB14, PB15)
configured as (Alternate<PushPull>, Input<Floating>, Alternate<PushPull>)
.
You can also use NoSck
, NoMiso
or NoMosi
if you don't want to use the pins
impl<SPI, REMAP, PINS, FrameSize> Spi<SPI, REMAP, PINS, FrameSize> where
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
pub fn free(self) -> (SPI, PINS)
[src]
Please use release instead
pub fn release(self) -> (SPI, PINS)
[src]
impl<SPI, REMAP, PINS> Spi<SPI, REMAP, PINS, u8> where
SPI: Deref<Target = SpiRegisterBlock> + Enable + Reset,
SPI::Bus: GetBusFreq,
[src]
SPI: Deref<Target = SpiRegisterBlock> + Enable + Reset,
SPI::Bus: GetBusFreq,
pub fn frame_size_16bit(self) -> Spi<SPI, REMAP, PINS, u16>
[src]
Converts from 8bit dataframe to 16bit.
impl<SPI, REMAP, PINS> Spi<SPI, REMAP, PINS, u16> where
SPI: Deref<Target = SpiRegisterBlock>,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
pub fn frame_size_8bit(self) -> Spi<SPI, REMAP, PINS, u8>
[src]
Converts from 16bit dataframe to 8bit.
impl<REMAP, PINS> Spi<SPI1, REMAP, PINS, u8>
[src]
impl<REMAP, PINS> Spi<SPI2, REMAP, PINS, u8>
[src]
Trait Implementations
impl<SPI, REMAP, PINS, FrameSize> Default<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
impl<SPI, REMAP, PINS, FrameSize> FullDuplex<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
type Error = Error
An enumeration of SPI errors
fn read(&mut self) -> Result<FrameSize, Error>
[src]
fn send(&mut self, data: FrameSize) -> Result<(), Error>
[src]
impl<SPI, REMAP, PINS, FrameSize> SpiReadWrite<FrameSize> for Spi<SPI, REMAP, PINS, FrameSize> where
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
FrameSize: Copy,
fn read_data_reg(&mut self) -> FrameSize
[src]
fn write_data_reg(&mut self, data: FrameSize)
[src]
fn spi_write(&mut self, words: &[FrameSize]) -> Result<(), Error>
[src]
impl<SPI, REMAP, PINS> Write<u16> for Spi<SPI, REMAP, PINS, u16> where
SPI: Deref<Target = SpiRegisterBlock>,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
impl<SPI, REMAP, PINS> Write<u8> for Spi<SPI, REMAP, PINS, u8> where
SPI: Deref<Target = SpiRegisterBlock>,
[src]
SPI: Deref<Target = SpiRegisterBlock>,
Auto Trait Implementations
impl<SPI, REMAP, PINS, FRAMESIZE> Send for Spi<SPI, REMAP, PINS, FRAMESIZE> where
FRAMESIZE: Send,
PINS: Send,
REMAP: Send,
SPI: Send,
FRAMESIZE: Send,
PINS: Send,
REMAP: Send,
SPI: Send,
impl<SPI, REMAP, PINS, FRAMESIZE> Sync for Spi<SPI, REMAP, PINS, FRAMESIZE> where
FRAMESIZE: Sync,
PINS: Sync,
REMAP: Sync,
SPI: Sync,
FRAMESIZE: Sync,
PINS: Sync,
REMAP: Sync,
SPI: Sync,
impl<SPI, REMAP, PINS, FRAMESIZE> Unpin for Spi<SPI, REMAP, PINS, FRAMESIZE> where
FRAMESIZE: Unpin,
PINS: Unpin,
REMAP: Unpin,
SPI: Unpin,
FRAMESIZE: Unpin,
PINS: Unpin,
REMAP: 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<T> Same<T> for T
type Output = T
Should always be Self
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