summaryrefslogtreecommitdiff
path: root/dma/stm32_dmamux.h
diff options
context:
space:
mode:
authorKarl Palsson <karlp@etactica.com>2021-09-15 17:05:36 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-09-16 20:29:55 +0200
commit891344a7f602e9431a52b89d32d3b5a8e2b0430c (patch)
tree6a125fe4a059b7806d089b5f63531679434f0e56 /dma/stm32_dmamux.h
parentd68a78807e7708c480b2fc9d34e1873714423aae (diff)
dma: convert to new style, add DMAMUX
DMAMUX is a channel/source muxer available on L4+,L5,H7,G0,G4,WB and WL parts. Signed-of-by: Karl Palsson <karlp@etactica.com>
Diffstat (limited to 'dma/stm32_dmamux.h')
-rw-r--r--dma/stm32_dmamux.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/dma/stm32_dmamux.h b/dma/stm32_dmamux.h
new file mode 100644
index 0000000..064393a
--- /dev/null
+++ b/dma/stm32_dmamux.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <stdint.h>
+#include <mmio/mmio.h>
+
+struct STM32_DMAMUX_reg_v1_t {
+ /**
+ * Not all parts offer all channels!
+ * WB: 14, G4: 16...
+ */
+ volatile uint32_t CCR[20];
+ volatile uint32_t _reserved1[12];
+ volatile uint32_t CSR; // 0x80
+ volatile uint32_t CFR; // 0x84
+ volatile uint32_t _reserved2[30];
+ /**
+ * Not all parts offer all requests!
+ * WB/G4: 4, H7: 8
+ */
+ volatile uint32_t RGCR[8]; // 0x100
+ volatile uint32_t _reserved3[8];
+ volatile uint32_t RGSR; // 0x140
+ volatile uint32_t RGCFR;
+};
+
+template <typename T>
+class STM32_DMAMUX_t : public mmio_ptr<T> {
+ public:
+ using mmio_ptr<T>::ptr;
+}; \ No newline at end of file