CAT2 Peripheral Driver Library

Functions

__STATIC_INLINE void Cy_SysClk_ClkSysSetDivider (cy_en_sysclk_dividers_t divider)
 Sets the SYSCLK clock divider, which sources the main processor. More...
 
__STATIC_INLINE cy_en_sysclk_dividers_t Cy_SysClk_ClkSysGetDivider (void)
 Returns the SYSCLK clock divider. More...
 
__STATIC_INLINE uint32_t Cy_SysClk_ClkSysGetFrequency (void)
 Reports the frequency of the SYSCLK clock. More...
 

Detailed Description

Function Documentation

◆ Cy_SysClk_ClkSysSetDivider()

__STATIC_INLINE void Cy_SysClk_ClkSysSetDivider ( cy_en_sysclk_dividers_t  divider)

Sets the SYSCLK clock divider, which sources the main processor.

The source of this divider is HFCLK.

Parameters
divider- SYSCLK divider value cy_en_sysclk_dividers_t.
Note
Call SystemCoreClockUpdate after this function calling.
Call Cy_SysLib_SetWaitStates before calling this function if SYSCLK frequency is increasing.
Call Cy_SysLib_SetWaitStates after calling this function if SYSCLK frequency is decreasing.
Function Usage
/* Scenario: The SYSCLK should be configured to divide by 4. */
{
/* Set the System clock divider to 4 */
}
/* Get the resulting SYSCLK output frequency */
uint32_t sysFreq = Cy_SysClk_ClkSysGetFrequency();

◆ Cy_SysClk_ClkSysGetDivider()

__STATIC_INLINE cy_en_sysclk_dividers_t Cy_SysClk_ClkSysGetDivider ( void  )

Returns the SYSCLK clock divider.

Returns
The SYSCLK divider value, cy_en_sysclk_dividers_t :
CY_SYSCLK_NO_DIV - don't divide.
CY_SYSCLK_DIV_2 - divide by 2
CY_SYSCLK_DIV_4 - divide by 4
CY_SYSCLK_DIV_8 - divide by 8
Function Usage
/* Scenario: The SYSCLK should be configured to divide by 4. */
{
/* Set the System clock divider to 4 */
}
/* Get the resulting SYSCLK output frequency */
uint32_t sysFreq = Cy_SysClk_ClkSysGetFrequency();

◆ Cy_SysClk_ClkSysGetFrequency()

__STATIC_INLINE uint32_t Cy_SysClk_ClkSysGetFrequency ( void  )

Reports the frequency of the SYSCLK clock.

Returns
The frequency, in Hz.
Function Usage
/* Scenario: The SYSCLK should be configured to divide by 4. */
{
/* Set the System clock divider to 4 */
}
/* Get the resulting SYSCLK output frequency */
uint32_t sysFreq = Cy_SysClk_ClkSysGetFrequency();