diff options
author | Karl Palsson <karlp@etactica.com> | 2021-09-15 17:05:36 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2021-09-16 20:29:55 +0200 |
commit | 891344a7f602e9431a52b89d32d3b5a8e2b0430c (patch) | |
tree | 6a125fe4a059b7806d089b5f63531679434f0e56 /dma/stm32_dma.h | |
parent | d68a78807e7708c480b2fc9d34e1873714423aae (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_dma.h')
-rw-r--r-- | dma/stm32_dma.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dma/stm32_dma.h b/dma/stm32_dma.h new file mode 100644 index 0000000..afeaed5 --- /dev/null +++ b/dma/stm32_dma.h @@ -0,0 +1,43 @@ +#pragma once + +#include <stdint.h> +#include <mmio/mmio.h> + +struct STM32_DMA_channel_reg_v1_t { + volatile uint32_t CR; + volatile uint32_t NDTR; + volatile uint32_t PAR; + volatile uint32_t MAR; + uint32_t _reserved; +}; + +struct STM32_DMA_reg_v1_t { + volatile uint32_t ISR; + volatile uint32_t IFCR; + STM32_DMA_channel_reg_v1_t C[7]; +}; + + +struct STM32_DMA_stream_reg_v2_t { + volatile uint32_t CR; + volatile uint32_t NDTR; + volatile uint32_t PAR; + volatile uint32_t M0AR; + volatile uint32_t M1AR; + volatile uint32_t FCR; +}; + +struct STM32_DMA_reg_v2_t { + volatile uint32_t LISR; + volatile uint32_t HISR; + volatile uint32_t LIFCR; + volatile uint32_t HIFCR; + STM32_DMA_stream_reg_v2_t S[8]; +}; + + +template <typename T> +class STM32_DMA_t : public mmio_ptr<T> { + public: + using mmio_ptr<T>::ptr; +}; |