refactor: update write DMA transfer function to use separate memory word type

This commit is contained in:
Liu Hancheng 2025-01-05 10:25:10 +08:00
parent 50e98a9a58
commit 4ad3b66e45

View File

@ -620,10 +620,10 @@ impl<'a> Transfer<'a> {
} }
/// Create a new write DMA transfer (memory to peripheral), using raw pointers. /// Create a new write DMA transfer (memory to peripheral), using raw pointers.
pub unsafe fn new_write_raw<W: Word, PW: Word>( pub unsafe fn new_write_raw<MW: Word, PW: Word>(
channel: impl Peripheral<P = impl Channel> + 'a, channel: impl Peripheral<P = impl Channel> + 'a,
request: Request, request: Request,
buf: *const [W], buf: *const [MW],
peri_addr: *mut PW, peri_addr: *mut PW,
options: TransferOptions, options: TransferOptions,
) -> Self { ) -> Self {
@ -634,11 +634,11 @@ impl<'a> Transfer<'a> {
request, request,
Dir::MemoryToPeripheral, Dir::MemoryToPeripheral,
peri_addr as *const u32, peri_addr as *const u32,
buf as *const W as *mut u32, buf as *const MW as *mut u32,
buf.len(), buf.len(),
true, true,
W::size(), MW::size(),
W::size(), PW::size(),
options, options,
) )
} }