Struct stm32l0xx_hal::spi::Spi
source · [−]pub struct Spi<SPI, PINS> { /* private fields */ }
Implementations
sourceimpl<PINS> Spi<SPI1, PINS>
impl<PINS> Spi<SPI1, PINS>
pub fn spi1<T>(spi: SPI1, pins: PINS, mode: Mode, freq: T, rcc: &mut Rcc) -> Self where
PINS: Pins<SPI1>,
T: Into<Hertz>,
pub fn free(self) -> (SPI1, PINS)
pub fn read_all<Channel, Buffer>(
self,
dma: &mut Handle,
channel: Channel,
buffer: Pin<Buffer>
) -> Transfer<Self, Rx<SPI1>, Channel, Buffer, Ready> where
Rx<SPI1>: Target<Channel>,
Channel: Channel,
Buffer: DerefMut + 'static,
Buffer::Target: AsMutSlice<Element = u8>,
pub fn read_some<Channel, Buffer>(
self,
dma: &mut Handle,
channel: Channel,
buffer: Pin<Buffer>,
num_words: usize
) -> Transfer<Self, Rx<SPI1>, Channel, Buffer, Ready> where
Rx<SPI1>: Target<Channel>,
Channel: Channel,
Buffer: DerefMut + 'static,
Buffer::Target: AsMutSlice<Element = u8>,
pub fn write_all<Channel, Buffer>(
self,
dma: &mut Handle,
channel: Channel,
buffer: Pin<Buffer>
) -> Transfer<Self, Tx<SPI1>, Channel, Buffer, Ready> where
Tx<SPI1>: Target<Channel>,
Channel: Channel,
Buffer: Deref + 'static,
Buffer::Target: AsSlice<Element = u8>,
pub fn write_some<Channel, Buffer>(
self,
dma: &mut Handle,
channel: Channel,
buffer: Pin<Buffer>,
num_words: usize
) -> Transfer<Self, Tx<SPI1>, Channel, Buffer, Ready> where
Tx<SPI1>: Target<Channel>,
Channel: Channel,
Buffer: Deref + 'static,
Buffer::Target: AsSlice<Element = u8>,
Trait Implementations
sourceimpl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>
impl<PINS> FullDuplex<u8> for Spi<SPI1, PINS>
impl<PINS> Default<u8> for Spi<SPI1, PINS>
impl<PINS> Default<u8> for Spi<SPI1, 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