Change DMA write/read to use raw pointers

This commit is contained in:
Henrik Alsér
2022-08-31 19:54:38 +02:00
committed by Henrik Alsér
parent 7954cbc4e7
commit 27905f1be1
3 changed files with 39 additions and 18 deletions

View File

@@ -40,14 +40,14 @@ pub(crate) unsafe fn init() {
pub unsafe fn read<'a, C: Channel, W: Word>(
ch: impl Peripheral<P = C> + 'a,
from: *const W,
to: &mut [W],
to: *mut W,
len: usize,
dreq: u8,
) -> Transfer<'a, C> {
let (to_ptr, len) = crate::dma::slice_ptr_parts_mut(to);
copy_inner(
ch,
from as *const u32,
to_ptr as *mut u32,
to as *mut u32,
len,
W::size(),
false,
@@ -58,14 +58,14 @@ pub unsafe fn read<'a, C: Channel, W: Word>(
pub unsafe fn write<'a, C: Channel, W: Word>(
ch: impl Peripheral<P = C> + 'a,
from: &[W],
from: *const W,
to: *mut W,
len: usize,
dreq: u8,
) -> Transfer<'a, C> {
let (from_ptr, len) = crate::dma::slice_ptr_parts(from);
copy_inner(
ch,
from_ptr as *const u32,
from as *const u32,
to as *mut u32,
len,
W::size(),