Robobo
|
Functions | |
void | pmc_mck_set_prescaler (uint32_t ul_pres) |
Set the prescaler of the MCK. More... | |
void | pmc_mck_set_source (uint32_t ul_source) |
Set the source of the MCK. More... | |
uint32_t | pmc_switch_mck_to_sclk (uint32_t ul_pres) |
Switch master clock source selection to slow clock. More... | |
uint32_t | pmc_switch_mck_to_mainck (uint32_t ul_pres) |
Switch master clock source selection to main clock. More... | |
uint32_t | pmc_switch_mck_to_pllack (uint32_t ul_pres) |
Switch master clock source selection to PLLA clock. More... | |
void | pmc_switch_sclk_to_32kxtal (uint32_t ul_bypass) |
Switch slow clock source selection to external 32k (Xtal or Bypass). More... | |
uint32_t | pmc_osc_is_ready_32kxtal (void) |
Check if the external 32k Xtal is ready. More... | |
void | pmc_switch_mainck_to_fastrc (uint32_t ul_moscrcf) |
Switch main clock source selection to internal fast RC. More... | |
void | pmc_osc_enable_fastrc (uint32_t ul_rc) |
Enable fast RC oscillator. More... | |
void | pmc_osc_disable_fastrc (void) |
Disable the internal fast RC. | |
void | pmc_switch_mainck_to_xtal (uint32_t ul_bypass) |
Switch main clock source selection to external Xtal/Bypass. The function may switch MCK to SCLK if MCK source is MAINCK to avoid any system crash. More... | |
void | pmc_osc_disable_xtal (uint32_t ul_bypass) |
Disable the external Xtal. More... | |
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. More... | |
void | pmc_enable_pllack (uint32_t mula, uint32_t pllacount, uint32_t diva) |
Enable PLLA clock. More... | |
void | pmc_disable_pllack (void) |
Disable PLLA clock. | |
uint32_t | pmc_is_locked_pllack (void) |
Is PLLA locked? More... | |
uint32_t | pmc_enable_periph_clk (uint32_t ul_id) |
Enable the specified peripheral clock. More... | |
uint32_t | pmc_disable_periph_clk (uint32_t ul_id) |
Disable the specified peripheral clock. More... | |
void | pmc_enable_all_periph_clk (void) |
Enable all peripheral clocks. | |
void | pmc_disable_all_periph_clk (void) |
Disable all peripheral clocks. | |
uint32_t | pmc_is_periph_clk_enabled (uint32_t ul_id) |
Check if the specified peripheral clock is enabled. More... | |
void | pmc_pck_set_prescaler (uint32_t ul_id, uint32_t ul_pres) |
Set the prescaler for the specified programmable clock. More... | |
void | pmc_pck_set_source (uint32_t ul_id, uint32_t ul_source) |
Set the source oscillator for the specified programmable clock. More... | |
uint32_t | pmc_switch_pck_to_sclk (uint32_t ul_id, uint32_t ul_pres) |
Switch programmable clock source selection to slow clock. More... | |
uint32_t | pmc_switch_pck_to_mainck (uint32_t ul_id, uint32_t ul_pres) |
Switch programmable clock source selection to main clock. More... | |
uint32_t | pmc_switch_pck_to_pllack (uint32_t ul_id, uint32_t ul_pres) |
Switch programmable clock source selection to PLLA clock. More... | |
void | pmc_enable_pck (uint32_t ul_id) |
Enable the specified programmable clock. More... | |
void | pmc_disable_pck (uint32_t ul_id) |
Disable the specified programmable clock. More... | |
void | pmc_enable_all_pck (void) |
Enable all programmable clocks. | |
void | pmc_disable_all_pck (void) |
Disable all programmable clocks. | |
uint32_t | pmc_is_pck_enabled (uint32_t ul_id) |
Check if the specified programmable clock is enabled. More... | |
void | pmc_enable_interrupt (uint32_t ul_sources) |
Enable PMC interrupts. More... | |
void | pmc_disable_interrupt (uint32_t ul_sources) |
Disable PMC interrupts. More... | |
uint32_t | pmc_get_interrupt_mask (void) |
Get PMC interrupt mask. More... | |
uint32_t | pmc_get_status (void) |
Get current status. More... | |
void | pmc_set_fast_startup_input (uint32_t ul_inputs) |
Set the wake-up inputs for fast startup mode registers (event generation). More... | |
void | pmc_clr_fast_startup_input (uint32_t ul_inputs) |
Clear the wake-up inputs for fast startup mode registers (remove event generation). More... | |
void | pmc_enable_sleepmode (uint8_t uc_type) |
Enable Sleep Mode. Enter condition: (WFE or WFI) + (SLEEPDEEP bit = 0) + (LPM bit = 0) More... | |
void | pmc_enable_waitmode (void) |
Enable Wait Mode. Enter condition: WFE + (SLEEPDEEP bit = 0) + (LPM bit = 1) | |
void | pmc_enable_backupmode (void) |
Enable Backup Mode. Enter condition: WFE + (SLEEPDEEP bit = 1) | |
void | pmc_set_writeprotect (uint32_t ul_enable) |
Enable or disable write protect of PMC registers. More... | |
uint32_t | pmc_get_writeprotect_status (void) |
Return write protect status. More... | |
The Power Management Controller (PMC) optimizes power consumption by controlling all system and user peripheral clocks. The PMC enables/disables the clock inputs to many of the peripherals and the Cortex-M Processor.
void pmc_clr_fast_startup_input | ( | uint32_t | ul_inputs | ) |
Clear the wake-up inputs for fast startup mode registers (remove event generation).
ul_inputs | Wake up inputs to disable. |
void pmc_disable_interrupt | ( | uint32_t | ul_sources | ) |
Disable PMC interrupts.
ul_sources | Interrupt sources bit map. |
void pmc_disable_pck | ( | uint32_t | ul_id | ) |
Disable the specified programmable clock.
ul_id | Id of the programmable clock. |
uint32_t pmc_disable_periph_clk | ( | uint32_t | ul_id | ) |
Disable the specified peripheral clock.
ul_id | Peripheral ID (ID_xxx). |
0 | Success. |
1 | Invalid parameter. |
void pmc_enable_interrupt | ( | uint32_t | ul_sources | ) |
Enable PMC interrupts.
ul_sources | Interrupt sources bit map. |
void pmc_enable_pck | ( | uint32_t | ul_id | ) |
Enable the specified programmable clock.
ul_id | Id of the programmable clock. |
uint32_t pmc_enable_periph_clk | ( | uint32_t | ul_id | ) |
Enable the specified peripheral clock.
ul_id | Peripheral ID (ID_xxx). |
0 | Success. |
1 | Invalid parameter. |
void pmc_enable_pllack | ( | uint32_t | mula, |
uint32_t | pllacount, | ||
uint32_t | diva | ||
) |
Enable PLLA clock.
mula | PLLA multiplier. |
pllacount | PLLA counter. |
diva | Divider. |
void pmc_enable_sleepmode | ( | uint8_t | uc_type | ) |
Enable Sleep Mode. Enter condition: (WFE or WFI) + (SLEEPDEEP bit = 0) + (LPM bit = 0)
uc_type | 0 for wait for interrupt, 1 for wait for event. |
uint32_t pmc_get_interrupt_mask | ( | void | ) |
Get PMC interrupt mask.
uint32_t pmc_get_status | ( | void | ) |
Get current status.
uint32_t pmc_get_writeprotect_status | ( | void | ) |
Return write protect status.
0 | Protection disabled. |
1 | Protection enabled. |
uint32_t pmc_is_locked_pllack | ( | void | ) |
Is PLLA locked?
0 | Not locked. |
1 | Locked. |
uint32_t pmc_is_pck_enabled | ( | uint32_t | ul_id | ) |
Check if the specified programmable clock is enabled.
ul_id | Id of the programmable clock. |
0 | Programmable clock is disabled or unknown. |
1 | Programmable clock is enabled. |
uint32_t pmc_is_periph_clk_enabled | ( | uint32_t | ul_id | ) |
Check if the specified peripheral clock is enabled.
ul_id | Peripheral ID (ID_xxx). |
0 | Peripheral clock is disabled or unknown. |
1 | Peripheral clock is enabled. |
void pmc_mck_set_prescaler | ( | uint32_t | ul_pres | ) |
Set the prescaler of the MCK.
ul_pres | Prescaler value. |
void pmc_mck_set_source | ( | uint32_t | ul_source | ) |
Set the source of the MCK.
ul_source | Source selection value. |
void pmc_osc_disable_xtal | ( | uint32_t | ul_bypass | ) |
Disable the external Xtal.
ul_bypass | 0 for Xtal, 1 for bypass. |
void pmc_osc_enable_fastrc | ( | uint32_t | ul_rc | ) |
Enable fast RC oscillator.
ul_rc | Fast RC oscillator(4/8/12Mhz). |
uint32_t pmc_osc_is_ready_32kxtal | ( | void | ) |
Check if the external 32k Xtal is ready.
1 | External 32k Xtal is ready. |
0 | External 32k Xtal is not ready. |
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.
1 | Xtal is ready. |
0 | Xtal is not ready. |
void pmc_pck_set_prescaler | ( | uint32_t | ul_id, |
uint32_t | ul_pres | ||
) |
Set the prescaler for the specified programmable clock.
ul_id | Peripheral ID. |
ul_pres | Prescaler value. |
void pmc_pck_set_source | ( | uint32_t | ul_id, |
uint32_t | ul_source | ||
) |
Set the source oscillator for the specified programmable clock.
ul_id | Peripheral ID. |
ul_source | Source selection value. |
void pmc_set_fast_startup_input | ( | uint32_t | ul_inputs | ) |
Set the wake-up inputs for fast startup mode registers (event generation).
ul_inputs | Wake up inputs to enable. |
void pmc_set_writeprotect | ( | uint32_t | ul_enable | ) |
Enable or disable write protect of PMC registers.
ul_enable | 1 to enable, 0 to disable. |
void pmc_switch_mainck_to_fastrc | ( | uint32_t | ul_moscrcf | ) |
Switch main clock source selection to internal fast RC.
ul_moscrcf | Fast RC oscillator(4/8/12Mhz). |
0 | Success. |
1 | Timeout error. |
2 | Invalid frequency. |
void pmc_switch_mainck_to_xtal | ( | uint32_t | ul_bypass | ) |
Switch main clock source selection to external Xtal/Bypass. The function may switch MCK to SCLK if MCK source is MAINCK to avoid any system crash.
ul_bypass | 0 for Xtal, 1 for bypass. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_mck_to_mainck | ( | uint32_t | ul_pres | ) |
Switch master clock source selection to main clock.
ul_pres | Processor clock prescaler. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_mck_to_pllack | ( | uint32_t | ul_pres | ) |
Switch master clock source selection to PLLA clock.
ul_pres | Processor clock prescaler. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_mck_to_sclk | ( | uint32_t | ul_pres | ) |
Switch master clock source selection to slow clock.
ul_pres | Processor clock prescaler. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_pck_to_mainck | ( | uint32_t | ul_id, |
uint32_t | ul_pres | ||
) |
Switch programmable clock source selection to main clock.
ul_id | Id of the programmable clock. |
ul_pres | Programmable clock prescaler. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_pck_to_pllack | ( | uint32_t | ul_id, |
uint32_t | ul_pres | ||
) |
Switch programmable clock source selection to PLLA clock.
ul_id | Id of the programmable clock. |
ul_pres | Programmable clock prescaler. |
0 | Success. |
1 | Timeout error. |
uint32_t pmc_switch_pck_to_sclk | ( | uint32_t | ul_id, |
uint32_t | ul_pres | ||
) |
Switch programmable clock source selection to slow clock.
ul_id | Id of the programmable clock. |
ul_pres | Programmable clock prescaler. |
0 | Success. |
1 | Timeout error. |
void pmc_switch_sclk_to_32kxtal | ( | uint32_t | ul_bypass | ) |
Switch slow clock source selection to external 32k (Xtal or Bypass).
ul_bypass | 0 for Xtal, 1 for bypass. |