|
PER Firmware
|
#include "common/phal_F4/rcc/rcc.h"Functions | |
| uint8_t | PHAL_configureClockRates (ClockRateConfig_t *config) |
| Configure all AHB/APB/System clocks from the provided configuration. | |
| bool | PHAL_configurePLLVCO (PLLSrc_t pll_source, uint32_t vco_output_rate_target_hz) |
| Configure PLL VCO Clock rate The VCO clock is the input clock for the different PLL outputs. Each PLL output will divide the VCO clock to get its output. | |
| bool | PHAL_configurePLLSystemClock (uint32_t system_clock_target_hz) |
| Configure PLL CLK as the System Clock at the desired target frequency. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED. | |
| bool | PHAL_configureHSISystemClock () |
| Configure HSI CLK as the System Clock. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED. | |
| bool | PHAL_configureHSESystemClock () |
| Configure HSE CLK as the System Clock. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED. | |
| bool | PHAL_configureAHBClock (uint32_t ahb_clock_target_hz) |
| Configure AHB Clock rate by modifying the AHB prescaler value. | |
| bool | PHAL_configureAPB1Clock (uint32_t apb1_clock_target_hz) |
| Configure APB1 Clock rate by modifying the APB1 prescaler value. | |
| bool | PHAL_configureAPB2Clock (uint32_t apb2_clock_target_hz) |
| Configure APB1 Clock rate by modifying the APB2 prescaler value. | |
| void | PHAL_trimHSI (uint8_t trim_val) |
| Trim the HSI clock 0 <= trim_val <= 31 17 = increase speed by ~0.2% 15 = decrease speed by ~0.2%. | |
| bool | PHAL_enableMCO1 (GPIO_TypeDef *bank, uint8_t pin, MCO1Source_t source, MCODivisor_t division) |
| Enable the Clock Out Pin 1 It is highly recommended to change this only after reset before enabling the external oscillators and the PLL. | |
Variables | |
| uint32_t | APB1ClockRateHz |
| uint32_t | APB2ClockRateHz |
| uint32_t | AHBClockRateHz |
| uint32_t | PLLClockRateHz |
| bool PHAL_configureAHBClock | ( | uint32_t | ahb_clock_target_hz | ) |
Configure AHB Clock rate by modifying the AHB prescaler value.
| ahb_clock_target_hz |
| ahb_clock_target_hz |
| bool PHAL_configureAPB1Clock | ( | uint32_t | apb1_clock_target_hz | ) |
Configure APB1 Clock rate by modifying the APB1 prescaler value.
| apb1_clock_target_hz |
| apb1_clock_target_hz |
| bool PHAL_configureAPB2Clock | ( | uint32_t | apb2_clock_target_hz | ) |
Configure APB1 Clock rate by modifying the APB2 prescaler value.
| apb2_clock_target_hz |
| apb2_clock_target_hz |
| uint8_t PHAL_configureClockRates | ( | ClockRateConfig_t * | config | ) |
Configure all AHB/APB/System clocks from the provided configuration.
| config | Configuration to try to match |
| bool PHAL_configureHSESystemClock | ( | ) |
Configure HSE CLK as the System Clock. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED.
| bool PHAL_configureHSISystemClock | ( | ) |
Configure HSI CLK as the System Clock. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED.
| bool PHAL_configurePLLSystemClock | ( | uint32_t | system_clock_target_hz | ) |
Configure PLL CLK as the System Clock at the desired target frequency. SHOULD BE DONE BEFORE ANY OF THE AHB OR APB CLOCKS ARE CHANGED.
| system_clock_target_hz |
| bool PHAL_configurePLLVCO | ( | PLLSrc_t | pll_source, |
| uint32_t | vco_output_rate_target_hz ) |
Configure PLL VCO Clock rate The VCO clock is the input clock for the different PLL outputs. Each PLL output will divide the VCO clock to get its output.
| PLL | Input rate for PLL, determined by PLL source |
| vco_output_rate_target_hz | Target rate for PLL output |
| bool PHAL_enableMCO1 | ( | GPIO_TypeDef * | bank, |
| uint8_t | pin, | ||
| MCO1Source_t | source, | ||
| MCODivisor_t | division ) |
Enable the Clock Out Pin 1 It is highly recommended to change this only after reset before enabling the external oscillators and the PLL.
This function should be called after GPIO initialization using GPIO_INIT_MCO1_PA8
| bank | GPIO bank |
| pin | GPIO bank |
| source | Clock source to send to the pin |
| division | Division of clock source sent to the pin |
| void PHAL_trimHSI | ( | uint8_t | trim_val | ) |
Trim the HSI clock 0 <= trim_val <= 31 17 = increase speed by ~0.2% 15 = decrease speed by ~0.2%.
| uint32_t AHBClockRateHz |
| uint32_t APB1ClockRateHz |
| uint32_t APB2ClockRateHz |
| uint32_t PLLClockRateHz |