[−][src]Struct gd32vf103_hal::spi::Spi
SPI object that can be used to make FullDuplex SPI peripherals
Methods
impl<SCK, MISO, MOSI, NSS> Spi<SPI0, (SCK, MISO, MOSI, NSS)>
[src]
pub fn spi0<F>(
spi: SPI0,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB2
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI0>,
MISO: MisoPin<SPI0>,
MOSI: MosiPin<SPI0>,
NSS: NssPin<SPI0>,
[src]
spi: SPI0,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB2
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI0>,
MISO: MisoPin<SPI0>,
MOSI: MosiPin<SPI0>,
NSS: NssPin<SPI0>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn free(self) -> (SPI0, (SCK, MISO, MOSI, NSS))
[src]
Releases the SPI peripheral and associated pins
impl<SCK, MISO, MOSI, NSS> Spi<SPI1, (SCK, MISO, MOSI, NSS)>
[src]
pub fn spi1<F>(
spi: SPI1,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI1>,
MISO: MisoPin<SPI1>,
MOSI: MosiPin<SPI1>,
NSS: NssPin<SPI1>,
[src]
spi: SPI1,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI1>,
MISO: MisoPin<SPI1>,
MOSI: MosiPin<SPI1>,
NSS: NssPin<SPI1>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn free(self) -> (SPI1, (SCK, MISO, MOSI, NSS))
[src]
Releases the SPI peripheral and associated pins
impl<SCK, MISO, MOSI, NSS> Spi<SPI2, (SCK, MISO, MOSI, NSS)>
[src]
pub fn spi2<F>(
spi: SPI2,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI2>,
MISO: MisoPin<SPI2>,
MOSI: MosiPin<SPI2>,
NSS: NssPin<SPI2>,
[src]
spi: SPI2,
pins: (SCK, MISO, MOSI, NSS),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1
) -> Self where
F: Into<Hertz>,
SCK: SckPin<SPI2>,
MISO: MisoPin<SPI2>,
MOSI: MosiPin<SPI2>,
NSS: NssPin<SPI2>,
Configures the SPI peripheral to operate in full duplex master mode
pub fn free(self) -> (SPI2, (SCK, MISO, MOSI, NSS))
[src]
Releases the SPI peripheral and associated pins
Trait Implementations
impl<PINS> Default<u8> for Spi<SPI0, PINS>
[src]
impl<PINS> Default<u8> for Spi<SPI1, PINS>
[src]
impl<PINS> Default<u8> for Spi<SPI2, PINS>
[src]
impl<PINS> Default<u8> for Spi<SPI0, PINS>
[src]
impl<PINS> Default<u8> for Spi<SPI1, PINS>
[src]
impl<PINS> Default<u8> for Spi<SPI2, PINS>
[src]
impl<PINS> FullDuplex<u8> for Spi<SPI0, PINS>
[src]
type Error = Error
An enumeration of SPI errors
fn read(&mut self) -> Result<u8, Error>
[src]
fn send(&mut self, byte: u8) -> Result<(), Error>
[src]
impl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>
[src]
type Error = Error
An enumeration of SPI errors
fn read(&mut self) -> Result<u8, Error>
[src]
fn send(&mut self, byte: u8) -> Result<(), Error>
[src]
impl<PINS> FullDuplex<u8> for Spi<SPI2, PINS>
[src]
Auto Trait Implementations
impl<SPI, PINS> Send for Spi<SPI, PINS> where
PINS: Send,
SPI: Send,
PINS: Send,
SPI: Send,
impl<SPI, PINS> Sync for Spi<SPI, PINS> where
PINS: Sync,
SPI: Sync,
PINS: Sync,
SPI: Sync,
impl<SPI, PINS> Unpin for Spi<SPI, PINS> where
PINS: Unpin,
SPI: Unpin,
PINS: 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<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