PSoC 6 Peripheral Driver Library

General Description

Functions

__STATIC_INLINE void Cy_SysClk_ClkPeriSetDivider (uint8_t divider)
 Sets the clock divider for the peripheral clock tree. More...
 
__STATIC_INLINE uint8_t Cy_SysClk_ClkPeriGetDivider (void)
 Returns the clock divider of the peripheral (peri) clock. More...
 
__STATIC_INLINE uint32_t Cy_SysClk_ClkPeriGetFrequency (void)
 Reports the frequency of the peri clock. More...
 

Function Documentation

◆ Cy_SysClk_ClkPeriSetDivider()

__STATIC_INLINE void Cy_SysClk_ClkPeriSetDivider ( uint8_t  divider)

Sets the clock divider for the peripheral clock tree.

All peripheral clock dividers are sourced from this clock. Also the Cortex M0+ clock divider is sourced from this clock. The source of this divider is clkHf[0]

Parameters
dividerdivider value between 0 and 255 Causes integer division of (divider value + 1), or division by 1 to 256.
Note
Call SystemCoreClockUpdate after this function calling.
Function Usage
/* Scenario: HFCLK0 is configured and enabled. The Peri clock sourcing the
majority of peripherals must run at a frequency that is 1/2
of HFCLK0. */
{
}
/* Get the Peri clock output frequency */
uint32_t clkPerifreq = Cy_SysClk_ClkPeriGetFrequency();

◆ Cy_SysClk_ClkPeriGetDivider()

__STATIC_INLINE uint8_t Cy_SysClk_ClkPeriGetDivider ( void  )

Returns the clock divider of the peripheral (peri) clock.

Returns
The divider value. The integer division done is by (divider value + 1), or division by 1 to 256.
Function Usage
/* Scenario: HFCLK0 is configured and enabled. The Peri clock sourcing the
majority of peripherals must run at a frequency that is 1/2
of HFCLK0. */
{
}
/* Get the Peri clock output frequency */
uint32_t clkPerifreq = Cy_SysClk_ClkPeriGetFrequency();

◆ Cy_SysClk_ClkPeriGetFrequency()

__STATIC_INLINE uint32_t Cy_SysClk_ClkPeriGetFrequency ( void  )

Reports the frequency of the peri clock.

Returns
The frequency, in Hz.
Function Usage
/* Scenario: HFCLK0 is configured and enabled. The Peri clock sourcing the
majority of peripherals must run at a frequency that is 1/2
of HFCLK0. */
{
}
/* Get the Peri clock output frequency */
uint32_t clkPerifreq = Cy_SysClk_ClkPeriGetFrequency();