Functions

group group_sysclk_ext_funcs

Functions

void Cy_SysClk_ExtClkSetFrequency(uint32_t freq)

Sets the signal frequency of the External Clock Source (EXTCLK) into the internal storage to be used in Cy_SysClk_ClkHfGetFrequency.

Function Usage

    /* Scenario: External precision 5MHz clock is needed to source clock path 1. */

    /* Configure the pin P0_5 to be an external clock input */
    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT0, 5, CY_GPIO_DM_HIGHZ, 0x00u, P0_5_SRSS_EXT_CLK);
    /* Set the EXTCLK frequency to 5MHz */
    Cy_SysClk_ExtClkSetFrequency(5000000UL);
    /* Set the EXTCLK as the source for clock path 1 */
    (void)Cy_SysClk_ClkPathSetSource(1UL, CY_SYSCLK_CLKPATH_IN_EXT);

    /* In case if there is a need to get the EXT CLK frequency */
    uint32_t extClkFreq = Cy_SysClk_ExtClkGetFrequency();

Parameters
  • freq: The frequency of the External Clock Source.

uint32_t Cy_SysClk_ExtClkGetFrequency(void)

Returns the frequency of the External Clock Source (EXTCLK) from the internal storage.

Return

The frequency of the External Clock Source.

Function Usage

    /* Scenario: External precision 5MHz clock is needed to source clock path 1. */

    /* Configure the pin P0_5 to be an external clock input */
    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT0, 5, CY_GPIO_DM_HIGHZ, 0x00u, P0_5_SRSS_EXT_CLK);
    /* Set the EXTCLK frequency to 5MHz */
    Cy_SysClk_ExtClkSetFrequency(5000000UL);
    /* Set the EXTCLK as the source for clock path 1 */
    (void)Cy_SysClk_ClkPathSetSource(1UL, CY_SYSCLK_CLKPATH_IN_EXT);

    /* In case if there is a need to get the EXT CLK frequency */
    uint32_t extClkFreq = Cy_SysClk_ExtClkGetFrequency();