pub struct Spi<SPI, PINS> { /* private fields */ }Expand description
SPI peripheral operating in full duplex master mode
Implementations§
Source§impl<SCK, MISO, MOSI> Spi<SPI1, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI1, (SCK, MISO, MOSI)>
Sourcepub fn spi1<F>(
spi: SPI1,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB2,
) -> Self
pub fn spi1<F>( spi: SPI1, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: Clocks, apb: &mut APB2, ) -> Self
Configures the SPI peripheral to operate in full duplex master mode
Sourcepub fn enable_send_interrupt(&mut self)
pub fn enable_send_interrupt(&mut self)
Enable transmit interrupt
Sourcepub fn disable_send_interrupt(&mut self)
pub fn disable_send_interrupt(&mut self)
Disable transmit interrupt
Sourcepub fn free(self) -> (SPI1, (SCK, MISO, MOSI))
pub fn free(self) -> (SPI1, (SCK, MISO, MOSI))
Releases the SPI peripheral and associated pins
Source§impl<SCK, MISO, MOSI> Spi<SPI2, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI2, (SCK, MISO, MOSI)>
Sourcepub fn spi2<F>(
spi: SPI2,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1,
) -> Self
pub fn spi2<F>( spi: SPI2, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: Clocks, apb: &mut APB1, ) -> Self
Configures the SPI peripheral to operate in full duplex master mode
Sourcepub fn enable_send_interrupt(&mut self)
pub fn enable_send_interrupt(&mut self)
Enable transmit interrupt
Sourcepub fn disable_send_interrupt(&mut self)
pub fn disable_send_interrupt(&mut self)
Disable transmit interrupt
Sourcepub fn free(self) -> (SPI2, (SCK, MISO, MOSI))
pub fn free(self) -> (SPI2, (SCK, MISO, MOSI))
Releases the SPI peripheral and associated pins
Source§impl<SCK, MISO, MOSI> Spi<SPI3, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> Spi<SPI3, (SCK, MISO, MOSI)>
Sourcepub fn spi3<F>(
spi: SPI3,
pins: (SCK, MISO, MOSI),
mode: Mode,
freq: F,
clocks: Clocks,
apb: &mut APB1,
) -> Self
pub fn spi3<F>( spi: SPI3, pins: (SCK, MISO, MOSI), mode: Mode, freq: F, clocks: Clocks, apb: &mut APB1, ) -> Self
Configures the SPI peripheral to operate in full duplex master mode
Sourcepub fn enable_send_interrupt(&mut self)
pub fn enable_send_interrupt(&mut self)
Enable transmit interrupt
Sourcepub fn disable_send_interrupt(&mut self)
pub fn disable_send_interrupt(&mut self)
Disable transmit interrupt
Sourcepub fn free(self) -> (SPI3, (SCK, MISO, MOSI))
pub fn free(self) -> (SPI3, (SCK, MISO, MOSI))
Releases the SPI peripheral and associated pins
Trait Implementations§
Source§impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI1, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI1, (SCK, MISO, MOSI)>
Source§fn dma_write<S, T, SPI1, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI1, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
fn dma_write<S, T, SPI1, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI1, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
Start a one-shot DMA transfer
Source§impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI2, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI2, (SCK, MISO, MOSI)>
Source§fn dma_write<S, T, SPI2, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI2, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
fn dma_write<S, T, SPI2, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI2, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
Start a one-shot DMA transfer
Source§impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI3, (SCK, MISO, MOSI)>
impl<SCK, MISO, MOSI> DmaWrite for Spi<SPI3, (SCK, MISO, MOSI)>
Source§fn dma_write<S, T, SPI3, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI3, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
fn dma_write<S, T, SPI3, STREAM, CHANNEL, X>(
&mut self,
dma: STREAM,
data: S,
) -> Xwhere
S: AsRef<[T]>,
STREAM: DmaStreamTransfer<S, T, X> + SpiDmaStream<SPI3, CHANNEL, DmaTx>,
CHANNEL: DmaChannel,
X: Transfer<STREAM>,
Start a one-shot DMA transfer
impl<PINS> Default<u8> for Spi<SPI1, PINS>
impl<PINS> Default<u8> for Spi<SPI2, PINS>
impl<PINS> Default<u8> for Spi<SPI3, PINS>
Auto Trait Implementations§
impl<SPI, PINS> Freeze for Spi<SPI, PINS>
impl<SPI, PINS> RefUnwindSafe for Spi<SPI, PINS>where
SPI: RefUnwindSafe,
PINS: RefUnwindSafe,
impl<SPI, PINS> Send for Spi<SPI, PINS>
impl<SPI, PINS> Sync for Spi<SPI, PINS>
impl<SPI, PINS> Unpin for Spi<SPI, PINS>
impl<SPI, PINS> UnwindSafe for Spi<SPI, PINS>where
SPI: UnwindSafe,
PINS: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more