258 Chip-specific system clock management functions.
static void osc_wait_ready(uint8_t id)
Wait until the oscillator identified by id is ready.
#define CONFIG_PLL1_SOURCE
#define OSC_SLCK_32K_RC
Internal 32kHz RC oscillator.
#define CHIP_FREQ_CPU_MAX
#define USBCLK_SRC_UPLL
Use UPLL.
#define PMC_MCKR_CSS_SLOW_CLK
(PMC_MCKR) Slow Clock is selected
uint32_t pmc_switch_mck_to_pllack(uint32_t ul_pres)
Switch master clock source selection to PLLA clock.
#define OSC_SLCK_32K_BYPASS
External 32kHz bypass oscillator.
static uint32_t sysclk_get_cpu_hz(void)
Return the current rate in Hz of the CPU clock.
#define OSC_MAINCK_12M_RC
Internal 12MHz RC oscillator.
#define CONFIG_SYSCLK_SOURCE
Initial/static main system clock source.
#define SYSCLK_SRC_MAINCK_12M_RC
Internal 12MHz RC oscillator as master source clock.
void pmc_mck_set_prescaler(uint32_t ul_pres)
Set the prescaler of the MCK.
uint32_t pmc_switch_mck_to_sclk(uint32_t ul_pres)
Switch master clock source selection to slow clock.
void SystemCoreClockUpdate(void)
Updates the SystemCoreClock with current core Clock retrieved from cpu registers. ...
#define SYSCLK_SRC_PLLACK
Use PLLACK as master source clock.
#define SYSCLK_SRC_MAINCK_8M_RC
Internal 8MHz RC oscillator as master source clock.
static void pll_enable_source(enum pll_source e_src)
Enable the source of the pll. The source is enabled, if the source is not already running...
#define SYSCLK_SRC_SLCK_XTAL
External 32kHz crystal oscillator as master source clock.
#define SYSCLK_SRC_SLCK_RC
Internal 32kHz RC oscillator as master source clock.
#define PMC_MCKR_CSS_MAIN_CLK
(PMC_MCKR) Main Clock is selected
static void pll_enable(const struct pll_config *p_cfg, uint32_t ul_pll_id)
void sysclk_set_prescalers(uint32_t ul_pres)
Set system clock prescaler configuration.
static void osc_enable(uint32_t ul_id)
void sysclk_init(void)
Initialize the synchronous clock system.
#define CONFIG_PLL0_SOURCE
void sysclk_enable_usb(void)
#define SYSCLK_SRC_SLCK_BYPASS
External 32kHz bypass oscillator as master source clock.
Hardware-specific representation of PLL configuration.
void system_init_flash(uint32_t ul_clk)
#define pll_config_defaults(cfg, pll_id)
Initialize PLL configuration using default parameters.
static int pll_wait_for_lock(unsigned int pll_id)
Wait for PLL pll_id to become locked.
#define CONFIG_USBCLK_DIV
Configuration symbol for the USB generic clock divider setting.
#define OSC_MAINCK_BYPASS
External bypass oscillator.
void sysclk_disable_usb(void)
#define CONFIG_SYSCLK_PRES
Initial CPU clock divider (mck)
void pmc_mck_set_source(uint32_t ul_source)
Set the source of the MCK.
#define PMC_MCKR_CSS_PLLA_CLK
(PMC_MCKR) PLLA Clock is selected
uint32_t pmc_switch_mck_to_mainck(uint32_t ul_pres)
Switch master clock source selection to main clock.
#define OSC_MAINCK_8M_RC
Internal 8MHz RC oscillator.
#define PMC_MCKR_CSS_UPLL_CLK
(PMC_MCKR) Divided UPLL Clock is selected
#define CONFIG_SYSCLK_DIV
#define OSC_MAINCK_XTAL
External crystal oscillator.
#define USBCLK_SRC_PLL0
Use PLLA.
#define SYSCLK_SRC_UPLLCK
Use UPLLCK as master source clock.
#define SYSCLK_SRC_MAINCK_XTAL
External crystal oscillator as master source clock.
#define CONFIG_USBCLK_SOURCE
Configuration symbol for the USB generic clock source.
#define Assert(expr)
This macro is used to test fatal errors.
#define SYSCLK_SRC_MAINCK_BYPASS
External bypass oscillator as master source clock.
#define OSC_SLCK_32K_XTAL
External 32kHz crystal oscillator.
#define SYSCLK_SRC_MAINCK_4M_RC
Internal 4MHz RC oscillator as master source clock.
void sysclk_set_source(uint32_t ul_src)
Change the source of the main system clock.