Skip to content

Commit 2990768

Browse files
committed
Create module dmamux.rs as common interface for DMA request mapping.
The new stm32l4+ devices use a separate peripheral (DMAMUX) for routing a DMA request line between peripherals and DMA controllers, whereas the "old" stm32l4 devices use the `CSELR` register for request mapping. This module tries to abstract this difference, and provides a common interface for all L4 devices. This commit also enable the DMAMUX clock when required.
1 parent 9dfb104 commit 2990768

File tree

3 files changed

+642
-0
lines changed

3 files changed

+642
-0
lines changed

src/dma.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,18 @@ macro_rules! dma {
10821082
fn split(self, ahb: &mut AHB1) -> Channels {
10831083
<$DMAX>::enable(ahb);
10841084

1085+
#[cfg(any(
1086+
// feature = "stm32l4p5",
1087+
// feature = "stm32l4q5",
1088+
// feature = "stm32l4r5",
1089+
// feature = "stm32l4s5",
1090+
// feature = "stm32l4r7",
1091+
// feature = "stm32l4s7",
1092+
feature = "stm32l4r9",
1093+
feature = "stm32l4s9"
1094+
))]
1095+
ahb.enr().modify(|_, w| w.dmamux1en().set_bit());
1096+
10851097
// reset the DMA control registers (stops all on-going transfers)
10861098
$(
10871099
self.$ccrX.reset();

0 commit comments

Comments
 (0)