Microchip® Advanced Software Framework

pm_uc3l.c File Reference
#include "pm_uc3l.h"

Data Structures

union  u_avr32_pm_cfdctrl_t
 
union  u_avr32_pm_cpusel_t
 
union  u_avr32_pm_pbasel_t
 
union  u_avr32_pm_pbbsel_t
 

Functions

long pm_config_mainclk_safety (bool cfd, bool ocp, bool final)
 Configure the main clock safety mechanisms. More...
 
long pm_disable_clk_domain_div (pm_clk_domain_t clock_domain)
 Disable the division ratio for a clock domain. More...
 
long pm_disable_module (unsigned long module)
 Disable the clock of a module. More...
 
long pm_enable_module (unsigned long module)
 Module Functions. More...
 
static pm_divratio_t pm_find_divratio (unsigned long ref_freq_hz, unsigned long target_freq_hz)
 Compute the division ratio field of the PM CPU/PBxSEL registers to apply to get a target frequency from a main clock source frequency. More...
 
void pm_set_all_cksel (unsigned long main_clock_f_hz, unsigned long cpu_f_hz, unsigned long pba_f_hz, unsigned long pbb_f_hz)
 Enable or Disable the division ratio for each clock domain depending on the main source clock frequency and each clock domain target frequency. More...
 
long pm_set_clk_domain_div (pm_clk_domain_t clock_domain, pm_divratio_t divratio)
 Set the division ratio for a clock domain. More...
 
long pm_set_mclk_source (pm_clk_src_t src)
 Clock Functions. More...
 
long pm_wait_for_clk_ready (void)
 Wait actively for the clock settings to be effective. More...
 

static pm_divratio_t pm_find_divratio ( unsigned long  ref_freq_hz,
unsigned long  target_freq_hz 
)
static

Compute the division ratio field of the PM CPU/PBxSEL registers to apply to get a target frequency from a main clock source frequency.

Parameters
ref_freq_hzThe main clock source frequency (Hz)
target_freq_hzThe target frequency (Hz)
Returns
the division ratio CPUSEL
Return values
PM_CKSEL_DIVRATIO_ERRORno div ratio to apply
thediv ratio enum value

References ctz, and PM_CKSEL_DIVRATIO_ERROR.

Referenced by pm_set_all_cksel().