Cortex-M4 (STM32F4) Clock HAL Implementation. More...
#include "core/cortex-m4/clock.h"#include "core/cortex-m4/flash_reg.h"#include "core/cortex-m4/rcc_reg.h"#include <stdint.h>
Functions | |
| void | hal_clock_init (hal_clock_config_t *cfg, hal_pll_config_t *pll_cfg) |
| Initialize system clock and bus prescalers. | |
| uint32_t | hal_clock_get_sysclk (void) |
| Get current system clock (SYSCLK) frequency. | |
| uint32_t | hal_clock_get_ahbclk (void) |
| Get current AHB bus frequency. | |
| uint32_t | hal_clock_get_apb1clk (void) |
| Get current APB1 bus frequency. | |
| uint32_t | hal_clock_get_apb2clk (void) |
| Get current APB2 bus frequency. | |
Cortex-M4 (STM32F4) Clock HAL Implementation.
This file provides a hardware abstraction layer for clock configuration on STM32F4 microcontrollers. It includes functions to:
| uint32_t hal_clock_get_ahbclk | ( | void | ) |
Get current AHB bus frequency.
Get the AHB bus clock frequency.
| uint32_t hal_clock_get_apb1clk | ( | void | ) |
Get current APB1 bus frequency.
Get the APB1 bus clock frequency.
| uint32_t hal_clock_get_apb2clk | ( | void | ) |
Get current APB2 bus frequency.
Get the APB2 bus clock frequency.
| uint32_t hal_clock_get_sysclk | ( | void | ) |
Get current system clock (SYSCLK) frequency.
Get the system clock frequency (SYSCLK).
Determines SYSCLK frequency based on current clock source:
| void hal_clock_init | ( | hal_clock_config_t * | cfg, |
| hal_pll_config_t * | pll_cfg ) |
Initialize system clock and bus prescalers.
Initialize the system clock.
| [in] | cfg | Pointer to clock configuration structure |
| [in] | pll_cfg | Pointer to PLL configuration structure (required if using PLL) |
Configures the complete clock tree including:
< Flash Interface base address
< Flash ACR Latency bit position
< Flash ACR Latency bit position