OpenMPTL - STM32F4
C++ Microprocessor Template Library
Public Types | Static Public Attributes | List of all members
mptl::system_clock_pllcfgr< output_freq, hse_freq > Struct Template Reference

PLL configuration with fixed PLLP=2.

#include <rcc.hpp>

Public Types

using type = reglist< regval< RCC::PLLCFGR::PLLM, m >, regval< RCC::PLLCFGR::PLLN, n >, regval< RCC::PLLCFGR::PLLP,(p > > 1) - 1 >, regval< RCC::PLLCFGR::PLLQ, q > >
 

Static Public Attributes

static constexpr freq_t vco_input = mhz(1)
 
static constexpr unsigned p = 2
 
static constexpr unsigned m = hse_freq / vco_input
 
static constexpr unsigned n = (output_freq / vco_input ) * p
 
static constexpr unsigned q = n / 48 + (n % 48 ? 1 : 0)
 
static constexpr freq_t vco_output = vco_input * n
 
static constexpr freq_t pll_output = vco_output / p
 
static constexpr freq_t pll48clk = vco_output / q
 
static constexpr bool usb_otg_available = ( pll48clk == mhz(48) )
 
static constexpr bool sdio_available = ( pll48clk <= mhz(48) )
 
static constexpr bool rng_available = ( pll48clk <= mhz(48) )
 

Member Typedef Documentation

◆ type

template<freq_t output_freq, freq_t hse_freq>
using mptl::system_clock_pllcfgr< output_freq, hse_freq >::type = reglist < regval< RCC::PLLCFGR::PLLM, m >, regval< RCC::PLLCFGR::PLLN, n >, regval< RCC::PLLCFGR::PLLP, (p > > 1) - 1 >, regval< RCC::PLLCFGR::PLLQ, q > >

Member Data Documentation

◆ m

template<freq_t output_freq, freq_t hse_freq>
constexpr unsigned mptl::system_clock_pllcfgr< output_freq, hse_freq >::m = hse_freq / vco_input
static

◆ n

template<freq_t output_freq, freq_t hse_freq>
constexpr unsigned mptl::system_clock_pllcfgr< output_freq, hse_freq >::n = (output_freq / vco_input ) * p
static

◆ p

template<freq_t output_freq, freq_t hse_freq>
constexpr unsigned mptl::system_clock_pllcfgr< output_freq, hse_freq >::p = 2
static

◆ pll48clk

template<freq_t output_freq, freq_t hse_freq>
constexpr freq_t mptl::system_clock_pllcfgr< output_freq, hse_freq >::pll48clk = vco_output / q
static

◆ pll_output

template<freq_t output_freq, freq_t hse_freq>
constexpr freq_t mptl::system_clock_pllcfgr< output_freq, hse_freq >::pll_output = vco_output / p
static

◆ q

template<freq_t output_freq, freq_t hse_freq>
constexpr unsigned mptl::system_clock_pllcfgr< output_freq, hse_freq >::q = n / 48 + (n % 48 ? 1 : 0)
static

◆ rng_available

template<freq_t output_freq, freq_t hse_freq>
constexpr bool mptl::system_clock_pllcfgr< output_freq, hse_freq >::rng_available = ( pll48clk <= mhz(48) )
static

◆ sdio_available

template<freq_t output_freq, freq_t hse_freq>
constexpr bool mptl::system_clock_pllcfgr< output_freq, hse_freq >::sdio_available = ( pll48clk <= mhz(48) )
static

◆ usb_otg_available

template<freq_t output_freq, freq_t hse_freq>
constexpr bool mptl::system_clock_pllcfgr< output_freq, hse_freq >::usb_otg_available = ( pll48clk == mhz(48) )
static

◆ vco_input

template<freq_t output_freq, freq_t hse_freq>
constexpr freq_t mptl::system_clock_pllcfgr< output_freq, hse_freq >::vco_input = mhz(1)
static

◆ vco_output

template<freq_t output_freq, freq_t hse_freq>
constexpr freq_t mptl::system_clock_pllcfgr< output_freq, hse_freq >::vco_output = vco_input * n
static

The documentation for this struct was generated from the following file: