G4 RCC public API implementation.
More...
G4 RCC public API implementation.
- Author
- Millan Kumar (kumar.nosp@m.798@.nosp@m.purdu.nosp@m.e.ed.nosp@m.u)
◆ PHAL_RCC_getAHBClockHz()
| uint32_t PHAL_RCC_getAHBClockHz |
( |
void | | ) |
|
- Returns
- the current AHB (HCLK) rate in Hz
◆ PHAL_RCC_getAPB1ClockHz()
| uint32_t PHAL_RCC_getAPB1ClockHz |
( |
void | | ) |
|
- Returns
- the current APB1 (PCLK1) rate in Hz
◆ PHAL_RCC_getAPB2ClockHz()
| uint32_t PHAL_RCC_getAPB2ClockHz |
( |
void | | ) |
|
- Returns
- the current APB2 (PCLK2) rate in Hz
◆ PHAL_RCC_getSystemClockHz()
| uint32_t PHAL_RCC_getSystemClockHz |
( |
void | | ) |
|
- Returns
- the current system clock (SYSCLK) rate in Hz
◆ PHAL_RCC_init()
Configure the system, AHB, APB1, and APB2 clocks for a supported clock tree.
- The *_16MHZ modes run directly from the input oscillator (HSI16, or the board's 16 MHz HSE input in bypass mode) with no PLL
- 0 Flash wait states
- AHB = APB1 = APB2 = 16 MHz
- The *_170MHZ modes feed the input oscillator through the PLL (PLLM=4, PLLN=85, PLLR=2) for a clock speed of exactly 170 MHz
- Enable Range 1 boost mode
- Set 4 Flash wait states
- AHB = APB1 = APB2 = 170 MHz
The unselected input oscillator will be disabled once this function ends:
- HSI is on by default out of reset
- If HSI is selected, we don't turn it off
- For an HSE mode, HSI is switched off once it's no longer needed
- Parameters
-
| mode | one of the four supported clock configurations |
◆ rcc_initFromOscillator()
| static void rcc_initFromOscillator |
( |
bool | use_hse, |
|
|
bool | use_pll ) |
|
static |
◆ g_ahb_clock_hz
◆ g_apb1_clock_hz
◆ g_apb2_clock_hz
◆ g_system_clock_hz