21 #ifndef ARCH_RCC_HPP_INCLUDED 22 #define ARCH_RCC_HPP_INCLUDED 27 #include <type_traits> 98 template<
typename... Tp >
116 template< freq_t output_freq, freq_t hse_freq = mhz(8) >
118 static_assert(output_freq == !output_freq,
119 "unsupported system clock frequency (see available template specialisations below)");
127 RCC::CFGR::HPRE ::DIV1,
128 RCC::CFGR::PPRE1 ::DIV1,
129 RCC::CFGR::PPRE2 ::DIV1,
130 RCC::CFGR::PLLSRC ::HSE,
131 RCC::CFGR::PLLXTPRE::HSE_DIV2,
132 RCC::CFGR::PLLMUL ::MUL6
136 static constexpr
freq_t pclk1_freq = hclk_freq;
137 static constexpr
freq_t pclk2_freq = hclk_freq;
145 RCC::CFGR::HPRE ::DIV1,
146 RCC::CFGR::PPRE1 ::DIV1,
147 RCC::CFGR::PPRE2 ::DIV1,
148 RCC::CFGR::PLLSRC ::HSE,
149 RCC::CFGR::PLLXTPRE::HSE_DIV2,
150 RCC::CFGR::PLLMUL ::MUL9
154 static constexpr
freq_t pclk1_freq = hclk_freq;
155 static constexpr
freq_t pclk2_freq = hclk_freq;
163 RCC::CFGR::HPRE ::DIV1,
164 RCC::CFGR::PPRE1 ::DIV2,
165 RCC::CFGR::PPRE2 ::DIV1,
166 RCC::CFGR::PLLSRC ::HSE,
167 RCC::CFGR::PLLXTPRE::HSE_DIV1,
168 RCC::CFGR::PLLMUL ::MUL6
172 static constexpr
freq_t pclk1_freq = hclk_freq / 2;
173 static constexpr
freq_t pclk2_freq = hclk_freq;
181 RCC::CFGR::HPRE ::DIV1,
182 RCC::CFGR::PPRE1 ::DIV2,
183 RCC::CFGR::PPRE2 ::DIV1,
184 RCC::CFGR::PLLSRC ::HSE,
185 RCC::CFGR::PLLXTPRE::HSE_DIV1,
186 RCC::CFGR::PLLMUL ::MUL7
190 static constexpr
freq_t pclk1_freq = hclk_freq / 2;
191 static constexpr
freq_t pclk2_freq = hclk_freq;
200 RCC::CFGR::HPRE ::DIV1,
201 RCC::CFGR::PPRE1 ::DIV2,
202 RCC::CFGR::PPRE2 ::DIV1,
203 RCC::CFGR::PLLSRC ::HSE,
204 RCC::CFGR::PLLXTPRE::HSE_DIV1,
205 RCC::CFGR::PLLMUL ::MUL9
209 static constexpr
freq_t pclk1_freq = hclk_freq / 2;
210 static constexpr
freq_t pclk2_freq = hclk_freq;
238 #if defined (STM32F10X_HD) || defined (STM32F10X_XL) 244 #if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) 247 #if defined (STM32F10X_HD) || defined (STM32F10X_CL) 253 #if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) 258 #if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) 261 #if defined (STM32F10X_HD) || defined (STM32F10X_XL) 267 #endif // ARCH_RCC_HPP_INCLUDED static __always_inline void set(void)
static bool wait_hse_ready(unsigned timeout)
Definition: rcc.hpp:82
static __always_inline void reset_to(void)
static void backup_domain_software_reset(void)
Definition: rcc.hpp:74
static __always_inline bool test(void)
regval< regbits_type, 0x3 > HSE
11: HSE oscillator clock divided by 128 used as RTC clock
Definition: rcc.hpp:405
regval< regbits_type, 0x2 > LSI
10: LSI oscillator clock used as RTC clock
Definition: rcc.hpp:404
typelist< RCC::APB1ENR::PWREN, RCC::APB1ENR::BKPEN > rcc_rtc_clock_resources
Definition: rcc.hpp:228
static void init(void)
Definition: rcc.hpp:101
typename mpl::make_typelist< sane_typelist<>, Tp... >::type typelist
static constexpr freq_t mhz(unsigned long long x)
static void wait_lse_ready(void)
Definition: rcc.hpp:89
regbits< type, 28, 1 > PWREN
Power interface clock enable.
Definition: rcc.hpp:383
regval< regbits_type, 0x1 > LSE
01: LSE oscillator clock used as RTC clock
Definition: rcc.hpp:403
static void configure(void)
Definition: rcc.hpp:106
static __always_inline void clear(void)
static void wait_hse_ready(void)
Definition: rcc.hpp:79