The Power Manager (PM) controls the oscillators and PLLs, and generates the clocks and resets in the device.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the CPU - PM - Power Manager. | |
Power Clocks Library | |
Data Structures | |
struct | pm_freq_param_t |
Input and output parameters when initializing PM clocks using pm_configure_clocks(). More... | |
Macros | |
#define | PM_FREQ_STATUS_FAIL (-1) |
#define | PM_FREQ_STATUS_OK (0) |
Functions | |
void | pm_bod_clear_irq (volatile avr32_pm_t *pm) |
Clears the Brown-Out Detector interrupt flag. More... | |
void | pm_bod_disable_irq (volatile avr32_pm_t *pm) |
Disables the Brown-Out Detector interrupt. More... | |
void | pm_bod_enable_irq (volatile avr32_pm_t *pm) |
Enables the Brown-Out Detector interrupt. More... | |
unsigned long | pm_bod_get_irq_enable_bit (volatile avr32_pm_t *pm) |
Gets the Brown-Out Detector interrupt enable status. More... | |
unsigned long | pm_bod_get_irq_status (volatile avr32_pm_t *pm) |
Gets the Brown-Out Detector interrupt flag. More... | |
unsigned long | pm_bod_get_level (volatile avr32_pm_t *pm) |
Gets the triggering threshold of the Brown-Out Detector. More... | |
void | pm_cksel (volatile avr32_pm_t *pm, unsigned int pbadiv, unsigned int pbasel, unsigned int pbbdiv, unsigned int pbbsel, unsigned int hsbdiv, unsigned int hsbsel) |
This function will select all the power manager clocks. More... | |
void | pm_cksel_get (volatile avr32_pm_t *pm, unsigned long *p_cksel) |
This function returns the cksel (Clock Select). More... | |
void | pm_cksel_set (volatile avr32_pm_t *pm, unsigned long cksel) |
This function set the cksel (Clock Select). More... | |
int | pm_configure_clocks (pm_freq_param_t *param) |
Automatically configure the CPU, PBA, PBB, and HSB clocks according to the user wishes. More... | |
void | pm_configure_usb_clock (void) |
Automatically configure the USB clock. More... | |
void | pm_disable_clk0 (volatile avr32_pm_t *pm) |
This function will disable the oscillator 0. More... | |
void | pm_disable_clk1 (volatile avr32_pm_t *pm) |
This function will disable the oscillator 1. More... | |
void | pm_disable_clk32 (volatile avr32_pm_t *pm) |
This function will disable the oscillator 32. More... | |
long | pm_disable_module (volatile avr32_pm_t *pm, unsigned long module) |
Disable the clock of a module. More... | |
void | pm_enable_clk0 (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 0 to be used with a startup time. More... | |
void | pm_enable_clk0_no_wait (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 0 to be used with no startup time. More... | |
void | pm_enable_clk1 (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 1 to be used with a startup time. More... | |
void | pm_enable_clk1_no_wait (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 1 to be used with no startup time. More... | |
void | pm_enable_clk32 (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 32 to be used with a startup time. More... | |
void | pm_enable_clk32_no_wait (volatile avr32_pm_t *pm, unsigned int startup) |
This function will enable the oscillator 32 to be used with no startup time. More... | |
long | pm_enable_module (volatile avr32_pm_t *pm, unsigned long module) |
Enable the clock of a module. More... | |
void | pm_enable_osc0_crystal (volatile avr32_pm_t *pm, unsigned int fosc0) |
This function will enable the crystal mode of the oscillator 0. More... | |
void | pm_enable_osc0_ext_clock (volatile avr32_pm_t *pm) |
This function will enable the external clock mode of the oscillator 0. More... | |
void | pm_enable_osc1_crystal (volatile avr32_pm_t *pm, unsigned int fosc1) |
This function will enable the crystal mode of the oscillator 1. More... | |
void | pm_enable_osc1_ext_clock (volatile avr32_pm_t *pm) |
This function will enable the external clock mode of the oscillator 1. More... | |
void | pm_enable_osc32_crystal (volatile avr32_pm_t *pm) |
This function will enable the crystal mode of the 32-kHz oscillator. More... | |
void | pm_enable_osc32_ext_clock (volatile avr32_pm_t *pm) |
This function will enable the external clock mode of the 32-kHz oscillator. More... | |
void | pm_gc_disable (volatile avr32_pm_t *pm, unsigned int gc) |
This function will disable a generic clock. More... | |
void | pm_gc_enable (volatile avr32_pm_t *pm, unsigned int gc) |
This function will enable a generic clock. More... | |
void | pm_gc_setup (volatile avr32_pm_t *pm, unsigned int gc, unsigned int osc_or_pll, unsigned int pll_osc, unsigned int diven, unsigned int div) |
This function will setup a generic clock. More... | |
unsigned long | pm_get_clock (volatile avr32_pm_t *pm) |
This function returns the power manager main clock. More... | |
static __always_inline unsigned int | pm_get_reset_cause (volatile avr32_pm_t *pm) |
Gets the MCU reset cause. More... | |
void | pm_pll_disable (volatile avr32_pm_t *pm, unsigned int pll) |
This function will disable a PLL. More... | |
void | pm_pll_enable (volatile avr32_pm_t *pm, unsigned int pll) |
This function will enable a PLL. More... | |
unsigned int | pm_pll_get_option (volatile avr32_pm_t *pm, unsigned int pll) |
This function will get a PLL option. More... | |
void | pm_pll_set_option (volatile avr32_pm_t *pm, unsigned int pll, unsigned int pll_freq, unsigned int pll_div2, unsigned int pll_wbwdisable) |
This function will set a PLL option. More... | |
void | pm_pll_setup (volatile avr32_pm_t *pm, unsigned int pll, unsigned int mul, unsigned int div, unsigned int osc, unsigned int lockcount) |
This function will setup a PLL. More... | |
unsigned long | pm_read_gplp (volatile avr32_pm_t *pm, unsigned long gplp) |
Read the content of the PM GPLP registers. More... | |
void | pm_switch_to_clock (volatile avr32_pm_t *pm, unsigned long clock) |
This function will switch the power manager main clock. More... | |
void | pm_switch_to_osc0 (volatile avr32_pm_t *pm, unsigned int fosc0, unsigned int startup) |
Switch main clock to clock Osc0 (crystal mode) More... | |
void | pm_wait_for_clk0_ready (volatile avr32_pm_t *pm) |
This function will wait until the Osc0 clock is ready. More... | |
void | pm_wait_for_clk1_ready (volatile avr32_pm_t *pm) |
This function will wait until the Osc1 clock is ready. More... | |
void | pm_wait_for_clk32_ready (volatile avr32_pm_t *pm) |
This function will wait until the osc32 clock is ready. More... | |
void | pm_wait_for_pll0_locked (volatile avr32_pm_t *pm) |
This function will wait for PLL0 locked. More... | |
void | pm_wait_for_pll1_locked (volatile avr32_pm_t *pm) |
This function will wait for PLL1 locked. More... | |
void | pm_write_gplp (volatile avr32_pm_t *pm, unsigned long gplp, unsigned long value) |
Write into the PM GPLP registers. More... | |
Sleep Functions | |
static __always_inline void | pm_asyn_wake_up_enable (unsigned long awen_mask) |
Enable one or several asynchronous wake-up source. More... | |
static __always_inline void | pm_asyn_wake_up_disable (unsigned long awen_mask) |
Disable one or several asynchronous wake-up sources. More... | |
#define | SLEEP(mode) {__asm__ __volatile__ ("sleep "STRINGZ(mode));} |
Sets the MCU in the specified sleep mode. More... | |
#define PM_FREQ_STATUS_FAIL (-1) |
Referenced by pm_configure_clocks().
#define PM_FREQ_STATUS_OK (0) |
Referenced by pm_configure_clocks().
#define SLEEP | ( | mode | ) | {__asm__ __volatile__ ("sleep "STRINGZ(mode));} |
Sets the MCU in the specified sleep mode.
mode | Sleep mode:
|
Referenced by main(), pm_sleep(), and usb_suspend_action().
|
static |
Disable one or several asynchronous wake-up sources.
awen_mask | Mask of asynchronous wake-up sources (use one of the defines AVR32_PM_AWEN_xxxxWEN_MASK in the part-specific header file under "toolchain folder"/avr32/inc(lude)/avr32/) |
|
static |
Enable one or several asynchronous wake-up source.
awen_mask | Mask of asynchronous wake-up sources (use one of the defines AVR32_PM_AWEN_xxxxWEN_MASK in the part-specific header file under "toolchain folder"/avr32/inc(lude)/avr32/) |
Referenced by otg_dual_enable(), and udd_enable().
void pm_bod_clear_irq | ( | volatile avr32_pm_t * | pm | ) |
Clears the Brown-Out Detector interrupt flag.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
void pm_bod_disable_irq | ( | volatile avr32_pm_t * | pm | ) |
Disables the Brown-Out Detector interrupt.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
References cpu_irq_disable, cpu_irq_enable, and cpu_irq_is_enabled.
void pm_bod_enable_irq | ( | volatile avr32_pm_t * | pm | ) |
Enables the Brown-Out Detector interrupt.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
unsigned long pm_bod_get_irq_enable_bit | ( | volatile avr32_pm_t * | pm | ) |
Gets the Brown-Out Detector interrupt enable status.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
0 | BOD interrupt disabled. |
1 | BOD interrupt enabled. |
unsigned long pm_bod_get_irq_status | ( | volatile avr32_pm_t * | pm | ) |
Gets the Brown-Out Detector interrupt flag.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
0 | No BOD interrupt. |
1 | BOD interrupt pending. |
unsigned long pm_bod_get_level | ( | volatile avr32_pm_t * | pm | ) |
Gets the triggering threshold of the Brown-Out Detector.
pm | Base address of the Power Manager (i.e. &AVR32_PM). |
void pm_cksel | ( | volatile avr32_pm_t * | pm, |
unsigned int | pbadiv, | ||
unsigned int | pbasel, | ||
unsigned int | pbbdiv, | ||
unsigned int | pbbsel, | ||
unsigned int | hsbdiv, | ||
unsigned int | hsbsel | ||
) |
This function will select all the power manager clocks.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pbadiv | Peripheral Bus A clock divisor enable |
pbasel | Peripheral Bus A select |
pbbdiv | Peripheral Bus B clock divisor enable |
pbbsel | Peripheral Bus B select |
hsbdiv | High Speed Bus clock divisor enable (CPU clock = HSB clock) |
hsbsel | High Speed Bus select (CPU clock = HSB clock ) |
References u_avr32_pm_cksel_t::cksel, and u_avr32_pm_cksel_t::CKSEL.
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), pm_configure_clocks(), prv_clk_gen_start(), sys_cpu_48MHz(), and usb_suspend_action().
void pm_cksel_get | ( | volatile avr32_pm_t * | pm, |
unsigned long * | p_cksel | ||
) |
This function returns the cksel (Clock Select).
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
p_cksel | output cksel value |
Referenced by usb_suspend_action().
void pm_cksel_set | ( | volatile avr32_pm_t * | pm, |
unsigned long | cksel | ||
) |
This function set the cksel (Clock Select).
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
cksel | The cksel value. |
Referenced by usb_suspend_action().
int pm_configure_clocks | ( | pm_freq_param_t * | param | ) |
Automatically configure the CPU, PBA, PBB, and HSB clocks according to the user wishes.
This function needs some parameters stored in a pm_freq_param_t structure:
The function will then configure the clocks using the following rules:
The CPU, HSB and PBA frequencies programmed after configuration are stored back into cpu_f and pba_f.
param | pointer on the configuration structure. |
PM_FREQ_STATUS_OK | Mode successfully initialized. |
PM_FREQ_STATUS_FAIL | The configuration can not be done. |
References pm_freq_param_t::cpu_f, flashc_issue_command(), flashc_set_wait_state(), pm_freq_param_t::osc0_f, pm_freq_param_t::osc0_startup, pm_freq_param_t::pba_f, pm_cksel(), PM_FREQ_STATUS_FAIL, PM_FREQ_STATUS_OK, PM_MAX_MUL, pm_pll_enable(), pm_pll_set_option(), pm_pll_setup(), pm_switch_to_clock(), pm_switch_to_osc0(), and pm_wait_for_pll0_locked().
Referenced by pcl_configure_clocks().
void pm_configure_usb_clock | ( | void | ) |
Automatically configure the USB clock.
USB clock is configured to 48MHz, using the PLL1 from the Oscillator0, assuming a 12 MHz crystal is connected to it.
References pm_gc_enable(), pm_gc_setup(), pm_pll_enable(), pm_pll_set_option(), pm_pll_setup(), and pm_wait_for_pll1_locked().
Referenced by init_sys_clocks(), init_usb_clock(), and pcl_configure_usb_clock().
void pm_disable_clk0 | ( | volatile avr32_pm_t * | pm | ) |
This function will disable the oscillator 0.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
void pm_disable_clk1 | ( | volatile avr32_pm_t * | pm | ) |
This function will disable the oscillator 1.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
void pm_disable_clk32 | ( | volatile avr32_pm_t * | pm | ) |
This function will disable the oscillator 32.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
long pm_disable_module | ( | volatile avr32_pm_t * | pm, |
unsigned long | module | ||
) |
Disable the clock of a module.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
module | The module to shut down (use one of the defines in the part-specific header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks") |
0 | Success. |
<0 | An error occurred. |
References PASS.
void pm_enable_clk0 | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 0 to be used with a startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 0 startup time. AVR32_PM_OSCCTRL0_STARTUP_x_RCOSC. |
References pm_enable_clk0_no_wait(), and pm_wait_for_clk0_ready().
Referenced by main(), and pm_switch_to_osc0().
void pm_enable_clk0_no_wait | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 0 to be used with no startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 0 startup time, for which the function does not wait. AVR32_PM_OSCCTRL0_STARTUP_x_RCOSC. |
References u_avr32_pm_oscctrl0_t::oscctrl0, and u_avr32_pm_oscctrl0_t::OSCCTRL0.
Referenced by pm_enable_clk0().
void pm_enable_clk1 | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 1 to be used with a startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 1 startup time. AVR32_PM_OSCCTRL1_STARTUP_x_RCOSC. |
References pm_enable_clk1_no_wait(), and pm_wait_for_clk1_ready().
Referenced by init_sys_clocks().
void pm_enable_clk1_no_wait | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 1 to be used with no startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 1 startup time, for which the function does not wait. AVR32_PM_OSCCTRL1_STARTUP_x_RCOSC. |
References u_avr32_pm_oscctrl1_t::oscctrl1, and u_avr32_pm_oscctrl1_t::OSCCTRL1.
Referenced by pm_enable_clk1().
void pm_enable_clk32 | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 32 to be used with a startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 32 kHz startup time. AVR32_PM_OSCCTRL32_STARTUP_x_RCOSC. |
References pm_enable_clk32_no_wait(), and pm_wait_for_clk32_ready().
Referenced by rtc_init().
void pm_enable_clk32_no_wait | ( | volatile avr32_pm_t * | pm, |
unsigned int | startup | ||
) |
This function will enable the oscillator 32 to be used with no startup time.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
startup | Clock 32 kHz startup time, for which the function does not wait. AVR32_PM_OSCCTRL32_STARTUP_x_RCOSC. |
References u_avr32_pm_oscctrl32_t::oscctrl32, and u_avr32_pm_oscctrl32_t::OSCCTRL32.
Referenced by pm_enable_clk32().
long pm_enable_module | ( | volatile avr32_pm_t * | pm, |
unsigned long | module | ||
) |
Enable the clock of a module.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
module | The module to clock (use one of the defines in the part-specific header file under "toolchain folder"/avr32/inc(lude)/avr32/; depending on the clock domain, look for the sections "CPU clocks", "HSB clocks", "PBx clocks") |
0 | Success. |
<0 | An error occurred. |
References PASS.
void pm_enable_osc0_crystal | ( | volatile avr32_pm_t * | pm, |
unsigned int | fosc0 | ||
) |
This function will enable the crystal mode of the oscillator 0.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
fosc0 | Oscillator 0 crystal frequency (Hz) |
References pm_set_osc0_mode().
Referenced by main(), and pm_switch_to_osc0().
void pm_enable_osc0_ext_clock | ( | volatile avr32_pm_t * | pm | ) |
This function will enable the external clock mode of the oscillator 0.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
References pm_set_osc0_mode().
void pm_enable_osc1_crystal | ( | volatile avr32_pm_t * | pm, |
unsigned int | fosc1 | ||
) |
This function will enable the crystal mode of the oscillator 1.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
fosc1 | Oscillator 1 crystal frequency (Hz) |
References pm_set_osc1_mode().
Referenced by init_sys_clocks().
void pm_enable_osc1_ext_clock | ( | volatile avr32_pm_t * | pm | ) |
This function will enable the external clock mode of the oscillator 1.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
References pm_set_osc1_mode().
void pm_enable_osc32_crystal | ( | volatile avr32_pm_t * | pm | ) |
This function will enable the crystal mode of the 32-kHz oscillator.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
References pm_set_osc32_mode().
Referenced by rtc_init().
void pm_enable_osc32_ext_clock | ( | volatile avr32_pm_t * | pm | ) |
This function will enable the external clock mode of the 32-kHz oscillator.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
References pm_set_osc32_mode().
void pm_gc_disable | ( | volatile avr32_pm_t * | pm, |
unsigned int | gc | ||
) |
This function will disable a generic clock.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
gc | generic clock number (0 for gc0...) |
void pm_gc_enable | ( | volatile avr32_pm_t * | pm, |
unsigned int | gc | ||
) |
This function will enable a generic clock.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
gc | generic clock number (0 for gc0...) |
Referenced by init_codec_gclk(), local_enable_gclk_on_gpio(), local_start_gc(), pm_configure_usb_clock(), and prv_clk_gen_start().
void pm_gc_setup | ( | volatile avr32_pm_t * | pm, |
unsigned int | gc, | ||
unsigned int | osc_or_pll, | ||
unsigned int | pll_osc, | ||
unsigned int | diven, | ||
unsigned int | div | ||
) |
This function will setup a generic clock.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
gc | generic clock number (0 for gc0...) |
osc_or_pll | Use OSC (=0) or PLL (=1) |
pll_osc | Select Osc0/PLL0 or Osc1/PLL1 |
diven | Generic clock divisor enable |
div | Generic clock divisor |
References u_avr32_pm_gcctrl_t::gcctrl, and u_avr32_pm_gcctrl_t::GCCTRL.
Referenced by init_codec_gclk(), local_enable_gclk_on_gpio(), local_start_gc(), pm_configure_usb_clock(), and prv_clk_gen_start().
unsigned long pm_get_clock | ( | volatile avr32_pm_t * | pm | ) |
This function returns the power manager main clock.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
The | main clock value. |
References u_avr32_pm_mcctrl_t::mcctrl, and u_avr32_pm_mcctrl_t::MCCTRL.
Referenced by usb_suspend_action().
|
static |
Gets the MCU reset cause.
pm | Base address of the Power Manager instance (i.e. &AVR32_PM). |
AVR32_PM_RCAUSE_x_MASK
bit-masks to isolate specific causes. void pm_pll_disable | ( | volatile avr32_pm_t * | pm, |
unsigned int | pll | ||
) |
This function will disable a PLL.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pll | PLL number(0 for PLL0, 1 for PLL1) |
void pm_pll_enable | ( | volatile avr32_pm_t * | pm, |
unsigned int | pll | ||
) |
This function will enable a PLL.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pll | PLL number(0 for PLL0, 1 for PLL1) |
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), pm_configure_clocks(), pm_configure_usb_clock(), prv_clk_gen_start(), and sys_cpu_48MHz().
unsigned int pm_pll_get_option | ( | volatile avr32_pm_t * | pm, |
unsigned int | pll | ||
) |
This function will get a PLL option.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pll | PLL number(0 for PLL0, 1 for PLL1) |
void pm_pll_set_option | ( | volatile avr32_pm_t * | pm, |
unsigned int | pll, | ||
unsigned int | pll_freq, | ||
unsigned int | pll_div2, | ||
unsigned int | pll_wbwdisable | ||
) |
This function will set a PLL option.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pll | PLL number(0 for PLL0, 1 for PLL1) |
pll_freq | Set to 1 for VCO frequency range 80-180MHz, set to 0 for VCO frequency range 160-240Mhz. |
pll_div2 | Divide the PLL output frequency by 2 (this settings does not change the FVCO value) |
pll_wbwdisable | 1 Disable the Wide-Bandith Mode (Wide-Bandwith mode allow a faster startup time and out-of-lock time). 0 to enable the Wide-Bandith Mode. |
References u_avr32_pm_pll_t::pll, and u_avr32_pm_pll_t::PLL.
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), pm_configure_clocks(), pm_configure_usb_clock(), prv_clk_gen_start(), and sys_cpu_48MHz().
void pm_pll_setup | ( | volatile avr32_pm_t * | pm, |
unsigned int | pll, | ||
unsigned int | mul, | ||
unsigned int | div, | ||
unsigned int | osc, | ||
unsigned int | lockcount | ||
) |
This function will setup a PLL.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
pll | PLL number(0 for PLL0, 1 for PLL1) |
mul | PLL MUL in the PLL formula |
div | PLL DIV in the PLL formula |
osc | OSC number (0 for osc0, 1 for osc1) |
lockcount | PLL lock count |
References u_avr32_pm_pll_t::pll, and u_avr32_pm_pll_t::PLL.
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), pm_configure_clocks(), pm_configure_usb_clock(), prv_clk_gen_start(), and sys_cpu_48MHz().
unsigned long pm_read_gplp | ( | volatile avr32_pm_t * | pm, |
unsigned long | gplp | ||
) |
Read the content of the PM GPLP registers.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
gplp | GPLP register index (0,1,... depending on the number of GPLP registers for a given part) |
Referenced by pcl_read_gplp(), and wdt_scheduler().
void pm_switch_to_clock | ( | volatile avr32_pm_t * | pm, |
unsigned long | clock | ||
) |
This function will switch the power manager main clock.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
clock | Clock to be switched on. AVR32_PM_MCSEL_SLOW for RCOsc, AVR32_PM_MCSEL_OSC0 for Osc0, AVR32_PM_MCSEL_PLL0 for PLL0. |
References u_avr32_pm_mcctrl_t::mcctrl, and u_avr32_pm_mcctrl_t::MCCTRL.
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), main(), pm_configure_clocks(), pm_switch_to_osc0(), prv_clk_gen_start(), sys_cpu_48MHz(), and usb_suspend_action().
void pm_switch_to_osc0 | ( | volatile avr32_pm_t * | pm, |
unsigned int | fosc0, | ||
unsigned int | startup | ||
) |
Switch main clock to clock Osc0 (crystal mode)
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
fosc0 | Oscillator 0 crystal frequency (Hz) |
startup | Crystal 0 startup time. AVR32_PM_OSCCTRL0_STARTUP_x_RCOSC. |
References pm_enable_clk0(), pm_enable_osc0_crystal(), and pm_switch_to_clock().
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), main(), pcl_switch_to_osc(), pm_configure_clocks(), and sys_cpu_48MHz().
void pm_wait_for_clk0_ready | ( | volatile avr32_pm_t * | pm | ) |
This function will wait until the Osc0 clock is ready.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
Referenced by pm_enable_clk0().
void pm_wait_for_clk1_ready | ( | volatile avr32_pm_t * | pm | ) |
This function will wait until the Osc1 clock is ready.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
Referenced by pm_enable_clk1().
void pm_wait_for_clk32_ready | ( | volatile avr32_pm_t * | pm | ) |
This function will wait until the osc32 clock is ready.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
Referenced by pm_enable_clk32().
void pm_wait_for_pll0_locked | ( | volatile avr32_pm_t * | pm | ) |
This function will wait for PLL0 locked.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
Referenced by clockfrequencies_configure(), init_sys_clocks(), local_start_highfreq_clock(), pm_configure_clocks(), prv_clk_gen_start(), and sys_cpu_48MHz().
void pm_wait_for_pll1_locked | ( | volatile avr32_pm_t * | pm | ) |
This function will wait for PLL1 locked.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
Referenced by init_sys_clocks(), pm_configure_usb_clock(), and prv_clk_gen_start().
void pm_write_gplp | ( | volatile avr32_pm_t * | pm, |
unsigned long | gplp, | ||
unsigned long | value | ||
) |
Write into the PM GPLP registers.
pm | Base address of the Power Manager (i.e. &AVR32_PM) |
gplp | GPLP register index (0,1,... depending on the number of GPLP registers for a given part) |
value | Value to write |
Referenced by pcl_write_gplp(), and wdt_scheduler().