summaryrefslogtreecommitdiff
path: root/timer/stm32_timer.h
diff options
context:
space:
mode:
authorKarl Palsson <karlp@etactica.com>2021-09-15 16:45:29 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-09-16 20:29:55 +0200
commit41d7823059a9e81a8cf6ec7ed65eba6959b39ee4 (patch)
tree00c64540d38824fa4d5f130a7b14a2712eb208a1 /timer/stm32_timer.h
parent891344a7f602e9431a52b89d32d3b5a8e2b0430c (diff)
timer: convert to new style and add WB
Stub f1 and f3 platform files have been added to preserve the collected timer base addresses, even though those platforms aren't actually supported in laks yet. Signed-off-by: Karl Palsson <karlp@etactica.com>
Diffstat (limited to 'timer/stm32_timer.h')
-rw-r--r--timer/stm32_timer.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/timer/stm32_timer.h b/timer/stm32_timer.h
new file mode 100644
index 0000000..cbc966d
--- /dev/null
+++ b/timer/stm32_timer.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <mmio/mmio.h>
+
+struct STM32_TIMER_reg_v1_t {
+ volatile uint32_t CR1;
+ volatile uint32_t CR2;
+ volatile uint32_t SMCR;
+ volatile uint32_t DIER;
+ volatile uint32_t SR;
+ volatile uint32_t EGR;
+ volatile uint32_t CCMR1;
+ volatile uint32_t CCMR2;
+ volatile uint32_t CCER;
+ volatile uint32_t CNT;
+ volatile uint32_t PSC;
+ volatile uint32_t ARR;
+ volatile uint32_t RCR;
+ volatile uint32_t CCR1;
+ volatile uint32_t CCR2;
+ volatile uint32_t CCR3;
+ volatile uint32_t CCR4;
+ volatile uint32_t BDTR;
+ volatile uint32_t DCR;
+ volatile uint32_t DMAR;
+};
+
+template <typename T>
+class STM32_TIMER_t : public mmio_ptr<T> {
+ public:
+ using mmio_ptr<T>::ptr;
+};
+