HPM SDK
HPMicro Software Development Kit
hpm_pllctlv2_drv.c File Reference
#include "hpm_pllctlv2_drv.h"

Macros

#define PLLCTLV2_PLL_MFN_FACTOR   (10U)
 
#define PLLCTLV2_PLL_MFD_DEFAULT   (240UL * 1000000UL)
 
#define PLLCTLV2_PLL_MFI_MIN   (16U)
 
#define PLLCTLV2_PLL_MFI_MAX   (42U)
 
#define PLLCTLV2_PLL_XTAL_FREQ   (24000000UL)
 
#define PLLCTLV2_PLL_FREQ_MIN   (PLLCTLV2_PLL_MFI_MIN * PLLCTLV2_PLL_XTAL_FREQ)
 
#define PLLCTLV2_PLL_FREQ_MAX   ((PLLCTLV2_PLL_MFI_MAX + 1U) * PLLCTLV2_PLL_XTAL_FREQ)
 
#define FREQ_1MHz   (1000000UL)
 

Functions

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...
 
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...
 
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...
 
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

◆ FREQ_1MHz

#define FREQ_1MHz   (1000000UL)

◆ PLLCTLV2_PLL_FREQ_MAX

#define PLLCTLV2_PLL_FREQ_MAX   ((PLLCTLV2_PLL_MFI_MAX + 1U) * PLLCTLV2_PLL_XTAL_FREQ)

◆ PLLCTLV2_PLL_FREQ_MIN

#define PLLCTLV2_PLL_FREQ_MIN   (PLLCTLV2_PLL_MFI_MIN * PLLCTLV2_PLL_XTAL_FREQ)

◆ PLLCTLV2_PLL_MFD_DEFAULT

#define PLLCTLV2_PLL_MFD_DEFAULT   (240UL * 1000000UL)

PLLCTLV2 PLL Default MFD value

◆ PLLCTLV2_PLL_MFI_MAX

#define PLLCTLV2_PLL_MFI_MAX   (42U)

◆ PLLCTLV2_PLL_MFI_MIN

#define PLLCTLV2_PLL_MFI_MIN   (16U)

◆ PLLCTLV2_PLL_MFN_FACTOR

#define PLLCTLV2_PLL_MFN_FACTOR   (10U)

PLLCTLV2 PLL MFN Factor

◆ PLLCTLV2_PLL_XTAL_FREQ

#define PLLCTLV2_PLL_XTAL_FREQ   (24000000UL)