MTB CAT1 Peripheral driver library

General Description

Functions

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

Function Documentation

◆ Cy_SysClk_ClkPeriSetDivider()

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.
This API is available for CAT1A & CAT1C devices.
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()

uint32_t Cy_SysClk_ClkPeriGetFrequency ( void  )

Reports the frequency of the peri clock.

Returns
The frequency, in Hz.
Note
This API is available for CAT1A & CAT1C devices.
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()

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.
Note
This API is available for CAT1A & CAT1C devices.
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();