blob: a225ebf7b07c9800c1e305d2ef4d9b801ec97463 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#ifndef ADC_F3_H
#define ADC_F3_H
#include <stdint.h>
struct ADC_t {
volatile uint32_t ISR;
volatile uint32_t IER;
volatile uint32_t CR;
volatile uint32_t CFGR;
volatile uint32_t CFGR2;
volatile uint32_t SMPR1;
volatile uint32_t SMPR2;
uint32_t _reserved1;
volatile uint32_t TR1;
volatile uint32_t TR2;
volatile uint32_t TR3;
uint32_t _reserved2;
volatile uint32_t SQR1;
volatile uint32_t SQR2;
volatile uint32_t SQR3;
volatile uint32_t SQR4;
volatile uint32_t DR;
uint32_t _reserved3[2];
volatile uint32_t JSQR;
uint32_t _reserved4[4];
volatile uint32_t OFR1;
volatile uint32_t OFR2;
volatile uint32_t OFR3;
volatile uint32_t OFR4;
uint32_t _reserved5[4];
volatile uint32_t JDR1;
volatile uint32_t JDR2;
volatile uint32_t JDR3;
volatile uint32_t JDR4;
uint32_t _reserved6[4];
volatile uint32_t AWD2CR;
volatile uint32_t AWD3CR;
uint32_t _reserved7[2];
volatile uint32_t DIFSEL;
volatile uint32_t CALFACT;
};
struct ADC_COMMON_t {
volatile uint32_t CSR;
uint32_t _reserved1;
volatile uint32_t CCR;
};
#if defined(STM32F3)
static ADC_t& ADC1 = *(ADC_t*)0x50000000;
static ADC_t& ADC2 = *(ADC_t*)0x50000100;
static ADC_t& ADC3 = *(ADC_t*)0x50000400;
static ADC_t& ADC4 = *(ADC_t*)0x50000500;
static ADC_COMMON_t& ADC_COMMON1 = *(ADC_COMMON_t*)0x50000300;
static ADC_COMMON_t& ADC_COMMON3 = *(ADC_COMMON_t*)0x50000700;
#elif defined(STM32WB)
static ADC_t& ADC1 = *(ADC_t*)0x50040000;
static ADC_COMMON_t& ADC_COMMON1 = *(ADC_COMMON_t*)0x50040300;
#endif
#endif
|