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§
Required Methods§
Sourcefn is_valid(&self) -> bool
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.
Sourcefn is_empty(&self) -> bool
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.
Sourcefn increment(&self) -> SRCINC_A
fn increment(&self) -> SRCINC_A
The address increment during the transfer
Buffers will return the word size here. Peripherals will indicate no increment.
Sourcefn transfer_count(&self) -> Option<u16>
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.