28 #ifndef ARCH_REG_ADC_HPP_INCLUDED 29 #define ARCH_REG_ADC_HPP_INCLUDED 37 template<
unsigned adc_no>
40 static_assert((adc_no >= 1) && (adc_no <= 3),
"invalid index for register");
43 adc_no == 1 ? 0x40012400 :
44 adc_no == 2 ? 0x40012800 :
45 adc_no == 3 ? 0x40013C00 :
52 :
public reg< uint32_t, base_addr + 0x0, rw, 0x00000000 >
67 :
public reg< uint32_t, base_addr + 0x4, rw, 0x00000000 >
90 :
public reg< uint32_t, base_addr + 0x8, rw, 0x00000000 >
113 :
public reg< uint32_t, base_addr + 0xc, rw, 0x00000000 >
131 :
public reg< uint32_t, base_addr + 0x10, rw, 0x00000000 >
152 template<
unsigned channel>
156 static_assert(channel <= 17,
"invalid channel");
164 template<
unsigned jofr_no>
166 :
public reg< uint32_t, base_addr + 0x14 + (jofr_no - 1) * 4, rw, 0x00000000 >
168 static_assert((jofr_no >= 1) && (jofr_no <= 4),
"invalid index for JOFR register");
169 using type =
reg< uint32_t, base_addr + 0x14 + (jofr_no - 1) * 4,
rw, 0x00000000 >;
178 :
public reg< uint32_t, base_addr + 0x24, rw, 0x00000FFF >
189 :
public reg< uint32_t, base_addr + 0x28, rw, 0x00000000 >
200 :
public reg< uint32_t, base_addr + 0x2c, rw, 0x00000000 >
215 :
public reg< uint32_t, base_addr + 0x30, rw, 0x00000000 >
231 :
public reg< uint32_t, base_addr + 0x34, rw, 0x00000000 >
248 template<
unsigned rank>
250 :
public std::conditional< (rank > 12),
SQR1,
253 static_assert((rank >= 1) && (rank <= 16),
"invalid rank");
255 using type =
typename std::conditional< (rank > 12),
SQR1,
265 :
public reg< uint32_t, base_addr + 0x38, rw, 0x00000000 >
279 template<
unsigned jdr_no>
281 :
public reg< uint32_t, base_addr + 0x3c + (jdr_no - 1) * 4, ro, 0x00000000 >
283 static_assert((jdr_no >= 1) && (jdr_no <= 4),
"invalid index for JDR register");
284 using type =
reg< uint32_t, base_addr + 0x3c + (jdr_no - 1) * 4,
ro, 0x00000000 >;
293 :
public reg< uint32_t, base_addr + 0x4c, ro, 0x00000000 >
304 #endif // ARCH_REG_ADC_HPP_INCLUDED Status register.
Definition: adc.hpp:51
regular data register
Definition: adc.hpp:292
Control register 2.
Definition: adc.hpp:89
Regular sequence register: provides SQR1, SQR2 or SQR3, depending on channel.
Definition: adc.hpp:249
Injected sequence register.
Definition: adc.hpp:264
Regular sequence register 1.
Definition: adc.hpp:199
typename std::conditional<(channel > 9), SMPR1, SMPR2 >::type type
Definition: adc.hpp:157
Sample time register: provides SMPR1 or SMPR2, depending on channel.
Definition: adc.hpp:153
Injected channel data offset register x.
Definition: adc.hpp:165
Sample time register 1.
Definition: adc.hpp:112
Regular sequence register 2.
Definition: adc.hpp:214
static constexpr reg_addr_t base_addr
Definition: adc.hpp:42
reg< uint32_t, base_addr+0x0, rw, 0x00000000 > type
Definition: adc.hpp:54
Sample time register 2.
Definition: adc.hpp:130
typename std::conditional<(rank > 12), SQR1, typename std::conditional<(rank > 6), SQR2, SQR3 >::type >::type type
Definition: adc.hpp:256
Regular sequence register 3.
Definition: adc.hpp:230
Watchdog higher threshold register.
Definition: adc.hpp:177
Analog-to-digital converter (ADC)
Definition: adc.hpp:38
Watchdog lower threshold register.
Definition: adc.hpp:188
Injected data register x.
Definition: adc.hpp:280
Control register 1.
Definition: adc.hpp:66