![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
Macros | |
#define | CLK_SET_WKTMR_INTERVAL(u32Interval) |
Set Wake-up Timer Time-out Interval. More... | |
#define | CLK_SET_SPDDEBOUNCETIME(u32CycleSel) |
Set De-bounce Sampling Cycle Time. More... | |
Functions | |
__STATIC_INLINE void | CLK_SysTickDelay (uint32_t us) |
This function execute delay function. More... | |
__STATIC_INLINE void | CLK_SysTickLongDelay (uint32_t us) |
This function execute long delay function. More... | |
void | CLK_DisableCKO (void) |
Disable clock divider output function. More... | |
void | CLK_EnableCKO (uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) |
This function enable clock divider output module clock, enable clock divider output function and set frequency selection. More... | |
void | CLK_PowerDown (void) |
Enter to Power-down mode. More... | |
void | CLK_Idle (void) |
Enter to Idle mode. More... | |
uint32_t | CLK_GetHXTFreq (void) |
Get external high speed crystal clock frequency. More... | |
uint32_t | CLK_GetLXTFreq (void) |
Get external low speed crystal clock frequency. More... | |
uint32_t | CLK_GetHCLKFreq (void) |
Get HCLK frequency. More... | |
uint32_t | CLK_GetPCLK0Freq (void) |
Get PCLK0 frequency. More... | |
uint32_t | CLK_GetPCLK1Freq (void) |
Get PCLK1 frequency. More... | |
uint32_t | CLK_GetCPUFreq (void) |
Get CPU frequency. More... | |
uint32_t | CLK_SetCoreClock (uint32_t u32Hclk) |
Set HCLK frequency. More... | |
void | CLK_SetHCLK (uint32_t u32ClkSrc, uint32_t u32ClkDiv) |
This function set HCLK clock source and HCLK clock divider. More... | |
void | CLK_SetModuleClock (uint32_t u32ModuleIdx, uint32_t u32ClkSrc, uint32_t u32ClkDiv) |
This function set selected module clock source and module clock divider. More... | |
void | CLK_SetSysTickClockSrc (uint32_t u32ClkSrc) |
Set SysTick clock source. More... | |
void | CLK_EnableXtalRC (uint32_t u32ClkMask) |
Enable clock source. More... | |
void | CLK_DisableXtalRC (uint32_t u32ClkMask) |
Disable clock source. More... | |
void | CLK_EnableModuleClock (uint32_t u32ModuleIdx) |
Enable module clock. More... | |
void | CLK_DisableModuleClock (uint32_t u32ModuleIdx) |
Disable module clock. More... | |
uint32_t | CLK_EnablePLL (uint32_t u32PllClkSrc, uint32_t u32PllFreq) |
Set PLL frequency. More... | |
void | CLK_DisablePLL (void) |
Disable PLL. More... | |
uint32_t | CLK_WaitClockReady (uint32_t u32ClkMask) |
This function check selected clock source status. More... | |
void | CLK_EnableSysTick (uint32_t u32ClkSrc, uint32_t u32Count) |
Enable System Tick counter. More... | |
void | CLK_DisableSysTick (void) |
Disable System Tick counter. More... | |
void | CLK_SetPowerDownMode (uint32_t u32PDMode) |
Power-down mode selected. More... | |
void | CLK_EnableDPDWKPin (uint32_t u32TriggerType) |
Set Wake-up pin trigger type at Deep Power down mode. More... | |
uint32_t | CLK_GetPMUWKSrc (void) |
Get power manager wake up source. More... | |
void | CLK_EnableSPDWKPin (uint32_t u32Port, uint32_t u32Pin, uint32_t u32TriggerType, uint32_t u32DebounceEn) |
Set specified GPIO as wake up source at Stand-by Power down mode. More... | |
uint32_t | CLK_GetPLLClockFreq (void) |
Get PLL clock frequency. More... | |
uint32_t | CLK_GetModuleClockSource (uint32_t u32ModuleIdx) |
Get selected module clock source. More... | |
uint32_t | CLK_GetModuleClockDivider (uint32_t u32ModuleIdx) |
Get selected module clock divider number. More... | |
#define CLK_SET_SPDDEBOUNCETIME | ( | u32CycleSel | ) |
Set De-bounce Sampling Cycle Time.
This function set Set De-bounce Sampling Cycle Time.
#define CLK_SET_WKTMR_INTERVAL | ( | u32Interval | ) |
Set Wake-up Timer Time-out Interval.
[in] | u32Interval | The Wake-up Timer Time-out Interval selection. It could be |
This function set Wake-up Timer Time-out Interval.
void CLK_DisableCKO | ( | void | ) |
void CLK_DisableModuleClock | ( | uint32_t | u32ModuleIdx | ) |
Disable module clock.
This function is used to disable module clock.
void CLK_DisablePLL | ( | void | ) |
void CLK_DisableSysTick | ( | void | ) |
void CLK_DisableXtalRC | ( | uint32_t | u32ClkMask | ) |
Disable clock source.
[in] | u32ClkMask | is clock source mask. Including : |
This function disable clock source.
The register write-protection function should be disabled before using this function.
void CLK_EnableCKO | ( | uint32_t | u32ClkSrc, |
uint32_t | u32ClkDiv, | ||
uint32_t | u32ClkDivBy1En | ||
) |
This function enable clock divider output module clock, enable clock divider output function and set frequency selection.
[in] | u32ClkSrc | is frequency divider function clock source. Including : |
[in] | u32ClkDiv | is divider output frequency selection. It could be 0~15. |
[in] | u32ClkDivBy1En | is clock divided by one enabled. |
Output selected clock to CKO. The output clock frequency is divided by u32ClkDiv.
The formula is:
CKO frequency = (Clock source frequency) / 2^(u32ClkDiv + 1)
This function is just used to set CKO clock. User must enable I/O for CKO clock output pin by themselves.
void CLK_EnableDPDWKPin | ( | uint32_t | u32TriggerType | ) |
Set Wake-up pin trigger type at Deep Power down mode.
This function is used to enable Wake-up pin trigger type.
void CLK_EnableModuleClock | ( | uint32_t | u32ModuleIdx | ) |
Enable module clock.
This function is used to enable module clock.
uint32_t CLK_EnablePLL | ( | uint32_t | u32PllClkSrc, |
uint32_t | u32PllFreq | ||
) |
Set PLL frequency.
[in] | u32PllClkSrc | is PLL clock source. Including : |
[in] | u32PllFreq | is PLL frequency. |
This function is used to configure PLLCTL register to set specified PLL frequency.
The register write-protection function should be disabled before using this function.
void CLK_EnableSPDWKPin | ( | uint32_t | u32Port, |
uint32_t | u32Pin, | ||
uint32_t | u32TriggerType, | ||
uint32_t | u32DebounceEn | ||
) |
Set specified GPIO as wake up source at Stand-by Power down mode.
[in] | u32Port | GPIO port. It could be 0~3. |
[in] | u32Pin | The pin of specified GPIO port. It could be 0 ~ 15. |
[in] | u32TriggerType | |
[in] | u32DebounceEn |
This function is used to set specified GPIO as wake up source at Stand-by Power down mode.
void CLK_EnableSysTick | ( | uint32_t | u32ClkSrc, |
uint32_t | u32Count | ||
) |
Enable System Tick counter.
[in] | u32ClkSrc | is System Tick clock source. Including: |
[in] | u32Count | is System Tick reload value. It could be 0~0xFFFFFF. |
This function set System Tick clock source, reload value, enable System Tick counter and interrupt.
The register write-protection function should be disabled before using this function.
void CLK_EnableXtalRC | ( | uint32_t | u32ClkMask | ) |
Enable clock source.
[in] | u32ClkMask | is clock source mask. Including : |
This function enable clock source.
The register write-protection function should be disabled before using this function.
uint32_t CLK_GetCPUFreq | ( | void | ) |
uint32_t CLK_GetHCLKFreq | ( | void | ) |
uint32_t CLK_GetHXTFreq | ( | void | ) |
uint32_t CLK_GetLXTFreq | ( | void | ) |
uint32_t CLK_GetModuleClockDivider | ( | uint32_t | u32ModuleIdx | ) |
Get selected module clock divider number.
[in] | u32ModuleIdx | is module index. |
This function get selected module clock divider number.
uint32_t CLK_GetModuleClockSource | ( | uint32_t | u32ModuleIdx | ) |
Get selected module clock source.
This function get selected module clock source.
uint32_t CLK_GetPCLK0Freq | ( | void | ) |
uint32_t CLK_GetPCLK1Freq | ( | void | ) |
uint32_t CLK_GetPLLClockFreq | ( | void | ) |
uint32_t CLK_GetPMUWKSrc | ( | void | ) |
void CLK_Idle | ( | void | ) |
void CLK_PowerDown | ( | void | ) |
uint32_t CLK_SetCoreClock | ( | uint32_t | u32Hclk | ) |
Set HCLK frequency.
[in] | u32Hclk | is HCLK frequency. The range of u32Hclk is running up to 192MHz. |
This function is used to set HCLK frequency. The frequency unit is Hz.
The register write-protection function should be disabled before using this function.
void CLK_SetHCLK | ( | uint32_t | u32ClkSrc, |
uint32_t | u32ClkDiv | ||
) |
This function set HCLK clock source and HCLK clock divider.
[in] | u32ClkSrc | is HCLK clock source. Including : |
[in] | u32ClkDiv | is HCLK clock divider. Including : |
This function set HCLK clock source and HCLK clock divider.
The register write-protection function should be disabled before using this function.
void CLK_SetModuleClock | ( | uint32_t | u32ModuleIdx, |
uint32_t | u32ClkSrc, | ||
uint32_t | u32ClkDiv | ||
) |
This function set selected module clock source and module clock divider.
[in] | u32ModuleIdx | is module index. |
[in] | u32ClkSrc | is module clock source. |
[in] | u32ClkDiv | is module clock divider. |
Valid parameter combinations listed in following table:
void CLK_SetPowerDownMode | ( | uint32_t | u32PDMode | ) |
Power-down mode selected.
[in] | u32PDMode | is power down mode index. Including : |
This function is used to set power-down mode.
void CLK_SetSysTickClockSrc | ( | uint32_t | u32ClkSrc | ) |
Set SysTick clock source.
[in] | u32ClkSrc | is module clock source. Including: |
This function set SysTick clock source.
The register write-protection function should be disabled before using this function.
__STATIC_INLINE void CLK_SysTickDelay | ( | uint32_t | us | ) |
This function execute delay function.
[in] | us | Delay time. The Max value is 2^24 / CPU Clock(MHz). Ex: 72MHz => 233016us, 50MHz => 335544us, 48MHz => 349525us, 28MHz => 699050us ... |
Use the SysTick to generate the delay time and the unit is in us. The SysTick clock source is from HCLK, i.e the same as system core clock.
__STATIC_INLINE void CLK_SysTickLongDelay | ( | uint32_t | us | ) |
This function execute long delay function.
[in] | us | Delay time. |
Use the SysTick to generate the long delay time and the UNIT is in us. The SysTick clock source is from HCLK, i.e the same as system core clock. User can use SystemCoreClockUpdate() to calculate CyclesPerUs automatically before using this function.
uint32_t CLK_WaitClockReady | ( | uint32_t | u32ClkMask | ) |
This function check selected clock source status.
[in] | u32ClkMask | is selected clock source. Including : |
0 | clock is not stable |
1 | clock is stable |
To wait for clock ready by specified clock source stable flag or timeout (~500ms)