HPM SDK
HPMicro Software Development Kit
PLLCTLV2 driver APIs

PLLCTLV2 driver APIs. More...

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

Detailed Description

PLLCTLV2 driver APIs.

Function Documentation

◆ pllctlv2_disable_dither()

static void pllctlv2_disable_dither ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Disable dither for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)

◆ pllctlv2_disable_slow_lock()

static void pllctlv2_disable_slow_lock ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Disable slow lock for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)

◆ pllctlv2_disable_spread_spectrum()

static void pllctlv2_disable_spread_spectrum ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Disables the spread spectrum modulation for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)

◆ pllctlv2_enable_dither()

static void pllctlv2_enable_dither ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Enable dither for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)

◆ pllctlv2_enable_slow_lock()

static void pllctlv2_enable_slow_lock ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Enable slow lock for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)

◆ pllctlv2_enable_spread_spectrum()

void pllctlv2_enable_spread_spectrum ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint32_t  step,
uint32_t  stop 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Enables and configures the spread spectrum modulation for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]stepModulation step size for spread spectrum
[in]stopMaximum modulation point for spread spectrum
Note
Spread spectrum modulation helps reduce electromagnetic interference (EMI)

◆ pllctlv2_get_pll_freq_in_hz()

uint32_t pllctlv2_get_pll_freq_in_hz ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Retrieves the current output frequency of the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to query (pllctlv2_pll0 through pllctlv2_pll6)
Returns
Current PLL output frequency in Hertz

◆ pllctlv2_get_pll_postdiv_freq_in_hz()

uint32_t pllctlv2_get_pll_postdiv_freq_in_hz ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
pllctlv2_clk_t  clk 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Retrieves the frequency of a specific PLL post-divider output.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to query (pllctlv2_pll0 through pllctlv2_pll6)
[in]clkPost-divider output index (pllctlv2_clk0 through pllctlv2_clk3)
Returns
Frequency of the selected post-divider output in Hertz

◆ pllctlv2_init_pll_with_freq()

hpm_stat_t pllctlv2_init_pll_with_freq ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint32_t  freq_in_hz 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Initializes the PLL to generate a specific output frequency.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]freq_in_hzDesired PLL output frequency in Hertz
Returns
status_success if PLL is configured successfully
status_invalid_argument if requested frequency is not achievable
Note
The PLL must be enabled before calling this function

< PLLCTLV2 PLL MFN Factor

◆ pllctlv2_pll_clk_is_stable()

static bool pllctlv2_pll_clk_is_stable ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
pllctlv2_clk_t  clk 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Checks if the specified PLL CLK has achieved stable operation.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to check (pllctlv2_pll0 through pllctlv2_pll6)
[in]clkPost-divider output index (pllctlv2_clk0 through pllctlv2_clk3)
Returns
true if the PLL CLK is stable and locked, false otherwise

◆ pllctlv2_pll_is_enabled()

static bool pllctlv2_pll_is_enabled ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Checks if the specified PLL is enabled.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to check (pllctlv2_pll0 through pllctlv2_pll6)
Returns
true if the PLL is enabled, false otherwise

◆ pllctlv2_pll_is_stable()

static bool pllctlv2_pll_is_stable ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Checks if the specified PLL has achieved stable operation.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to check (pllctlv2_pll0 through pllctlv2_pll6)
Returns
true if the PLL is stable and locked, false otherwise

◆ pllctlv2_select_reference_clock()

static void pllctlv2_select_reference_clock ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint8_t  src 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Selects the reference clock source for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]srcReference clock source selection:
  • 0: External 24MHz crystal (XTAL24M)
  • 1: Internal 24MHz RC oscillator (IRC24M)

◆ pllctlv2_set_pll_lock_time()

static void pllctlv2_set_pll_lock_time ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint32_t  xtal_cycles 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Sets the lock time for the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]xtal_cyclesNumber of external crystal clock cycles to wait for PLL lock
Note
The lock time determines how long the PLL waits to achieve stable operation

◆ pllctlv2_set_pll_step_time()

static void pllctlv2_set_pll_step_time ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint32_t  xtal_cycles 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Sets the step time for frequency changes in the specified PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]xtal_cyclesNumber of external crystal clock cycles between frequency steps
Note
Step time affects how quickly the PLL can change its output frequency

◆ pllctlv2_set_pll_with_mfi_mfn()

hpm_stat_t pllctlv2_set_pll_with_mfi_mfn ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint32_t  mfi,
uint32_t  mfn 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Configures the PLL frequency using direct MFI and MFN values.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]mfiInteger multiplication factor
[in]mfnFractional multiplication factor numerator
Returns
status_success if configuration is valid and applied successfully
status_invalid_argument if any parameter is out of valid range
Note
PLL frequency = REF_CLOCK * (mfi + 1.0 * mfn / mfd)

◆ pllctlv2_set_postdiv()

void pllctlv2_set_postdiv ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
pllctlv2_clk_t  clk,
pllctlv2_div_t  div_value 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Configures the post-divider for a specific PLL output clock.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]clkPost-divider output index (pllctlv2_clk0 through pllctlv2_clk3)
[in]div_valueDivider value selection (pllctlv2_div_1p0 through pllctlv2_div_13p6)
Note
The actual divider ratio is calculated as 1 + div_value/5

◆ pllctlv2_setup_spread_spectrum()

void pllctlv2_setup_spread_spectrum ( PLLCTLV2_Type ptr,
pllctlv2_pll_t  pll,
uint8_t  spread_range,
uint32_t  modulation_freq 
)

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Configures spread spectrum modulation parameters for a PLL.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]pllIndex of the PLL to configure (pllctlv2_pll0 through pllctlv2_pll6)
[in]spread_rangeSpread spectrum range as a percentage (0.x%)
[in]modulation_freqDesired modulation frequency in Hertz
Note
This function automatically calculates appropriate step and stop values based on the provided spread range and modulation frequency

◆ pllctlv2_xtal_is_enabled()

static bool pllctlv2_xtal_is_enabled ( PLLCTLV2_Type ptr)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Checks if the external crystal oscillator is enabled.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
Returns
true if the external crystal oscillator is enabled, false otherwise

◆ pllctlv2_xtal_is_stable()

static bool pllctlv2_xtal_is_stable ( PLLCTLV2_Type ptr)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Checks the stability status of the external crystal oscillator.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
Returns
true if the external crystal oscillator is stable and ready for use

◆ pllctlv2_xtal_set_rampup_time()

static void pllctlv2_xtal_set_rampup_time ( PLLCTLV2_Type ptr,
uint32_t  rc24m_cycles 
)
inlinestatic

#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_pllctlv2_drv.h>

Configures the ramp-up time for the external crystal oscillator.

Parameters
[in]ptrBase address of the PLLCTLV2 peripheral
[in]rc24m_cyclesNumber of RC24M clock cycles for the ramp-up period
Note
The ramp-up time affects how quickly the crystal oscillator reaches stable operation