summaryrefslogtreecommitdiff
path: root/adc
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2012-09-05 17:46:50 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2012-09-05 17:46:50 +0200
commit48073a5e31d9aa4bfffbd9d9511d987ee9a33e79 (patch)
tree53f6d2457927e24ff03d875cd5d6c58e681026cc /adc
parent2d1ff52bffaa8bcc9c59d9369074859c66a9dc75 (diff)
Added ADC register definition.
Diffstat (limited to 'adc')
-rw-r--r--adc/adc.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/adc/adc.h b/adc/adc.h
new file mode 100644
index 0000000..2c2fccb
--- /dev/null
+++ b/adc/adc.h
@@ -0,0 +1,37 @@
+#ifndef ADC_H
+#define ADC_H
+
+#include <stdint.h>
+
+struct ADC_t {
+ volatile uint32_t SR;
+ volatile uint32_t CR1;
+ volatile uint32_t CR2;
+ volatile uint32_t SMPR1;
+ volatile uint32_t SMPR2;
+ volatile uint32_t JOFR1;
+ volatile uint32_t JOFR2;
+ volatile uint32_t JOFR3;
+ volatile uint32_t JOFR4;
+ volatile uint32_t HTR;
+ volatile uint32_t LTR;
+ volatile uint32_t SQR1;
+ volatile uint32_t SQR2;
+ volatile uint32_t SQR3;
+ volatile uint32_t JSQR;
+ volatile uint32_t JDR1;
+ volatile uint32_t JDR2;
+ volatile uint32_t JDR3;
+ volatile uint32_t JDR4;
+ volatile uint32_t DR;
+};
+
+#if defined(STM32F1)
+static ADC_t& ADC1 = *(ADC_t*)0x40012400;
+static ADC_t& ADC2 = *(ADC_t*)0x40012800;
+static ADC_t& ADC3 = *(ADC_t*)0x40013c00;
+#elif defined(STM32F4)
+
+#endif
+
+#endif