pub struct Channel<'d> { /* private fields */ }Expand description
DMA channel driver
Implementations§
Source§impl<'d> Channel<'d>
impl<'d> Channel<'d>
Sourcepub unsafe fn transfer<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
buf: *const [PW],
dest_addr: *mut MW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn transfer<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: *const [PW], dest_addr: *mut MW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a memory DMA transfer (memory to memory), using raw pointers.
Sourcepub unsafe fn transfer_raw<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
src_addr: *const MW,
src_size: usize,
dest_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn transfer_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, src_addr: *const MW, src_size: usize, dest_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a memory DMA transfer (memory to memory), using raw pointers.
Sourcepub unsafe fn read<'a, W: Word>(
&'a mut self,
request: Request,
peri_addr: *mut W,
buf: &'a mut [W],
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn read<'a, W: Word>( &'a mut self, request: Request, peri_addr: *mut W, buf: &'a mut [W], options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a read DMA transfer (peripheral to memory).
Sourcepub unsafe fn read_raw<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
peri_addr: *mut PW,
buf: *mut [MW],
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn read_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, peri_addr: *mut PW, buf: *mut [MW], options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a read DMA transfer (peripheral to memory), using raw pointers.
Sourcepub unsafe fn read_raw_repeated<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
repeated: *mut MW,
count: usize,
peri_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn read_raw_repeated<'a, MW: Word, PW: Word>( &'a mut self, request: Request, repeated: *mut MW, count: usize, peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a read DMA transfer (peripheral to memory), writing the same value repeatedly.
Sourcepub unsafe fn write<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
buf: &'a [MW],
peri_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: &'a [MW], peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a write DMA transfer (memory to peripheral).
Sourcepub unsafe fn write_raw<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
buf: *const [MW],
peri_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: *const [MW], peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a write DMA transfer (memory to peripheral), using raw pointers.
Sourcepub unsafe fn write_repeated<'a, W: Word>(
&'a mut self,
request: Request,
repeated: &'a W,
count: usize,
peri_addr: *mut W,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write_repeated<'a, W: Word>( &'a mut self, request: Request, repeated: &'a W, count: usize, peri_addr: *mut W, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a write DMA transfer (memory to peripheral), writing the same value repeatedly.
Sourcepub unsafe fn write_mem2mem<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
buf: &'a [MW],
dest_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write_mem2mem<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: &'a [MW], dest_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a memory DMA transfer (memory to memory) to a fixed destination address.
This transfers data from a memory buffer (buf) to a fixed destination address (dest_addr).
This is specifically required for peripherals like the DFSDM, which need
memory-to-memory DMA transfers to write data into their internal input registers
(e.g., DATINR), rather than standard memory-to-peripheral transfers.
§Safety
The caller must ensure that the destination address is valid and that the DMA transfer does not violate Rust’s aliasing rules for the duration of the transfer.
Sourcepub unsafe fn write_mem2mem_raw<'a, MW: Word, PW: Word>(
&'a mut self,
request: Request,
buf: *const [MW],
dest_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write_mem2mem_raw<'a, MW: Word, PW: Word>( &'a mut self, request: Request, buf: *const [MW], dest_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a memory DMA transfer (memory to memory) to a fixed destination address, using raw pointers.
This is the raw pointer variant of write_mem2mem.
It transfers data from a raw source slice (buf) to a fixed destination address (dest_addr).
This is specifically used for peripherals like the DFSDM, which require memory-to-memory DMA to feed data into their internal registers.
Note: The arguments are ordered logically as (source, destination) to avoid
the internal peri_addr/mem_addr ambiguity present in the underlying
Dir::MemoryToMemory hardware configuration.
§Safety
The caller must ensure that the source and destination pointers are valid and properly aligned for the duration of the transfer.