modm API documentation
modm::platform::GenericClockController Class Reference

#include <modm/platform/clock/gclk.hpp>

Static Public Member Functions

template<uint32_t Core_Hz, uint16_t Vdd_mV = 3300>
static uint32_t setFlashLatency ()
 
template<uint32_t Core_Hz>
static void updateCoreFrequency ()
 
static bool configureOsc8m (Osc8mPrescaler prescaler, uint32_t waitCycles=10'000)
 Configure frequency of the internal oscillator.
 
static bool enableDfll48m (uint32_t waitCycles=10'000)
 Enable DFLL48M in open-loop mode.
 
template<frequency_t reference>
static bool enableDfll48mClosedLoop (uint32_t waitCycles=10'000)
 
template<DpllSource source, frequency_t output, uint16_t tolerance_ppm = 5>
static bool enableDpll ()
 Enable PLL with automatically computed coefficients If the specified tolerance is exceeded, compilation will fail.
 
template<DpllSource source, DpllConfig config>
static bool enableDpll ()
 Enable PLL with manual configuration.
 
static void disableDpll ()
 
template<frequency_t frequency, XoscStartupTime startupTime = XoscStartupTime::Start_15625us>
static bool enableExternalCrystal (uint32_t waitCycles=(1000u<< unsigned (startupTime)))
 
static bool enableExternalClock (uint32_t waitCycles=10'000)
 
static bool enableExternalCrystal32k (Xosc32StartupTime time)
 
static bool enableExternalClock32k ()
 
template<ClockPeripheral peripheral>
static void connect (ClockGenerator clockGen)
 
template<ClockGenerator clockGen, GeneratorConfiguration config>
static void enableGenerator ()
 
template<ClockGenerator clockGen, ClockSource source>
static void enableGenerator ()
 
template<ClockGenerator clockGen>
static void disableGenerator ()
 
template<ClockSource source>
static bool setSystemClock ()
 

Static Public Attributes

static constexpr uint32_t BootFrequency = 1'000'000
 

Detailed Description

Clock management

Member Function Documentation

template<frequency_t reference>
static bool modm::platform::GenericClockController::enableDfll48mClosedLoop ( uint32_t  waitCycles = 10'000)
static

Enable DFLL48M in closed-loop mode

Warning
The reference clock on GCLK channel 0 must be available prior to calling this function
template<ClockSource source>
static bool modm::platform::GenericClockController::setSystemClock ( )
static

Convenience function to configure "Main" clock generator source with a divider of 1.

Equivalent to:

const auto config = GeneratorConfiguration{ .source = SOURCE, .divider = 1 };
GenericClockController::enableGenerator<ClockGenerator::Main, config>();

The documentation for this class was generated from the following files: