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)
 

Enumerations

enum  pllctlv2_pll_t {
  pllctlv2_pll0 , pllctlv2_pll1 , pllctlv2_pll2 , pllctlv2_pll3 ,
  pllctlv2_pll4 , pllctlv2_pll5 , pllctlv2_pll6
}
 
enum  pllctlv2_clk_t { pllctlv2_clk0 , pllctlv2_clk1 , pllctlv2_clk2 , pllctlv2_clk3 }
 
enum  pllctlv2_div_t {
  pllctlv2_div_1p0 , pllctlv2_div_1p2 , pllctlv2_div_1p4 , pllctlv2_div_1p6 ,
  pllctlv2_div_1p8 , pllctlv2_div_2p0 , pllctlv2_div_2p2 , pllctlv2_div_2p4 ,
  pllctlv2_div_2p6 , pllctlv2_div_2p8 , pllctlv2_div_3p0 , pllctlv2_div_3p2 ,
  pllctlv2_div_3p4 , pllctlv2_div_3p6 , pllctlv2_div_3p8 , pllctlv2_div_4p0 ,
  pllctlv2_div_4p2 , pllctlv2_div_4p4 , pllctlv2_div_4p6 , pllctlv2_div_4p8 ,
  pllctlv2_div_5p0 , pllctlv2_div_5p2 , pllctlv2_div_5p4 , pllctlv2_div_5p6 ,
  pllctlv2_div_5p8 , pllctlv2_div_6p0 , pllctlv2_div_6p2 , pllctlv2_div_6p4 ,
  pllctlv2_div_6p6 , pllctlv2_div_6p8 , pllctlv2_div_7p0 , pllctlv2_div_7p2 ,
  pllctlv2_div_7p4 , pllctlv2_div_7p6 , pllctlv2_div_7p8 , pllctlv2_div_8p0 ,
  pllctlv2_div_8p2 , pllctlv2_div_8p4 , pllctlv2_div_8p6 , pllctlv2_div_8p8 ,
  pllctlv2_div_9p0 , pllctlv2_div_9p2 , pllctlv2_div_9p4 , pllctlv2_div_9p6 ,
  pllctlv2_div_9p8 , pllctlv2_div_10p0 , pllctlv2_div_10p2 , pllctlv2_div_10p4 ,
  pllctlv2_div_10p6 , pllctlv2_div_10p8 , pllctlv2_div_11p0 , pllctlv2_div_11p2 ,
  pllctlv2_div_11p4 , pllctlv2_div_11p6 , pllctlv2_div_11p8 , pllctlv2_div_12p0 ,
  pllctlv2_div_12p2 , pllctlv2_div_12p4 , pllctlv2_div_12p6 , pllctlv2_div_12p8 ,
  pllctlv2_div_13p0 , pllctlv2_div_13p2 , pllctlv2_div_13p4 , pllctlv2_div_13p6
}
 

Functions

static bool pllctlv2_xtal_is_stable (PLLCTLV2_Type *ptr)
 Checks the stability status of the external crystal oscillator. More...
 
static bool pllctlv2_xtal_is_enabled (PLLCTLV2_Type *ptr)
 Checks if the external crystal oscillator is enabled. More...
 
static void pllctlv2_xtal_set_rampup_time (PLLCTLV2_Type *ptr, uint32_t rc24m_cycles)
 Configures the ramp-up time for the external crystal oscillator. More...
 
static bool pllctlv2_pll_is_stable (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Checks if the specified PLL has achieved stable operation. More...
 
static bool pllctlv2_pll_is_enabled (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Checks if the specified PLL is enabled. More...
 
static bool pllctlv2_pll_clk_is_stable (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, pllctlv2_clk_t clk)
 Checks if the specified PLL CLK has achieved stable operation. More...
 
static void pllctlv2_select_reference_clock (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint8_t src)
 Selects the reference clock source for the specified PLL. More...
 
void pllctlv2_enable_spread_spectrum (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint32_t step, uint32_t stop)
 Enables and configures the spread spectrum modulation for the specified PLL. More...
 
static void pllctlv2_disable_spread_spectrum (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Disables the spread spectrum modulation for the specified PLL. More...
 
static void pllctlv2_set_pll_lock_time (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint32_t xtal_cycles)
 Sets the lock time for the specified PLL. More...
 
static void pllctlv2_set_pll_step_time (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint32_t xtal_cycles)
 Sets the step time for frequency changes in the specified PLL. More...
 
static void pllctlv2_enable_dither (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Enable dither for the specified PLL. More...
 
static void pllctlv2_disable_dither (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Disable dither for the specified PLL. More...
 
static void pllctlv2_enable_slow_lock (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Enable slow lock for the specified PLL. More...
 
static void pllctlv2_disable_slow_lock (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Disable slow lock for the specified PLL. More...
 
void pllctlv2_set_postdiv (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, pllctlv2_clk_t clk, pllctlv2_div_t div_value)
 Configures the post-divider for a specific PLL output clock. More...
 
hpm_stat_t pllctlv2_set_pll_with_mfi_mfn (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint32_t mfi, uint32_t mfn)
 Configures the PLL frequency using direct MFI and MFN values. More...
 
hpm_stat_t pllctlv2_init_pll_with_freq (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint32_t freq_in_hz)
 Initializes the PLL to generate a specific output frequency. More...
 
uint32_t pllctlv2_get_pll_freq_in_hz (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll)
 Retrieves the current output frequency of the specified PLL. More...
 
uint32_t pllctlv2_get_pll_postdiv_freq_in_hz (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, pllctlv2_clk_t clk)
 Retrieves the frequency of a specific PLL post-divider output. More...
 
void pllctlv2_setup_spread_spectrum (PLLCTLV2_Type *ptr, pllctlv2_pll_t pll, uint8_t spread_range, uint32_t modulation_freq)
 Configures spread spectrum modulation parameters for a PLL. More...
 

Macro Definition Documentation

◆ PLLCTLV2_CLK_SRC_IRC24M

#define PLLCTLV2_CLK_SRC_IRC24M   (1U)

◆ PLLCTLV2_CLK_SRC_XTAL24M

#define PLLCTLV2_CLK_SRC_XTAL24M   (0U)

Enumeration Type Documentation

◆ pllctlv2_clk_t

Enumerator
pllctlv2_clk0 
pllctlv2_clk1 
pllctlv2_clk2 
pllctlv2_clk3 

◆ pllctlv2_div_t

Enumerator
pllctlv2_div_1p0 
pllctlv2_div_1p2 
pllctlv2_div_1p4 
pllctlv2_div_1p6 
pllctlv2_div_1p8 
pllctlv2_div_2p0 
pllctlv2_div_2p2 
pllctlv2_div_2p4 
pllctlv2_div_2p6 
pllctlv2_div_2p8 
pllctlv2_div_3p0 
pllctlv2_div_3p2 
pllctlv2_div_3p4 
pllctlv2_div_3p6 
pllctlv2_div_3p8 
pllctlv2_div_4p0 
pllctlv2_div_4p2 
pllctlv2_div_4p4 
pllctlv2_div_4p6 
pllctlv2_div_4p8 
pllctlv2_div_5p0 
pllctlv2_div_5p2 
pllctlv2_div_5p4 
pllctlv2_div_5p6 
pllctlv2_div_5p8 
pllctlv2_div_6p0 
pllctlv2_div_6p2 
pllctlv2_div_6p4 
pllctlv2_div_6p6 
pllctlv2_div_6p8 
pllctlv2_div_7p0 
pllctlv2_div_7p2 
pllctlv2_div_7p4 
pllctlv2_div_7p6 
pllctlv2_div_7p8 
pllctlv2_div_8p0 
pllctlv2_div_8p2 
pllctlv2_div_8p4 
pllctlv2_div_8p6 
pllctlv2_div_8p8 
pllctlv2_div_9p0 
pllctlv2_div_9p2 
pllctlv2_div_9p4 
pllctlv2_div_9p6 
pllctlv2_div_9p8 
pllctlv2_div_10p0 
pllctlv2_div_10p2 
pllctlv2_div_10p4 
pllctlv2_div_10p6 
pllctlv2_div_10p8 
pllctlv2_div_11p0 
pllctlv2_div_11p2 
pllctlv2_div_11p4 
pllctlv2_div_11p6 
pllctlv2_div_11p8 
pllctlv2_div_12p0 
pllctlv2_div_12p2 
pllctlv2_div_12p4 
pllctlv2_div_12p6 
pllctlv2_div_12p8 
pllctlv2_div_13p0 
pllctlv2_div_13p2 
pllctlv2_div_13p4 
pllctlv2_div_13p6 

◆ pllctlv2_pll_t

Enumerator
pllctlv2_pll0 
pllctlv2_pll1 
pllctlv2_pll2 
pllctlv2_pll3 
pllctlv2_pll4 
pllctlv2_pll5 
pllctlv2_pll6