|
| enum | PllSource : uint8_t { Hsi = 0,
Hse = 1
} |
| |
| enum | AhbPrescaler : uint8_t {
Div1 = 0b0000,
Div2 = 0b1000,
Div4 = 0b1001,
Div8 = 0b1010,
Div16 = 0b1011,
Div64 = 0b1100,
Div128 = 0b1101,
Div256 = 0b1110,
Div512 = 0b1111
} |
| |
| enum | ApbPrescaler : uint8_t {
Div1 = 0b000,
Div2 = 0b100,
Div4 = 0b101,
Div8 = 0b110,
Div16 = 0b111
} |
| |
| enum | SystemClockSource : uint32_t { Hsi = 0b00,
Hse = 0b01,
Pll = 0b10
} |
| |
| enum | RealTimeClockSource : uint8_t { Disabled = 0b00,
Lse = 0b01,
Lsi = 0b10,
Hse = 0b11
} |
| |
| enum | AdcPrescaler : uint8_t { Div2 = 0b00,
Div4 = 0b01,
Div6 = 0b10,
Div8 = 0b11
} |
| |
| enum | I2sClockSource : uint32_t { PllI2s,
External
} |
| |
| enum | McoPrescaler : uint8_t {
Div1 = 0b000,
Div2 = 0b100,
Div3 = 0b101,
Div4 = 0b110,
Div5 = 0b111
} |
| |
| enum | Mco1ClockSource : uint8_t { Hsi = 0b00,
Lse = 0b01,
Hse = 0b10,
Pll = 0b11
} |
| |
| enum | Mco2ClockSource : uint8_t { SysClk = 0b00,
PllI2s = 0b01,
Hse = 0b10,
Pll = 0b11
} |
| |
|
|
template<class... Signals> |
| static void | connect () |
| | Connect GPIO signals like MCO to the clock tree.
|
| |
|
template<Peripheral peripheral> |
| static void | enable () |
| | Enable the clock for a peripheral.
|
| |
|
template<Peripheral peripheral> |
| static bool | isEnabled () |
| | Check if a peripheral clock is enabled.
|
| |
|
template<Peripheral peripheral> |
| static void | disable () |
| | Disable the clock for a peripheral.
|
| |
| template<uint32_t Core_Hz, uint16_t Core_mV = 3300> |
| static uint32_t | setFlashLatency () |
| |
|
template<uint32_t Core_Hz> |
| static void | updateCoreFrequency () |
| | Update the SystemCoreClock and delay variables.
|
| |
|
static bool | enableHsiClock (uint32_t waitLoops=0x10000) |
| |
|
static bool | enableHseClock (uint32_t waitLoops=0x10000) |
| |
|
static bool | enableHseCrystal (uint32_t waitLoops=0x10000) |
| |
|
static bool | enableLsiClock (uint32_t waitLoops=0x10000) |
| |
|
static bool | enableLseClock (uint32_t waitLoops=0x10000) |
| |
|
static bool | enableLseCrystal (uint32_t waitLoops=0x10000) |
| |
|
static bool | enablePll (PllSource src, PllConfig cfg, uint32_t waitLoops=0x10000) |
| |
|
static bool | disablePll (uint32_t waitLoops=0x10000) |
| |
|
static bool | enablePllI2s (PllI2sConfig cfg, uint32_t waitLoops=0x10000) |
| |
|
static bool | disablePllI2s (uint32_t waitLoops=0x10000) |
| |
|
static void | setAhbPrescaler (AhbPrescaler prescaler) |
| |
|
static void | setApb1Prescaler (ApbPrescaler prescaler) |
| |
|
static void | setApb2Prescaler (ApbPrescaler prescaler) |
| |
|
static bool | enableSystemClock (SystemClockSource src, uint32_t waitLoops=0x10000) |
| |
|
static void | setRealTimeClockSource (RealTimeClockSource src, uint8_t hseDivider=2) |
| |
|
static void | setAdcPrescaler (AdcPrescaler prescaler) |
| |
|
static void | setI2sClockSource (I2sClockSource src) |
| |
|
static void | setMco1ClockSource (Mco1ClockSource src, McoPrescaler prescaler=McoPrescaler::Div1) |
| |
|
static void | setMco2ClockSource (Mco2ClockSource src, McoPrescaler prescaler=McoPrescaler::Div1) |
| |
Reset and Clock Control for STM32F2 devices.
This class abstracts access to clock settings on the STM32F2 family. You need to use this class to enable internal and external clock sources & outputs, set PLL parameters and AHB & APB prescalers. Don't forget to set the flash latencies.
- Author
- Niklas Hauser