distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
STM32F4-RCC.hpp File Reference

Header for RCC-related functions for STM32F4. More...

#include "distortos/distortosConfiguration.h"
#include <cstdint>
Include dependency graph for STM32F4-RCC.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 distortos
 Top-level namespace of distortos project.
 
 distortos::chip
 Chip-related code of distortos project.
 

Enumerations

enum  distortos::chip::SystemClockSource : uint8_t { distortos::chip::SystemClockSource::hsi, distortos::chip::SystemClockSource::hse, distortos::chip::SystemClockSource::pll }
 system clock source More...
 

Functions

int distortos::chip::configureAhbClockDivider (uint16_t hpre)
 Configures divider of AHB clock (HPRE value). More...
 
int distortos::chip::configureApbClockDivider (bool ppre2, uint8_t ppre)
 Configures divider of APB1 or APB2 clock (PPRE1 or PPRE2 value). More...
 
void distortos::chip::configurePllClockSource (bool hse)
 Configures clock source of main and audio PLLs. More...
 
int distortos::chip::configurePllInputClockDivider (uint8_t pllm)
 Configures divider of PLL input clock (PLLM value) for main and audio PLLs. More...
 
void distortos::chip::disableHse ()
 Disables HSE clock. More...
 
void distortos::chip::disablePll ()
 Disables main PLL. More...
 
void distortos::chip::enableHse (bool bypass)
 Enables HSE clock. More...
 
int distortos::chip::enablePll (uint16_t plln, uint8_t pllp, uint8_t pllq)
 Enables main PLL. More...
 
void distortos::chip::switchSystemClock (SystemClockSource source)
 Switches system clock. More...
 

Variables

constexpr uint8_t distortos::chip::minPllm {2}
 minimum allowed value for PLLM More...
 
constexpr uint8_t distortos::chip::maxPllm {63}
 maximum allowed value for PLLM More...
 
constexpr uint16_t distortos::chip::minPlln {50}
 minimum allowed value for PLLN More...
 
constexpr uint16_t distortos::chip::maxPlln {432}
 maximum allowed value for PLLN More...
 
constexpr uint8_t distortos::chip::minPllq {2}
 minimum allowed value for PLLQ More...
 
constexpr uint8_t distortos::chip::maxPllq {15}
 maximum allowed value for PLLQ More...
 
constexpr uint8_t distortos::chip::pllpDiv2 {2}
 first allowed value for PLLP - 2 More...
 
constexpr uint8_t distortos::chip::pllpDiv4 {4}
 second allowed value for PLLP - 4 More...
 
constexpr uint8_t distortos::chip::pllpDiv6 {6}
 third allowed value for PLLP - 6 More...
 
constexpr uint8_t distortos::chip::pllpDiv8 {8}
 fourth allowed value for PLLP - 8 More...
 
constexpr uint16_t distortos::chip::hpreDiv1 {1}
 first allowed value for AHB divider - 1 More...
 
constexpr uint16_t distortos::chip::hpreDiv2 {2}
 second allowed value for AHB divider - 2 More...
 
constexpr uint16_t distortos::chip::hpreDiv4 {4}
 third allowed value for AHB divider - 4 More...
 
constexpr uint16_t distortos::chip::hpreDiv8 {8}
 fourth allowed value for AHB divider - 8 More...
 
constexpr uint16_t distortos::chip::hpreDiv16 {16}
 fifth allowed value for AHB divider - 16 More...
 
constexpr uint16_t distortos::chip::hpreDiv64 {64}
 sixth allowed value for AHB divider - 64 More...
 
constexpr uint16_t distortos::chip::hpreDiv128 {128}
 seventh allowed value for AHB divider - 128 More...
 
constexpr uint16_t distortos::chip::hpreDiv256 {256}
 eighth allowed value for AHB divider - 256 More...
 
constexpr uint16_t distortos::chip::hpreDiv512 {512}
 ninth allowed value for AHB divider - 512 More...
 
constexpr uint8_t distortos::chip::ppreDiv1 {1}
 first allowed value for APB1 and APB2 dividers - 1 More...
 
constexpr uint8_t distortos::chip::ppreDiv2 {2}
 second allowed value for APB1 and APB2 dividers - 2 More...
 
constexpr uint8_t distortos::chip::ppreDiv4 {4}
 third allowed value for APB1 and APB2 dividers - 4 More...
 
constexpr uint8_t distortos::chip::ppreDiv8 {8}
 fourth allowed value for APB1 and APB2 dividers - 8 More...
 
constexpr uint8_t distortos::chip::ppreDiv16 {16}
 fifth allowed value for APB1 and APB2 dividers - 16 More...
 

Detailed Description

Header for RCC-related functions for STM32F4.

Author
Copyright (C) 2015-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.