PSoC 4 Peripheral Driver Library - Alpha

General Description

Functions

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

Function Documentation

◆ Cy_SysClk_ClkSysSetDivider()

__STATIC_INLINE void Cy_SysClk_ClkSysSetDivider ( cy_en_sysclk_dividers_t  divider)

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

The source of this divider is ClkHf.

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

◆ Cy_SysClk_ClkSysGetDivider()

__STATIC_INLINE cy_en_sysclk_dividers_t Cy_SysClk_ClkSysGetDivider ( void  )

Returns the ClkSys clock divider.

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

◆ Cy_SysClk_ClkSysGetFrequency()

__STATIC_INLINE uint32_t Cy_SysClk_ClkSysGetFrequency ( void  )

Reports the frequency of the fast clock.

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