pub struct Channel<'d> { /* private fields */ }Expand description
DMA channel driver
Implementations§
Source§impl<'d> Channel<'d>
impl<'d> Channel<'d>
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, MW: Word, PW: Word>(
&'a mut self,
request: Request,
repeated: &'a MW,
count: usize,
peri_addr: *mut PW,
options: TransferOptions,
) -> Transfer<'a> ⓘ
pub unsafe fn write_repeated<'a, MW: Word, PW: Word>( &'a mut self, request: Request, repeated: &'a MW, count: usize, peri_addr: *mut PW, options: TransferOptions, ) -> Transfer<'a> ⓘ
Create a write DMA transfer (memory to peripheral), writing the same value repeatedly.
Sourcepub unsafe fn linked_list<'a, const N: usize>(
&'a mut self,
table: &'a Table<N>,
options: TransferOptions,
) -> LinkedListTransfer<'a> ⓘ
pub unsafe fn linked_list<'a, const N: usize>( &'a mut self, table: &'a Table<N>, options: TransferOptions, ) -> LinkedListTransfer<'a> ⓘ
Create a linked-list DMA transfer.
Sourcepub unsafe fn restart_linked_list<const N: usize>(
&self,
table: &Table<N>,
options: TransferOptions,
)
pub unsafe fn restart_linked_list<const N: usize>( &self, table: &Table<N>, options: TransferOptions, )
Reconfigure and restart a linked-list transfer from item[0].
Resets the channel, clears all flags, reconfigures LBAR/BR1/LLR/CR from the table and options, and re-enables the channel. This is intended for use cases that need to restart the same linked-list chain from the beginning.
§Safety
The caller must ensure that no other code is concurrently accessing
the channel registers, and that the table remains valid for the
duration of the transfer.