MTB CAT1 Peripheral driver library

General Description

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. More...
 
uint32_t Cy_SysClk_ExtClkGetFrequency (void)
 Returns the frequency of the External Clock Source (EXTCLK) from the internal storage. More...
 

Function Documentation

◆ Cy_SysClk_ExtClkSetFrequency()

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.

Parameters
freqThe 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 */
#if defined(CYT2BL5CAS) || defined(CYT2B75CAS)
en_hsiom_sel_t pin_func = P21_2_SRSS_EXT_CLK;
#else
en_hsiom_sel_t pin_func = P0_5_SRSS_EXT_CLK;
#endif
(void)Cy_GPIO_Pin_FastInit(GPIO_PRT0, 5, CY_GPIO_DM_HIGHZ, 0x00u, pin_func);
/* Set the EXTCLK frequency to 5MHz */
/* Set the EXTCLK as the source for clock path 1 */
/* In case if there is a need to get the EXT CLK frequency */
uint32_t extClkFreq = Cy_SysClk_ExtClkGetFrequency();

◆ Cy_SysClk_ExtClkGetFrequency()

uint32_t Cy_SysClk_ExtClkGetFrequency ( void  )

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

Returns
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 */
#if defined(CYT2BL5CAS) || defined(CYT2B75CAS)
en_hsiom_sel_t pin_func = P21_2_SRSS_EXT_CLK;
#else
en_hsiom_sel_t pin_func = P0_5_SRSS_EXT_CLK;
#endif
(void)Cy_GPIO_Pin_FastInit(GPIO_PRT0, 5, CY_GPIO_DM_HIGHZ, 0x00u, pin_func);
/* Set the EXTCLK frequency to 5MHz */
/* Set the EXTCLK as the source for clock path 1 */
/* In case if there is a need to get the EXT CLK frequency */
uint32_t extClkFreq = Cy_SysClk_ExtClkGetFrequency();