Imt.Base C++ API V4.1.1.0
Loading...
Searching...
No Matches
ADC12Registers.h
Go to the documentation of this file.
1// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
2
3#ifndef STM32H730_ADC12REGISTERS_H
4#define STM32H730_ADC12REGISTERS_H
5
8
9namespace imt {
10namespace base {
11namespace hal {
12namespace stm32h730 {
13namespace registers {
14
25 struct ADC_ISR {
26 uint32_t volatile ADRDY : 1; // ADC ready
27 uint32_t volatile EOSMP : 1; // End of sampling flag
28 uint32_t volatile EOC : 1; // End of conversion flag
29 uint32_t volatile EOS : 1; // End of regular sequence flag
30 uint32_t volatile OVR : 1; // Overrun
31 uint32_t volatile JEOC : 1; // Injected channel end of conversion.
32 uint32_t volatile JEOS : 1; // Injected channel end of sequence flag
33 uint32_t volatile AWD1 : 1; // Analog watchdog 1 flag
34 uint32_t volatile AWD2 : 1; // Analog watchdog 2 flag
35 uint32_t volatile AWD3 : 1; // Analog watchdog 3 flag
36 uint32_t volatile JQOVF : 1; // Injected context queue overflow
37 uint32_t volatile : 1; // - reserved
38 uint32_t volatile LDORDY : 1; // ADC LDO output voltage ready bit
39 uint32_t volatile : 19; // - reserved
40 };
41
45 struct ADC_IER {
46 uint32_t volatile ADRDYIE : 1; // ADC ready interrupt enable
47 uint32_t volatile EOSMPIE : 1; // End of sampling flag interrupt enable for regular conversions
48 uint32_t volatile EOCIE : 1; // End of regular conversion interrupt enable
49 uint32_t volatile EOSIE : 1; // End of regular sequence of conversions interrupt enable
50 uint32_t volatile OVRIE : 1; // Overrun interrupt enable
51 uint32_t volatile JEOCIE : 1; // End of injected conversion interrupt enable
52 uint32_t volatile JEOSIE : 1; // End of injected sequence of conversions interrupt enable
53 uint32_t volatile AWD1IE : 1; // Analog watchdog 1 interrupt enable
54 uint32_t volatile AWD2IE : 1; // Analog watchdog 2 interrupt enable
55 uint32_t volatile AWD3IE : 1; // Analog watchdog 3 interrupt enable
56 uint32_t volatile JQOVFIE : 1; // Injected context queue overflow interrupt enable
57 uint32_t volatile : 21; // - reserved
58 };
59
63 struct ADC_CR {
64 uint32_t volatile ADEN : 1; // ADC enable control
65 uint32_t volatile ADDIS : 1; // ADC disable command
66 uint32_t volatile ADSTART : 1; // ADC start of regular conversion
67 uint32_t volatile JADSTART : 1; // ADC start of injected conversion
68 uint32_t volatile ADSTP : 1; // ADC stop of regular conversion command
69 uint32_t volatile JADSTP : 1; // ADC stop of injected conversion command
70 uint32_t volatile : 2; // - reserved
71 uint32_t volatile BOOST : 2; // Boost mode control
72 uint32_t volatile : 6; // - reserved
73 uint32_t volatile ADCALLIN : 1; // Linearity calibration
74 uint32_t volatile : 5; // - reserved
75 uint32_t volatile LINCALRDYW1 : 1; // Linearity calibration ready Word 1
76 uint32_t volatile LINCALRDYW2 : 1; // Linearity calibration ready Word 2
77 uint32_t volatile LINCALRDYW3 : 1; // Linearity calibration ready Word 3
78 uint32_t volatile LINCALRDYW4 : 1; // Linearity calibration ready Word 4
79 uint32_t volatile LINCALRDYW5 : 1; // Linearity calibration ready Word 5
80 uint32_t volatile LINCALRDYW6 : 1; // Linearity calibration ready Word 6
81 uint32_t volatile ADVREGEN : 1; // ADC voltage regulator enable
82 uint32_t volatile DEEPPWD : 1; // Deep-power-down enable
83 uint32_t volatile ADCALDIF : 1; // Differential mode for calibration
84 uint32_t volatile ADCAL : 1; // ADC calibration
85 };
86
90 struct ADC_CFGR {
91 uint32_t volatile DMNGT : 2; // Data Management configuration
92 uint32_t volatile RES : 3; // Data resolution
93 uint32_t volatile EXTSEL : 5; // External trigger selection for regular group
94 uint32_t volatile EXTEN : 2; // External trigger enable and polarity selection for regular channels
95 uint32_t volatile OVRMOD : 1; // Overrun Mode
96 uint32_t volatile CONT : 1; // Single / continuous conversion mode for regular conversions
97 uint32_t volatile AUTDLY : 1; // Delayed conversion m
98 uint32_t volatile : 1; // - reserved
99 uint32_t volatile DISCEN : 1; // Discontinuous mode for regular channels
100 uint32_t volatile DISCNUM : 3; // Discontinuous mode channel count
101 uint32_t volatile JDISCEN : 1; // Discontinuous mode on injected channels
102 uint32_t volatile JQM : 1; // JSQR queue mode
103 uint32_t volatile AWD1SGL : 1; // Enable the watchdog 1 on a single channel or on all channels
104 uint32_t volatile AWD1EN : 1; // Analog watchdog 1 enable on regular channels
105 uint32_t volatile JAUTO : 1; // Automatic injected group conversion
106 uint32_t volatile AWD1CH : 5; // Analog watchdog 1 channel selection
107 uint32_t volatile JQDIS : 1; // Injected Queue disable
108 };
109
113 struct ADC_CFGR2 {
114 uint32_t volatile ROVSE : 1; // Regular Oversampling Enable
115 uint32_t volatile JOVSE : 1; // Injected Oversampling Enable
116 uint32_t volatile : 3; // - reserved
117 uint32_t volatile OVSS : 4; // Oversampling right shift
118 uint32_t volatile TROVS : 1; // Triggered Regular Oversampling
119 uint32_t volatile ROVSM : 1; // Regular Oversampling mode
120 uint32_t volatile RSHIFT1 : 1; // Right-shift data after Offset 1 correction
121 uint32_t volatile RSHIFT2 : 1; // Right-shift data after Offset 2 correction
122 uint32_t volatile RSHIFT3 : 1; // Right-shift data after Offset 3 correction
123 uint32_t volatile RSHIFT4 : 1; // Right-shift data after Offset 4 correction
124 uint32_t volatile : 1; // - reserved
125 uint32_t volatile OSVR : 10; // Oversampling ratio
126 uint32_t volatile : 2; // - reserved
127 uint32_t volatile LSHIFT : 4; // Left shift factor
128 };
129
133 struct ADC_SMPR1 {
134 uint32_t volatile SMP0 : 3; // Channel x sampling time selection (x = 0 to 9)
135 uint32_t volatile SMP1 : 3; // Channel x sampling time selection (x = 0 to 9)
136 uint32_t volatile SMP2 : 3; // Channel x sampling time selection (x = 0 to 9)
137 uint32_t volatile SMP3 : 3; // Channel x sampling time selection (x = 0 to 9)
138 uint32_t volatile SMP4 : 3; // Channel x sampling time selection (x = 0 to 9)
139 uint32_t volatile SMP5 : 3; // Channel x sampling time selection (x = 0 to 9)
140 uint32_t volatile SMP6 : 3; // Channel x sampling time selection (x = 0 to 9)
141 uint32_t volatile SMP7 : 3; // Channel x sampling time selection (x = 0 to 9)
142 uint32_t volatile SMP8 : 3; // Channel x sampling time selection (x = 0 to 9)
143 uint32_t volatile SMP9 : 3; // Channel x sampling time selection (x = 0 to 9)
144 uint32_t volatile : 2; // - reserved
145 };
146
150 struct ADC_SMPR2 {
151 uint32_t volatile SMP10 : 3; // Channel x sampling time selection (x = 10 to 19)
152 uint32_t volatile SMP11 : 3; // Channel x sampling time selection (x = 10 to 19)
153 uint32_t volatile SMP12 : 3; // Channel x sampling time selection (x = 10 to 19)
154 uint32_t volatile SMP13 : 3; // Channel x sampling time selection (x = 10 to 19)
155 uint32_t volatile SMP14 : 3; // Channel x sampling time selection (x = 10 to 19)
156 uint32_t volatile SMP15 : 3; // Channel x sampling time selection (x = 10 to 19)
157 uint32_t volatile SMP16 : 3; // Channel x sampling time selection (x = 10 to 19)
158 uint32_t volatile SMP17 : 3; // Channel x sampling time selection (x = 10 to 19)
159 uint32_t volatile SMP18 : 3; // Channel x sampling time selection (x = 10 to 19)
160 uint32_t volatile SMP19 : 3; // Channel x sampling time selection (x = 10 to 19)
161 uint32_t volatile : 2; // - reserved
162 };
163
167 struct ADC_PCSEL {
168 uint32_t volatile PCSEL0 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
169 uint32_t volatile PCSEL1 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
170 uint32_t volatile PCSEL2 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
171 uint32_t volatile PCSEL3 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
172 uint32_t volatile PCSEL4 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
173 uint32_t volatile PCSEL5 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
174 uint32_t volatile PCSEL6 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
175 uint32_t volatile PCSEL7 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
176 uint32_t volatile PCSEL8 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
177 uint32_t volatile PCSEL9 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
178 uint32_t volatile PCSEL10 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
179 uint32_t volatile PCSEL11 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
180 uint32_t volatile PCSEL12 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
181 uint32_t volatile PCSEL13 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
182 uint32_t volatile PCSEL14 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
183 uint32_t volatile PCSEL15 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
184 uint32_t volatile PCSEL16 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
185 uint32_t volatile PCSEL17 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
186 uint32_t volatile PCSEL18 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
187 uint32_t volatile PCSEL19 : 1; // Channel x (VINP[i]) pre selection (x = 0 to 19)
188 uint32_t volatile : 12; // - reserved
189 };
190
194 struct ADC_LTRx {
195 uint32_t volatile LTR1 : 26; // Analog watchdog 1 lower threshold
196 uint32_t volatile : 6; // - reserved
197 };
198
202 struct ADC_HTRx {
203 uint32_t volatile HTR1 : 26; // Analog watchdog 1 lower threshold
204 uint32_t volatile : 6; // - reserved
205 };
206
210 struct ADC_SQR1 {
211 uint32_t volatile L : 4; // Regular channel sequence length
212 uint32_t volatile : 2; // - reserved
213 uint32_t volatile SQ1 : 5; // 1st conversion in regular sequence
214 uint32_t volatile : 1; // - reserved
215 uint32_t volatile SQ2 : 5; // 2nd conversion in regular sequence
216 uint32_t volatile : 1; // - reserved
217 uint32_t volatile SQ3 : 5; // 3rd conversion in regular sequence
218 uint32_t volatile : 1; // - reserved
219 uint32_t volatile SQ4 : 5; // 4th conversion in regular sequence
220 uint32_t volatile : 3; // - reserved
221 };
222
226 struct ADC_SQR2 {
227 uint32_t volatile SQ5 : 5; // 5th conversion in regular sequence
228 uint32_t volatile : 1; // - reserved
229 uint32_t volatile SQ6 : 5; // 6th conversion in regular sequence
230 uint32_t volatile : 1; // - reserved
231 uint32_t volatile SQ7 : 5; // 7th conversion in regular sequence
232 uint32_t volatile : 1; // - reserved
233 uint32_t volatile SQ8 : 5; // 8th conversion in regular sequence
234 uint32_t volatile : 1; // - reserved
235 uint32_t volatile SQ9 : 5; // 9th conversion in regular sequence
236 uint32_t volatile : 3; // - reserved
237 };
238
242 struct ADC_SQR3 {
243 uint32_t volatile SQ10 : 5; // 10th conversion in regular sequence
244 uint32_t volatile : 1; // - reserved
245 uint32_t volatile SQ11 : 5; // 11th conversion in regular sequence
246 uint32_t volatile : 1; // - reserved
247 uint32_t volatile SQ12 : 5; // 12th conversion in regular sequence
248 uint32_t volatile : 1; // - reserved
249 uint32_t volatile SQ13 : 5; // 13th conversion in regular sequence
250 uint32_t volatile : 1; // - reserved
251 uint32_t volatile SQ14 : 5; // 14th conversion in regular sequence
252 uint32_t volatile : 3; // - reserved
253 };
254
258 struct ADC_SQR4 {
259 uint32_t volatile SQ15 : 5; // 15th conversion in regular sequence
260 uint32_t volatile : 1; // - reserved
261 uint32_t volatile SQ16 : 5; // 16th conversion in regular sequence
262 uint32_t volatile : 21; // - reserved
263 };
264
268 struct ADC_DR {
269 uint32_t volatile RDATA : 32; // Regular data converted
270 };
271
275 struct ADC_JSQR {
276 uint32_t volatile JL : 2; // Injected channel sequence length
277 uint32_t volatile JEXTSEL : 5; // External trigger selection for injected group
278 uint32_t volatile JEXTEN : 2; // External trigger enable and polarity selection for injected channels
279 uint32_t volatile JSQ1 : 5; // 1st conversion in the injected sequence
280 uint32_t volatile : 1; // - reserved
281 uint32_t volatile JSQ2 : 5; // 2nd conversion in the injected sequence
282 uint32_t volatile : 1; // - reserved
283 uint32_t volatile JSQ3 : 5; // 3rd conversion in the injected sequence
284 uint32_t volatile : 1; // - reserved
285 uint32_t volatile JSQ4 : 5; // 4th conversion in the injected sequence
286 };
287
291 struct ADC_OFRy {
292 uint32_t volatile OFFSETy : 26; // 1Data offset y for the channel programmed into bits OFFSETy_CH[4:0]
293 uint32_t volatile OFFSETy_CH : 5; // Channel selection for the Data offset y
294 uint32_t volatile SSATE : 1; // Signed saturation Enable
295 };
296
300 struct ADC_JDRy {
301 uint32_t volatile JDATA : 32; // Injected data
302 };
303
307 struct ADC_AWDxCR {
308 uint32_t volatile AWDxCH : 20; // Analog watchdog x channel selection
309 uint32_t volatile : 12; // - reserved
310 };
311
315 struct ADC_DIFSEL {
316 uint32_t volatile DIFSEL : 20; // Differential mode for channels 19 to 0
317 uint32_t volatile : 12; // - reserved
318 };
319
323 struct ADC_CALFACT {
324 uint32_t volatile CALFACT_S : 11; // Calibration Factors In Single-Ended mode
325 uint32_t volatile : 5; // - reserved
326 uint32_t volatile CALFACT_D : 11; // Calibration Factors In differential mode
327 uint32_t volatile : 5; // - reserved
328 };
329
334 uint32_t volatile LINCALFACT : 30; // Linearity Calibration Factor
335 uint32_t volatile : 2; // - reserved
336 };
337
342 return *reinterpret_cast<ADC12Registers*>(module);
343 }
344
345 // Registers
346 volatile ADC_ISR ISR; // Offset 0x00
347 volatile ADC_IER IER; // Offset 0x04
348 volatile ADC_CR CR; // Offset 0x08
349 volatile ADC_CFGR CFGR; // Offset 0x0C
350 volatile ADC_CFGR2 CFGR2; // Offset 0x10
351 volatile ADC_SMPR1 SMPR1; // Offset 0x14
352 volatile ADC_SMPR2 SMPR2; // Offset 0x18
353 volatile ADC_PCSEL PCSEL; // Offset 0x1C
354 ADC_LTRx volatile LTR1; // Offset 0x20
355 ADC_HTRx volatile HTR1; // Offset 0x24
356 uint32_t volatile _reserved0[2U];
357 volatile ADC_SQR1 SQR1; // Offset 0x30
358 volatile ADC_SQR2 SQR2; // Offset 0x34
359 volatile ADC_SQR3 SQR3; // Offset 0x38
360 volatile ADC_SQR4 SQR4; // Offset 0x3C
361 volatile ADC_DR DR; // Offset 0x40
362 uint32_t volatile _reserved1[2U];
363 volatile ADC_JSQR JSQR; // Offset 0x4C
364 uint32_t volatile _reserved2[4U];
365 ADC_OFRy volatile OFR1; // Offset 0x60
366 ADC_OFRy volatile OFR2; // Offset 0x64
367 ADC_OFRy volatile OFR3; // Offset 0x68
368 ADC_OFRy volatile OFR4; // Offset 0x6C
369 uint32_t volatile _reserved3[4U];
370 ADC_JDRy volatile JDR1; // Offset 0x80
371 ADC_JDRy volatile JDR2; // Offset 0x84
372 ADC_JDRy volatile JDR3; // Offset 0x88
373 ADC_JDRy volatile JDR4; // Offset 0x8C
374 uint32_t volatile _reserved4[4U];
375 ADC_AWDxCR volatile AWD2CR; // Offset 0xA0
376 ADC_AWDxCR volatile AWD3CR; // Offset 0xA4
377 uint32_t volatile _reserved5[2U];
378 ADC_LTRx volatile LTR2; // Offset 0xB0
379 ADC_HTRx volatile HTR2; // Offset 0xB4
380 ADC_LTRx volatile LTR3; // Offset 0xB8
381 ADC_HTRx volatile HTR3; // Offset 0xBC
382 volatile ADC_DIFSEL DIFSEL; // Offset 0xC0
383 volatile ADC_CALFACT CALFACT; // Offset 0xC4
384 volatile ADC_CALFACT2 CALFACT2; // Offset 0xC8
385
386private:
387
392
396 ADC12Registers(ADC12Registers const& other);
397
401 ADC12Registers& operator=(ADC12Registers const& other);
402};
403
404} // namespace registers
405} // namespace stm32h730
406} // namespace hal
407} // namespace base
408} // namespace imt
409
410#endif // STM32H730_ADC12REGISTERS_H
ADCModuleAddress
Enumeration of the available ADC modules identifiers.
This is a application specific file which is used to configure Imt.Base.Core.Math.
unsigned __int32 uint32_t
Definition stdint.h:64
ADC analog watchdog x configuration register (ADC_AWDxCR) (x=2.3), chapter 28.6.19,...
ADC calibration factor register 2 (ADC_CALFACT2), chapter 28.6.27.
ADC calibration factors register (ADC_CALFACT), chapter 28.6.26.
ADC configuration register 2 (ADC_CFGR2), chapter 28.6.5.
ADC configuration register (ADC_CFGR), chapter 28.6.4.
ADC control register (ADC_CR), chapter 28.6.3.
ADC differential mode selection register (ADC_DIFSEL), chapter 28.6.25.
ADC reguler data register (ADC_DR), chapter 28.6.15.
ADC watchdog threshold register x (ADC_HTRx) (x=1-3), chapter 28.6.10, 28.6.22, 28....
ADC interrupt enable register (ADC_IER), chapter 28.6.2.
ADC interrupt and status register (ADC_ISR), chapter 28.6.1.
ADC injected channel y data register (ADC_JDRy), chapter 28.6.18.
ADC injected sequence register (ADC_JSQR), chapter 28.6.16.
ADC watchdog threshold register x (ADC_LTRx) (x=1-3), chapter 28.6.9, 28.6.21, 28....
ADC injected channel y offset register (ADC_OFRy), chapter 28.6.17.
ADC channel preselection register (ADC_PCSEL), chapter 28.6.8.
ADC sample time register 1 (ADC_SMPR1), chapter 28.6.6.
ADC sample time register 2 (ADC_SMPR2), chapter 28.6.7.
ADC regular sequence register 1 (ADC_SQR1), chapter 28.6.11.
ADC regular sequence register 2 (ADC_SQR2), chapter 28.6.12.
ADC regular sequence register 3 (ADC_SQR3), chapter 28.6.13.
ADC regular sequence register 4 (ADC_SQR4), chapter 28.6.14.
Analog digital converter (ADC) register structure.
static ADC12Registers & getInstance(ADCModuleAddress const module)
Gets the instance of the registers for a given ADC module in memory.