evk_clock.h
This module control clock related features.
- Copyright
Copyright (C) 2026 SPARK Microsystems International Inc. All rights reserved.
- License
This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.
- Author
SPARK FW Team.
Functions
-
void evk_clock_ext_osc_init(void)
Initialize the external PLL oscillator clock.
Note
This external PLL can be optionally used to drive the radio’s PLL.
-
void evk_clock_xtal_init(void)
Initialize the external XTAL clock.
Note
This external XTAL clock can be optionally used to drive the radio’s XTAL clock.
-
void evk_clock_rtc_for_wakeup_init(void)
Initialize RTC with wake up timer.
-
void evk_clock_all_gpio_init(void)
Enable all GPIO’s peripheral clock.
-
void evk_set_system_clock(evk_clk_freq_t evk_clk_freq)
Set the system clock frequency.
- Parameters:
evk_clk_freq – [in] Clock frequency selection.
-
uint32_t evk_get_system_clock_freq(void)
Get the system clock frequency value.
- Returns:
System clock frequency.
-
void evk_usb_clock_deinit(void)
De-initialize the peripheral USB clock.
-
void evk_clock_ext_osc_deinit(void)
De-initialize the external PLL oscillator clock.
-
void evk_enable_ext_osc_clk(void)
Set the PLL select pin to enable the external oscillator clock.
Note
This function turns on the 20.48MHz oscillator. The oscillator provides an optional external PLL for the radio. When the oscillator is on, the radio should deactivate its internal PLL.
-
void evk_disable_ext_osc_clk(void)
Reset the PLL select pin to disable the external oscillator clock.
Note
This function turns off the 20.48MHz oscillator. When the oscillator is off, the radio should activate its internal PLL.
-
void evk_clock_xtal_deinit(void)
De-initialize the external XTAL clock.
-
void evk_enable_xtal_clk(void)
Enable the XTAL clock.
Note
This signal is a PWM with a 50% duty cycle and a 32.768kHz frequency. It provides an optional external XTAL clock for the radio. When the XTAL clock is on, the radio should deactivate its internal XTAL clock.
-
void evk_disable_xtal_clk(void)
Disable the XTAL clock.
Note
This function turns off the XTAL clock PWM signal. When the XTAL clock is off, the radio should activate its internal XTAL clock.
-
void evk_clock_set_pll_170Mhz_as_sysclk(void)
Select mux PLL 170Mhz input for system clock.
Note
This function is made to work in tandem with evk_clk_set_hsi_as_sysclk.
-
void evk_clock_set_hsi_as_sysclk(void)
Select mux HSI input for system clock.
Note
This function is made to work in tandem with evk_clk_set_pll_170Mhz_as_sysclk.
-
void evk_clock_set_hsi_as_sysclk_protected(void)
Select mux HSI input for system clock and make sure no spi transfer are on going.
Note
Protected version for the 170Mhz and hsi clock switching version.
-
void evk_clock_start_rtc_for_wakeup(uint32_t ms)
Start RTC wake up timer.
Note
Upon wake up the system resets and starts from main. The maximum value is 30 seconds (30000).
- Parameters:
ms – [in] Milliseconds until wake up.