1681 void pmc_disable_all_periph_clk(void)
Disable all peripheral clocks.
#define CKGR_MOR_MOSCSEL
(CKGR_MOR) Main Oscillator Selection
void pmc_disable_clock_failure_detector(void)
Disable Clock Failure Detector.
uint32_t pmc_get_writeprotect_status(void)
Return write protect status.
#define PMC_FSMR_FLPM_Msk
(PMC_FSMR) Flash Low-power Mode
#define CKGR_MOR_WAITMODE
(CKGR_MOR) Wait Mode Command (Write-only)
#define CKGR_MOR_MOSCXTBY
(CKGR_MOR) Main Crystal Oscillator Bypass
void pmc_switch_mainck_to_xtal(uint32_t ul_bypass, uint32_t ul_xtal_startup_time)
Switch main clock source selection to external Xtal/Bypass.
#define PMC
(PMC ) Base Address
uint32_t pmc_switch_pck_to_sclk(uint32_t ul_id, uint32_t ul_pres)
Switch programmable clock source selection to slow clock.
uint32_t pmc_osc_is_ready_32kxtal(void)
Check if the external 32k Xtal is ready.
#define CKGR_MOR_MOSCRCF_Msk
(CKGR_MOR) Main On-Chip RC Oscillator Frequency Selection
void pmc_disable_all_pck(void)
Disable all programmable clocks.
#define UNUSED(v)
Marking v as a unused parameter or value.
#define SUPC_MR_OSCBYPASS
(SUPC_MR) Oscillator Bypass
#define CKGR_UCKR_UPLLCOUNT(value)
void pmc_enable_sleepmode(uint8_t uc_type)
Enable Sleep Mode. Enter condition: (WFE or WFI) + (SLEEPDEEP bit = 0) + (LPM bit = 0) ...
#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 PMC_MCKR_CSS_SLOW_CLK
(PMC_MCKR) Slow Clock is selected
#define SCB_SCR_SLEEPDEEP_Msk
#define CKGR_MOR_MOSCRCEN
(CKGR_MOR) Main On-Chip RC Oscillator Enable
#define PMC_MCKR_MDIV_PCK_DIV4
(PMC_MCKR) Master Clock is Prescaler Output Clock divided by 4.
void pmc_osc_bypass_main_xtal(void)
Bypass main XTAL.
uint32_t pmc_switch_mck_to_pllack(uint32_t ul_pres)
Switch master clock source selection to PLLA clock.
#define CKGR_PLLAR_MULA(value)
void pmc_enable_waitmode(void)
Enable Wait Mode. Enter condition: WFE + (SLEEPDEEP bit = 0) + (LPM bit = 1)
#define CKGR_MOR_XT32KFME
(CKGR_MOR) Slow Crystal Oscillator Frequency Monitoring Enable
#define CKGR_UCKR_UPLLEN
(CKGR_UCKR) UTMI PLL Enable
#define PMC_SR_MOSCXTS
(PMC_SR) Main Crystal Oscillator Status
void pmc_disable_interrupt(uint32_t ul_sources)
Disable PMC interrupts.
#define PMC_PCK_CSS_UPLL_CLK
(PMC_PCK[8]) Divided UPLL Clock is selected
uint32_t pmc_is_pck_enabled(uint32_t ul_id)
Check if the specified programmable clock is enabled.
#define PMC_MCKR_MDIV_PCK_DIV3
(PMC_MCKR) Master Clock is Prescaler Output Clock divided by 3.
#define SUPC_CR_XTALSEL
(SUPC_CR) Crystal Oscillator Select
void pmc_osc_disable_main_xtal(void)
Disable the main Xtal.
void pmc_mck_set_prescaler(uint32_t ul_pres)
Set the prescaler of the MCK.
#define PMC_USB_USBDIV(value)
uint32_t pmc_switch_mck_to_sclk(uint32_t ul_pres)
Switch master clock source selection to slow clock.
void pmc_enable_clock_failure_detector(void)
Enable Clock Failure Detector.
uint32_t pmc_disable_periph_clk(uint32_t ul_id)
Disable the specified peripheral clock.
uint32_t pmc_enable_periph_clk(uint32_t ul_id)
Enable the specified peripheral clock.
void pmc_switch_sclk_to_32kxtal(uint32_t ul_bypass)
Switch slow clock source selection to external 32k (Xtal or Bypass).
uint32_t pmc_osc_is_ready_main_xtal(void)
Check if the main crystal is ready.
void pmc_enable_all_periph_clk(void)
Enable all peripheral clocks.
#define PMC_SCDR_USBCLK
(PMC_SCDR) Disable USB FS Clock
#define PMC_SR_MOSCRCS
(PMC_SR) Main On-Chip RC Oscillator Status
#define PMC_SCDR_PCK0
(PMC_SCDR) Programmable Clock 0 Output Disable
#define PMC_WPMR_WPEN
(PMC_WPMR) Write Protection Enable
#define PMC_FAST_STARTUP_Msk
#define PMC_PCK_CSS_SLOW_CLK
(PMC_PCK[8]) Slow Clock is selected
uint32_t pmc_osc_is_ready_mainck(void)
Check if the MAINCK is ready. Depending on MOSCEL, MAINCK can be one of Xtal, bypass or internal RC...
void pmc_set_writeprotect(uint32_t ul_enable)
Enable or disable write protect of PMC registers.
void pmc_disable_pck(uint32_t ul_id)
Disable the specified programmable clock.
void pmc_enable_all_pck(void)
Enable all programmable clocks.
void pmc_enable_interrupt(uint32_t ul_sources)
Enable PMC interrupts.
#define PMC_FSMR_LPM
(PMC_FSMR) Low-power Mode
#define PMC_SCER_PCK1
(PMC_SCER) Programmable Clock 1 Output Enable
void pmc_set_fast_startup_input(uint32_t ul_inputs)
Set the wake-up inputs for fast startup mode registers (event generation).
void pmc_enable_pllack(uint32_t mula, uint32_t pllacount, uint32_t diva)
Enable PLLA clock.
#define PMC_SR_PCKRDY0
(PMC_SR) Programmable Clock Ready Status
#define PMC_MCKR_MDIV_PCK_DIV2
(PMC_MCKR) Master Clock is Prescaler Output Clock divided by 2.
#define PMC_PCK_CSS_PLLA_CLK
(PMC_PCK[8]) PLLA Clock is selected
void pmc_clr_fast_startup_input(uint32_t ul_inputs)
Clear the wake-up inputs for fast startup mode registers (remove event generation).
#define PMC_MCKR_CSS_MAIN_CLK
(PMC_MCKR) Main Clock is selected
uint32_t pmc_is_locked_pllack(void)
Is PLLA locked?
void pmc_mainck_osc_select(uint32_t ul_xtal_rc)
Select Main Crystal or internal RC as main clock source.
#define PMC_SCER_PCK0
(PMC_SCER) Programmable Clock 0 Output Enable
#define CKGR_PLLAR_ONE
(CKGR_PLLAR) Must Be Set to 1
#define CKGR_MOR_MOSCXTEN
(CKGR_MOR) Main Crystal Oscillator Enable
uint32_t pmc_switch_pck_to_pllack(uint32_t ul_id, uint32_t ul_pres)
Switch programmable clock source selection to PLLA clock.
uint32_t pmc_get_status(void)
Get current status.
#define PMC_PCK_CSS_MAIN_CLK
(PMC_PCK[8]) Main Clock is selected
#define CKGR_PLLAR_DIVA(value)
void pmc_pck_set_source(uint32_t ul_id, uint32_t ul_source)
Set the source oscillator for the specified programmable clock.
#define PMC_SCDR_PCK2
(PMC_SCDR) Programmable Clock 2 Output Disable
#define PMC_SR_LOCKA
(PMC_SR) PLLA Lock Status
#define PMC_PCK_CSS_Msk
(PMC_PCK[8]) Programmable Clock Source Selection
void pmc_enable_backupmode(void)
Enable Backup Mode. Enter condition: WFE/(VROFF bit = 1) + (SLEEPDEEP bit = 1)
#define PMC_SR_MOSCSELS
(PMC_SR) Main Oscillator Selection Status
void pmc_switch_mainck_to_fastrc(uint32_t ul_moscrcf)
Switch main clock source selection to internal fast RC.
void pmc_osc_disable_xtal(uint32_t ul_bypass)
Disable the external Xtal.
#define PMC_SR_MCKRDY
(PMC_SR) Master Clock Status
#define PMC_PCR_EN
(PMC_PCR) Enable
uint32_t pmc_switch_pck_to_mck(uint32_t ul_id, uint32_t ul_pres)
Switch programmable clock source selection to mck.
#define CKGR_PLLAR_PLLACOUNT(value)
#define PMC_PCK_CSS_MCK
(PMC_PCK[8]) Master Clock is selected
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
#define PMC_SCDR_PCK1
(PMC_SCDR) Programmable Clock 1 Output Disable
#define SUPC_MR_KEY_PASSWD
#define SUPC
(SUPC ) Base Address
#define SUPC_MR_KEY_Msk
(SUPC_MR) Password Key
#define CKGR_MOR_MOSCXTST(value)
void pmc_osc_enable_main_xtal(uint32_t ul_xtal_startup_time)
Enable main XTAL oscillator.
uint32_t pmc_switch_mck_to_mainck(uint32_t ul_pres)
Switch master clock source selection to main clock.
#define PMC_SR_LOCKU
(PMC_SR) UTMI PLL Lock Status
#define PMC_USB_USBS
(PMC_USB) USB Input Clock Selection
uint32_t pmc_switch_pck_to_mainck(uint32_t ul_id, uint32_t ul_pres)
Switch programmable clock source selection to main clock.
#define PMC_MCKR_PRES_Msk
(PMC_MCKR) Processor Clock Prescaler
#define PMC_MCKR_MDIV_EQ_PCK
(PMC_MCKR) Master Clock is Prescaler Output Clock divided by 1.
void pmc_pck_set_prescaler(uint32_t ul_id, uint32_t ul_pres)
Set the prescaler for the specified programmable clock.
#define PMC_MCKR_CSS_UPLL_CLK
(PMC_MCKR) Divided UPLL Clock is selected
uint32_t pmc_is_periph_clk_enabled(uint32_t ul_id)
Check if the specified peripheral clock is enabled.
#define SUPC_CR_KEY_PASSWD
Power Management Controller (PMC) driver for SAM.
void pmc_osc_disable_fastrc(void)
Disable the internal fast RC.
#define CKGR_MOR_CFDEN
(CKGR_MOR) Clock Failure Detector Enable
#define SUPC_CR_VROFF_STOP_VREG
(SUPC_CR) If KEY is correct, VROFF asserts the vddcore_nreset and stops the voltage regulator...
#define PMC_SCER_USBCLK
(PMC_SCER) Enable USB FS Clock
#define PMC_PCR_CMD
(PMC_PCR) Command
#define PMC_WPMR_WPKEY_PASSWD
void pmc_osc_enable_fastrc(uint32_t ul_rc)
Enable fast RC oscillator.
uint32_t pmc_osc_is_bypassed_main_xtal(void)
Check if the main crystal is bypassed.
uint32_t pmc_get_interrupt_mask(void)
Get PMC interrupt mask.
#define PMC_MCKR_CSS_Msk
(PMC_MCKR) Master Clock Source Selection
#define PMC_SR_OSCSELS
(PMC_SR) Slow Clock Oscillator Selection
uint32_t pmc_osc_is_ready_fastrc(void)
Check if the main fastrc is ready.
#define PMC_SCER_PCK2
(PMC_SCER) Programmable Clock 2 Output Enable
void pmc_disable_pllack(void)
Disable PLLA clock.
#define SUPC_SR_OSCSEL
(SUPC_SR) 32-kHz Oscillator Selection Status
#define PMC_SCSR_PCK0
(PMC_SCSR) Programmable Clock 0 Output Status
#define PMC_MCKR_MDIV_Msk
(PMC_MCKR) Master Clock Division
#define CKGR_MOR_KEY_PASSWD