Struct stm32f7xx_hal::spi::Transfer [−][src]
pub struct Transfer<Word: SupportedWordSize, I, P, Buffer, Rx: Target, Tx: Target, State> { /* fields omitted */ }
Expand description
A DMA transfer of the SPI peripheral
Since DMA can send and receive at the same time, using two DMA transfers and
two DMA streams, we need this type to represent this operation and wrap the
underlying dma::Transfer
instances.
Implementations
pub fn enable_interrupts(
&mut self,
rx_handle: &Handle<Rx::Instance, Enabled>,
tx_handle: &Handle<Tx::Instance, Enabled>,
interrupts: Interrupts
)
pub fn enable_interrupts(
&mut self,
rx_handle: &Handle<Rx::Instance, Enabled>,
tx_handle: &Handle<Tx::Instance, Enabled>,
interrupts: Interrupts
)
Enables the given interrupts for this DMA transfer
These interrupts are only enabled for this transfer. The settings doesn’t affect other transfers, nor subsequent transfers using the same DMA streams.
Start the DMA transfer
Consumes this instance of Transfer
and returns another instance with
its type state set to indicate the transfer has been started.
Checks whether the transfer is still ongoing
Waits for the transfer to end
This method will block if the transfer is still ongoing. If you want
this method to return immediately, first check whether the transfer is
still ongoing by calling is_active
.
An ongoing transfer needs exlusive access to some resources, namely the
data buffer, the DMA stream, and the peripheral. Those have been moved
into the Transfer
instance to prevent concurrent access to them. This
method returns those resources, so they can be used again.