Trait rp2040_hal::dma::WriteTarget

source ·
pub unsafe trait WriteTarget {
    type TransmittedWord;

    // Required methods
    fn tx_treq() -> Option<u8>;
    fn tx_address_count(&mut self) -> (u32, u32);
    fn tx_increment(&self) -> bool;
}
Expand description

Trait which is implemented by anything that can be written via DMA.

§Safety

The implementing type must be safe to use for DMA writes. This means:

  • The range returned by tx_address_count must point to a valid address, and if tx_increment is true, count must fit into the allocated buffer.
  • As long as no other &mut self method is called on the implementing object:
    • tx_address_count must always return the same value, if called multiple times.
    • The memory specified by the pointer and size returned by tx_address_count must not be freed during the transfer it is used in as long as self is not dropped.

Required Associated Types§

source

type TransmittedWord

Type which is transferred in a single DMA transfer.

Required Methods§

source

fn tx_treq() -> Option<u8>

Returns the DREQ number for this data sink (None for memory buffers).

source

fn tx_address_count(&mut self) -> (u32, u32)

Returns the address and the maximum number of words that can be transferred from this data source in a single DMA operation.

See ReadTarget::rx_address_count for a complete description of the semantics of this function.

source

fn tx_increment(&self) -> bool

Returns whether the address shall be incremented after each transfer.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B: WriteBuffer> WriteTarget for B

Safety: WriteBuffer and WriteTarget have the same safety requirements.

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 4>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 5>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 6>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 7>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 8>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 9>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 10>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 11>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 12>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 13>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 14>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 15>

source§

impl<D: SpiDevice, P: ValidSpiPinout<D>> WriteTarget for Spi<Enabled, D, P, 16>

source§

impl<D: UartDevice, P: ValidUartPinout<D>> WriteTarget for Writer<D, P>

source§

impl<S: SliceId, M: ValidSliceMode<S>> WriteTarget for SliceDmaWriteCc<S, M>

Safety: tx_address_count points to a register which is always a valid write target.

source§

impl<S: SliceId, M: ValidSliceMode<S>> WriteTarget for SliceDmaWriteTop<S, M>

Safety: tx_address_count points to a register which is always a valid write target.

source§

impl<SM: ValidStateMachine> WriteTarget for Tx<SM>