From 48073a5e31d9aa4bfffbd9d9511d987ee9a33e79 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Wed, 5 Sep 2012 17:46:50 +0200 Subject: Added ADC register definition. --- adc/adc.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 adc/adc.h 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 + +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 -- cgit v1.2.3