Skip to content

Commit

Permalink
support dma chunk sizes other than 4092
Browse files Browse the repository at this point in the history
  • Loading branch information
liebman committed Jul 4, 2024
1 parent 163f450 commit 4a85536
Show file tree
Hide file tree
Showing 5 changed files with 408 additions and 113 deletions.
18 changes: 18 additions & 0 deletions esp-hal/src/dma/gdma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,24 @@ mod m2m {
}
}

/// Create a new Mem2Mem instance with specific chunk size.
pub fn new_with_chunk_size(
mut channel: Channel<'d, C, MODE>,
peripheral: impl DmaEligible,
tx_descriptors: &'static mut [DmaDescriptor],
rx_descriptors: &'static mut [DmaDescriptor],
chunk_size: usize,
) -> Self {
channel.tx.init_channel();
channel.rx.init_channel();
Mem2Mem {
channel,
peripheral: peripheral.dma_peripheral(),
tx_chain: DescriptorChain::new_with_chunk_size(tx_descriptors, chunk_size),
rx_chain: DescriptorChain::new_with_chunk_size(rx_descriptors, chunk_size),
}
}

/// Create a new Mem2Mem instance.
///
/// # Safety
Expand Down
Loading

0 comments on commit 4a85536

Please sign in to comment.