HPM SDK
HPMicro Software Development Kit
hpm_pllctlv2_drv.h File Reference
#include "hpm_common.h"
#include "hpm_soc_feature.h"
#include "hpm_pllctlv2_regs.h"

Go to the source code of this file.

Macros

#define PLLCTLV2_CLK_SRC_XTAL24M   (0U)
 
#define PLLCTLV2_CLK_SRC_IRC24M   (1U)
 

Functions

static bool pllctlv2_xtal_is_stable (PLLCTLV2_Type *ptr)
 Check if external crystal is stable. More...
 
static bool pllctlv2_xtal_is_enabled (PLLCTLV2_Type *ptr)
 Check if external crystal is enabled. More...
 
static void pllctlv2_xtal_set_rampup_time (PLLCTLV2_Type *ptr, uint32_t rc24m_cycles)
 Set external crystal ramp-up time. More...
 
static bool pllctlv2_pll_is_stable (PLLCTLV2_Type *ptr, uint8_t pll)
 Check is PLL is stable. More...
 
static bool pllctlv2_pll_is_enabled (PLLCTLV2_Type *ptr, uint8_t pll)
 Check if PLL is enabled. More...
 
static void pllctlv2_select_reference_clock (PLLCTLV2_Type *ptr, uint8_t pll, uint8_t src)
 Select the PLL reference clock. More...
 
void pllctlv2_enable_spread_spectrum (PLLCTLV2_Type *ptr, uint8_t pll, uint32_t step, uint32_t stop)
 Enable PLL Spread Spectrum feature. More...
 
static void pllctlv2_disable_spread_spectrum (PLLCTLV2_Type *ptr, uint8_t pll)
 Disable PLL Spread spectrum. More...
 
static void pllctlv2_set_pll_lock_time (PLLCTLV2_Type *ptr, uint8_t pll, uint32_t xtal_cycles)
 Set PLL lock time. More...
 
static void pllctlv2_set_pll_step_time (PLLCTLV2_Type *ptr, uint8_t pll, uint32_t xtal_cycles)
 Set PLL step time. More...
 
void pllctlv2_set_postdiv (PLLCTLV2_Type *ptr, uint8_t pll, uint8_t div_index, uint8_t div_value)
 Set PLL Post divider. More...
 
hpm_stat_t pllctlv2_set_pll_with_mfi_mfn (PLLCTLV2_Type *ptr, uint8_t pll, uint32_t mfi, uint32_t mfn)
 Set the PLL via the low-level MFI, MFD and MFN PLL frequency = REF CLOCK * (mfi + 1.0 * mfn / mfd) More...
 
hpm_stat_t pllctlv2_init_pll_with_freq (PLLCTLV2_Type *ptr, uint8_t pll, uint32_t freq_in_hz)
 Initialize PLL to specified frequency Note: the specified PLL clock needs to be enabled before being configured. More...
 
uint32_t pllctlv2_get_pll_freq_in_hz (PLLCTLV2_Type *ptr, uint8_t pll)
 Get the specified PLl clock frequency. More...
 
uint32_t pllctlv2_get_pll_postdiv_freq_in_hz (PLLCTLV2_Type *ptr, uint8_t pll, uint8_t div_index)
 Get the selected PLL post divider frequency. More...
 

Macro Definition Documentation

◆ PLLCTLV2_CLK_SRC_IRC24M

#define PLLCTLV2_CLK_SRC_IRC24M   (1U)

◆ PLLCTLV2_CLK_SRC_XTAL24M

#define PLLCTLV2_CLK_SRC_XTAL24M   (0U)