aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/sdmmc
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-02-24 02:38:31 +0100
committerDario Nieuwenhuis <[email protected]>2024-02-24 02:41:41 +0100
commite67dfcb04f79aebed52a357b867d418e0ff476af (patch)
tree82d1fb2b40b71a6dd62bfbe79596d61cbb6ce7c8 /embassy-stm32/src/sdmmc
parentf77d59500e9bbc0282f1ba4b6b27507f83f9d974 (diff)
stm32/dma: add AnyChannel, add support for BDMA on H7.
Diffstat (limited to 'embassy-stm32/src/sdmmc')
-rw-r--r--embassy-stm32/src/sdmmc/mod.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs
index 61589a215..bf1d2ca9b 100644
--- a/embassy-stm32/src/sdmmc/mod.rs
+++ b/embassy-stm32/src/sdmmc/mod.rs
@@ -228,10 +228,10 @@ fn clk_div(ker_ck: Hertz, sdmmc_ck: u32) -> Result<(bool, u16, Hertz), Error> {
228} 228}
229 229
230#[cfg(sdmmc_v1)] 230#[cfg(sdmmc_v1)]
231type Transfer<'a, C> = crate::dma::Transfer<'a, C>; 231type Transfer<'a> = crate::dma::Transfer<'a>;
232#[cfg(sdmmc_v2)] 232#[cfg(sdmmc_v2)]
233struct Transfer<'a, C> { 233struct Transfer<'a> {
234 _dummy: core::marker::PhantomData<&'a mut C>, 234 _dummy: PhantomData<&'a ()>,
235} 235}
236 236
237#[cfg(all(sdmmc_v1, dma))] 237#[cfg(all(sdmmc_v1, dma))]
@@ -548,7 +548,7 @@ impl<'d, T: Instance, Dma: SdmmcDma<T> + 'd> Sdmmc<'d, T, Dma> {
548 buffer: &'a mut [u32], 548 buffer: &'a mut [u32],
549 length_bytes: u32, 549 length_bytes: u32,
550 block_size: u8, 550 block_size: u8,
551 ) -> Transfer<'a, Dma> { 551 ) -> Transfer<'a> {
552 assert!(block_size <= 14, "Block size up to 2^14 bytes"); 552 assert!(block_size <= 14, "Block size up to 2^14 bytes");
553 let regs = T::regs(); 553 let regs = T::regs();
554 554
@@ -596,12 +596,7 @@ impl<'d, T: Instance, Dma: SdmmcDma<T> + 'd> Sdmmc<'d, T, Dma> {
596 /// # Safety 596 /// # Safety
597 /// 597 ///
598 /// `buffer` must be valid for the whole transfer and word aligned 598 /// `buffer` must be valid for the whole transfer and word aligned
599 fn prepare_datapath_write<'a>( 599 fn prepare_datapath_write<'a>(&'a mut self, buffer: &'a [u32], length_bytes: u32, block_size: u8) -> Transfer<'a> {
600 &'a mut self,
601 buffer: &'a [u32],
602 length_bytes: u32,
603 block_size: u8,
604 ) -> Transfer<'a, Dma> {
605 assert!(block_size <= 14, "Block size up to 2^14 bytes"); 600 assert!(block_size <= 14, "Block size up to 2^14 bytes");
606 let regs = T::regs(); 601 let regs = T::regs();
607 602