8 #ifndef HPM_PLLCTLV2_DRV_H
9 #define HPM_PLLCTLV2_DRV_H
13 #include "hpm_soc_feature.h"
14 #include "hpm_pllctlv2_regs.h"
16 #define PLLCTLV2_CLK_SRC_XTAL24M (0U)
17 #define PLLCTLV2_CLK_SRC_IRC24M (1U)
#define PLLCTLV2_XTAL_RESPONSE_MASK
Definition: hpm_pllctlv2_regs.h:51
#define PLLCTLV2_PLL_CONFIG_REFSEL_MASK
Definition: hpm_pllctlv2_regs.h:194
#define PLLCTLV2_PLL_MFI_ENABLE_MASK
Definition: hpm_pllctlv2_regs.h:110
#define PLLCTLV2_PLL_CONFIG_SPREAD_MASK
Definition: hpm_pllctlv2_regs.h:182
#define PLLCTLV2_PLL_MFI_RESPONSE_MASK
Definition: hpm_pllctlv2_regs.h:99
#define PLLCTLV2_PLL_STEPTIME_STEPTIME_SET(x)
Definition: hpm_pllctlv2_regs.h:218
#define PLLCTLV2_PLL_LOCKTIME_LOCKTIME_SET(x)
Definition: hpm_pllctlv2_regs.h:207
#define PLLCTLV2_XTAL_RAMP_TIME_MASK
Definition: hpm_pllctlv2_regs.h:75
#define PLLCTLV2_XTAL_RAMP_TIME_SET(x)
Definition: hpm_pllctlv2_regs.h:77
#define PLLCTLV2_XTAL_ENABLE_MASK
Definition: hpm_pllctlv2_regs.h:62
#define PLLCTLV2_PLL_CONFIG_REFSEL_SET(x)
Definition: hpm_pllctlv2_regs.h:196
uint32_t hpm_stat_t
Definition: hpm_common.h:123
#define IS_HPM_BITMASK_SET(val, mask)
Definition: hpm_common.h:61
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.
Definition: hpm_pllctlv2_drv.c:103
static bool pllctlv2_xtal_is_enabled(PLLCTLV2_Type *ptr)
Check if external crystal is enabled.
Definition: hpm_pllctlv2_drv.h:40
static bool pllctlv2_pll_is_stable(PLLCTLV2_Type *ptr, uint8_t pll)
Check is PLL is stable.
Definition: hpm_pllctlv2_drv.h:61
uint32_t pllctlv2_get_pll_freq_in_hz(PLLCTLV2_Type *ptr, uint8_t pll)
Get the specified PLl clock frequency.
Definition: hpm_pllctlv2_drv.c:91
static bool pllctlv2_xtal_is_stable(PLLCTLV2_Type *ptr)
Check if external crystal is stable.
Definition: hpm_pllctlv2_drv.h:30
static void pllctlv2_set_pll_step_time(PLLCTLV2_Type *ptr, uint8_t pll, uint32_t xtal_cycles)
Set PLL step time.
Definition: hpm_pllctlv2_drv.h:126
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....
Definition: hpm_pllctlv2_drv.c:21
static void pllctlv2_disable_spread_spectrum(PLLCTLV2_Type *ptr, uint8_t pll)
Disable PLL Spread spectrum.
Definition: hpm_pllctlv2_drv.h:104
void pllctlv2_enable_spread_spectrum(PLLCTLV2_Type *ptr, uint8_t pll, uint32_t step, uint32_t stop)
Enable PLL Spread Spectrum feature.
Definition: hpm_pllctlv2_drv.c:64
static void pllctlv2_set_pll_lock_time(PLLCTLV2_Type *ptr, uint8_t pll, uint32_t xtal_cycles)
Set PLL lock time.
Definition: hpm_pllctlv2_drv.h:115
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 ...
Definition: hpm_pllctlv2_drv.c:39
static bool pllctlv2_pll_is_enabled(PLLCTLV2_Type *ptr, uint8_t pll)
Check if PLL is enabled.
Definition: hpm_pllctlv2_drv.h:72
static void pllctlv2_xtal_set_rampup_time(PLLCTLV2_Type *ptr, uint32_t rc24m_cycles)
Set external crystal ramp-up time.
Definition: hpm_pllctlv2_drv.h:50
static void pllctlv2_select_reference_clock(PLLCTLV2_Type *ptr, uint8_t pll, uint8_t src)
Select the PLL reference clock.
Definition: hpm_pllctlv2_drv.h:85
void pllctlv2_set_postdiv(PLLCTLV2_Type *ptr, uint8_t pll, uint8_t div_index, uint8_t div_value)
Set PLL Post divider.
Definition: hpm_pllctlv2_drv.c:82
Definition: hpm_pllctlv2_regs.h:12
__RW uint32_t CONFIG
Definition: hpm_pllctlv2_regs.h:21
struct PLLCTLV2_Type::@316 PLL[2]
__RW uint32_t XTAL
Definition: hpm_pllctlv2_regs.h:13
__RW uint32_t STEPTIME
Definition: hpm_pllctlv2_regs.h:23
__RW uint32_t MFI
Definition: hpm_pllctlv2_regs.h:16
__RW uint32_t LOCKTIME
Definition: hpm_pllctlv2_regs.h:22