![]() |
Nano102_112 Series BSP
V3.03.002
The Board Support Package for Nano102_112 Series
|
Functions | |
void | CLK_DisableCKO (void) |
This function disable frequency output function. More... | |
void | CLK_DisableCKO0 (void) |
This function disable frequency output function. More... | |
void | CLK_DisableCKO1 (void) |
This function disable frequency output function(1). More... | |
void | CLK_EnableCKO (uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider. More... | |
void | CLK_EnableCKO0 (uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider. More... | |
void | CLK_EnableCKO1 (uint32_t u32ClkSrc, uint32_t u32ClkDiv, uint32_t u32ClkDivBy1En) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider. (1) More... | |
void | CLK_PowerDown (void) |
This function let system enter to Power-down mode. More... | |
void | CLK_Idle (void) |
This function let system enter to Idle mode. More... | |
uint32_t | CLK_GetHXTFreq (void) |
This function get external high frequency crystal frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_GetLXTFreq (void) |
This function get external low frequency crystal frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_GetHCLKFreq (void) |
This function get HCLK frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_GetPCLKFreq (void) |
This function get PCLK frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_GetCPUFreq (void) |
This function get CPU frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_GetPLLClockFreq (void) |
This function get PLL frequency. The frequency unit is Hz. More... | |
uint32_t | CLK_SetCoreClock (uint32_t u32Hclk) |
This function set HCLK frequency. The frequency unit is Hz. The range of u32Hclk is 16 ~ 32 MHz. 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) |
void | CLK_EnableXtalRC (uint32_t u32ClkMask) |
This function enable clock source. More... | |
void | CLK_DisableXtalRC (uint32_t u32ClkMask) |
This function disable clock source. More... | |
void | CLK_EnableModuleClock (uint32_t u32ModuleIdx) |
This function enable module clock. More... | |
void | CLK_DisableModuleClock (uint32_t u32ModuleIdx) |
This function disable module clock. More... | |
uint32_t | CLK_EnablePLL (uint32_t u32PllClkSrc, uint32_t u32PllFreq) |
This function set PLL frequency. More... | |
void | CLK_DisablePLL (void) |
This function disable PLL. More... | |
void | CLK_SysTickDelay (uint32_t us) |
This function execute delay function. More... | |
void | CLK_EnableSysTick (uint32_t u32ClkSrc, uint32_t u32Count) |
Enable System Tick counter. More... | |
void | CLK_DisableSysTick (void) |
Disable System Tick counter. More... | |
uint32_t | CLK_WaitClockReady (uint32_t u32ClkMask) |
This function check selected clock source status. More... | |
void CLK_DisableCKO | ( | void | ) |
void CLK_DisableCKO0 | ( | void | ) |
void CLK_DisableCKO1 | ( | void | ) |
void CLK_DisableModuleClock | ( | uint32_t | u32ModuleIdx | ) |
This function disable module clock.
void CLK_DisablePLL | ( | void | ) |
void CLK_DisableSysTick | ( | void | ) |
void CLK_DisableXtalRC | ( | uint32_t | u32ClkMask | ) |
This function disable clock source.
u32ClkMask | is clock source mask. Including: |
void CLK_EnableCKO | ( | uint32_t | u32ClkSrc, |
uint32_t | u32ClkDiv, | ||
uint32_t | u32ClkDivBy1En | ||
) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider.
[in] | u32ClkSrc | is frequency divider function clock source |
[in] | u32ClkDiv | is divider output frequency selection. |
[in] | u32ClkDivBy1En | is frequency divided by one enable. |
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_EnableCKO0 | ( | uint32_t | u32ClkSrc, |
uint32_t | u32ClkDiv, | ||
uint32_t | u32ClkDivBy1En | ||
) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider.
u32ClkSrc | is frequency divider function clock source |
u32ClkDiv | is divider output frequency selection. |
u32ClkDivBy1En | is frequency divided by one enable. |
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_EnableCKO1 | ( | uint32_t | u32ClkSrc, |
uint32_t | u32ClkDiv, | ||
uint32_t | u32ClkDivBy1En | ||
) |
This function enable frequency divider module clock, enable frequency divider clock function and configure frequency divider. (1)
[in] | u32ClkSrc | is frequency divider function clock source |
[in] | u32ClkDiv | is system reset source |
[in] | u32ClkDivBy1En | is frequency divided by one enable. |
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_EnableModuleClock | ( | uint32_t | u32ModuleIdx | ) |
This function enable module clock.
uint32_t CLK_EnablePLL | ( | uint32_t | u32PllClkSrc, |
uint32_t | u32PllFreq | ||
) |
This function set PLL frequency.
[in] | u32PllClkSrc | is PLL clock source. Including : |
[in] | u32PllFreq | is PLL frequency |
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 should be 0x1~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 | ) |
This function enable clock source.
[in] | u32ClkMask | is clock source mask. Including: |
uint32_t CLK_GetCPUFreq | ( | void | ) |
uint32_t CLK_GetHCLKFreq | ( | void | ) |
uint32_t CLK_GetHXTFreq | ( | void | ) |
uint32_t CLK_GetLXTFreq | ( | void | ) |
uint32_t CLK_GetPCLKFreq | ( | void | ) |
uint32_t CLK_GetPLLClockFreq | ( | void | ) |
void CLK_Idle | ( | void | ) |
void CLK_PowerDown | ( | void | ) |
uint32_t CLK_SetCoreClock | ( | uint32_t | u32Hclk | ) |
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 : |
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_SetSysTickClockSrc | ( | uint32_t | u32ClkSrc | ) |
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: 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.
uint32_t CLK_WaitClockReady | ( | uint32_t | u32ClkMask | ) |
This function check selected clock source status.
[in] | u32ClkMask | is selected clock source. Including |
To wait for clock ready by specified CLKSTATUS bit or timeout (~5ms)