Source

Trait Source 

Source
pub trait Source: Sealed {
    type Error;

    // Required methods
    fn is_valid(&self) -> bool;
    fn is_empty(&self) -> bool;
    fn increment(&self) -> SRCINC_A;
    fn transfer_count(&self) -> Option<u16>;
    fn end_addr(&self) -> *const u8;
    fn finish(&mut self) -> Result<(), Self::Error>;
}
Expand description

The source of a DMA transfer

This trait’s methods are intended for internal use only. It is implemented for immutable static buffers and peripherals that support being read from using DMA.

Required Associated Types§

Source

type Error

The error that can occur while finishing the transfer

Required Methods§

Source

fn is_valid(&self) -> bool

Indicates whether the source is valid

Buffers are valid, if they have a length of 1024 or less. Peripherals are always valid.

Source

fn is_empty(&self) -> bool

Indicates whether the source is empty

Buffers are empty, if they have a length of 0. Peripherals are never empty.

Source

fn increment(&self) -> SRCINC_A

The address increment during the transfer

Buffers will return the word size here. Peripherals will indicate no increment.

Source

fn transfer_count(&self) -> Option<u16>

The transfer count, as defined by XFERCFG.XFERCOUNT

Only buffers will return a value here, and only if is_empty returns false. Peripherals will always return None.

Source

fn end_addr(&self) -> *const u8

The end address

This is not the actual end of the buffer, but the starting address plus transfer_count times address increment. See LPC845 user manual, section 16.5.2, for example.

Source

fn finish(&mut self) -> Result<(), Self::Error>

Tell the source to finish the transfer

Implementations on Foreign Types§

Source§

impl Source for &'static [u8]

Implementors§

Source§

impl<I, C> Source for Master<I, Enabled<PhantomData<C>>, Enabled>
where I: Instance,

Source§

impl<I, Mode> Source for Rx<I, Enabled<u8, Mode>>
where I: Instance,