summaryrefslogtreecommitdiff
path: root/adc/adc.h
blob: 01a22932e1fa7845c33fc4e25aa4c888c6a0c443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#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)

#elif defined(STM32F7)
static ADC_t& ADC1 = *(ADC_t*)0x40012000;
static ADC_t& ADC2 = *(ADC_t*)0x40012100;
static ADC_t& ADC3 = *(ADC_t*)0x40012200;
#endif

#endif