37 #ifndef CHIP_GENCLK_H_INCLUDED 38 #define CHIP_GENCLK_H_INCLUDED 58 #define GENCLK_PCK_0 0 59 #define GENCLK_PCK_1 1 60 #define GENCLK_PCK_2 2 110 p_cfg->
ctrl =
PMC->PMC_PCK[ul_id];
116 PMC->PMC_PCK[ul_id] = p_cfg->
ctrl;
159 p_cfg->
ctrl |= e_divider;
166 PMC->PMC_PCK[ul_id] = p_cfg->
ctrl;
234 #ifdef CONFIG_PLL0_SOURCE static void osc_wait_ready(uint8_t id)
Wait until the oscillator identified by id is ready.
#define PMC
(PMC ) Base Address
#define OSC_SLCK_32K_RC
Internal 32kHz RC oscillator.
#define PMC_PCK_PRES_Msk
(PMC_PCK[8]) Programmable Clock Prescaler
void pmc_enable_pck(uint32_t ul_id)
Enable the specified programmable clock.
#define OSC_SLCK_32K_BYPASS
External 32kHz bypass oscillator.
#define OSC_MAINCK_12M_RC
Internal 12MHz RC oscillator.
Set PCK clock prescaler to 32.
Set PCK clock prescaler to 16.
Set PCK clock prescaler to 8.
Internal 12MHz RC oscillator as PCK source clock.
genclk_source
Generic clock source ID.
static void genclk_enable_source(enum genclk_source e_src)
Enable the source clock src used by a generic clock.
static void genclk_config_set_source(struct genclk_config *p_cfg, enum genclk_source e_src)
Select a new source clock src in configuration cfg.
#define PMC_PCK_CSS_SLOW_CLK
(PMC_PCK[8]) Slow Clock is selected
Set PCK clock prescaler to 4.
void pmc_disable_pck(uint32_t ul_id)
Disable the specified programmable clock.
Set PCK clock prescaler to 64.
Chip-specific PLL definitions.
Set PCK clock prescaler to 2.
#define PMC_PCK_CSS_PLLA_CLK
(PMC_PCK[8]) PLLA Clock is selected
Use PLLACK as PCK source clock.
static void genclk_enable(const struct genclk_config *p_cfg, uint32_t ul_id)
External 32kHz crystal oscillator as PCK source clock.
static void osc_enable(uint32_t ul_id)
static void genclk_config_defaults(struct genclk_config *p_cfg, uint32_t ul_id)
static void genclk_config_read(struct genclk_config *p_cfg, uint32_t ul_id)
External bypass oscillator as PCK source clock.
#define PMC_PCK_CSS_MAIN_CLK
(PMC_PCK[8]) Main Clock is selected
Hardware representation of a set of generic clock parameters.
static void genclk_config_write(const struct genclk_config *p_cfg, uint32_t ul_id)
#define PMC_PCK_PRES(value)
static void genclk_disable(uint32_t ul_id)
#define PMC_PCK_CSS_Msk
(PMC_PCK[8]) Programmable Clock Source Selection
Set PCK clock prescaler to 1.
Internal 32kHz RC oscillator as PCK source clock.
#define OSC_MAINCK_BYPASS
External bypass oscillator.
#define PMC_PCK_CSS_MCK
(PMC_PCK[8]) Master Clock is selected
static void genclk_config_set_divider(struct genclk_config *p_cfg, uint32_t e_divider)
Use Master Clk as PCK source clock.
static void pll_enable_config_defaults(unsigned int ul_pll_id)
Enable the pll with the default configuration. PLL is enabled, if the PLL is not already locked...
#define OSC_MAINCK_8M_RC
Internal 8MHz RC oscillator.
#define OSC_MAINCK_4M_RC
Internal 4MHz RC oscillator.
#define OSC_MAINCK_XTAL
External crystal oscillator.
static bool osc_is_ready(uint32_t ul_id)
Chip-specific oscillator management functions.
#define Assert(expr)
This macro is used to test fatal errors.
External crystal oscillator as PCK source clock.
#define OSC_SLCK_32K_XTAL
External 32kHz crystal oscillator.
Internal 4MHz RC oscillator as PCK source clock.
Internal 8MHz RC oscillator as PCK source clock.
External 32kHz bypass oscillator as PCK source clock.