summaryrefslogtreecommitdiff
path: root/syscfg/stm32_syscfg.h
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2022-01-20 13:18:33 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2022-01-26 23:40:29 +0100
commit267c99850a0795b1563725c33674f2c62f6942a8 (patch)
treed446995cf2c7b0098b4c261eb358712c3683c2ee /syscfg/stm32_syscfg.h
parented1731d14aa7036376c7a68a6689f76ff61c0985 (diff)
stm32_syscfg: convert to modern.
Includes the f4, l0 and wb. f4 renames MEMRM to MEMRMP to be both consistent with other parts and consistent with ref man. Retested on the WB, but l0 and f4 code was simply moved. For yaml files, given how varied syscfg is, we default to using the family name as the type, but still allow overriding via explicit type in the yaml file if desired. Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Diffstat (limited to 'syscfg/stm32_syscfg.h')
-rw-r--r--syscfg/stm32_syscfg.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/syscfg/stm32_syscfg.h b/syscfg/stm32_syscfg.h
new file mode 100644
index 0000000..cb3c505
--- /dev/null
+++ b/syscfg/stm32_syscfg.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include <mmio/mmio.h>
+
+struct STM32_SYSCFG_reg_f4_t {
+ volatile uint32_t MEMRMP;
+ volatile uint32_t PMC;
+ volatile uint32_t EXTICR[4];
+ volatile uint32_t CMPCR;
+};
+
+
+struct STM32_SYSCFG_reg_l0_t {
+ volatile uint32_t CFGR1;
+ volatile uint32_t CFGR2;
+ volatile uint32_t EXTICR[4];
+ volatile uint32_t COMP1_CTRL;
+ volatile uint32_t COMP2_CTRL;
+ volatile uint32_t CFGR3;
+};
+
+struct STM32_SYSCFG_reg_wb_t {
+ volatile uint32_t MEMRMP;
+ volatile uint32_t CFGR1;
+ volatile uint32_t EXTICR[4];
+ volatile uint32_t SCSR;
+ volatile uint32_t CFGR2;
+ volatile uint32_t SWPR;
+ volatile uint32_t SKR;
+ volatile uint32_t SWPR2;
+ uint32_t _reserved1[53]; // basicallly, vrefbuf is in this slot!
+ volatile uint32_t IMR1;
+ volatile uint32_t IMR2;
+ volatile uint32_t C2IMR1;
+ volatile uint32_t C2IMR2;
+ volatile uint32_t SIPCR;
+};
+
+
+template <typename T>
+class STM32_SYSCFG_t : public mmio_ptr<T> {
+ public:
+ using mmio_ptr<T>::ptr;
+};