PSoC 6 Peripheral Driver Library

General Description

Functions

__STATIC_INLINE void Cy_SysClk_ClkTimerSetSource (cy_en_clktimer_in_sources_t source)
 Sets the source for the timer clock (clk_timer). More...
 
__STATIC_INLINE cy_en_clktimer_in_sources_t Cy_SysClk_ClkTimerGetSource (void)
 Reports the source for the timer clock (clk_timer). More...
 
__STATIC_INLINE void Cy_SysClk_ClkTimerSetDivider (uint8_t divider)
 Sets the divider for the timer clock (clk_timer). More...
 
__STATIC_INLINE uint8_t Cy_SysClk_ClkTimerGetDivider (void)
 Reports the divider value for the timer clock (clk_timer). More...
 
__STATIC_INLINE void Cy_SysClk_ClkTimerEnable (void)
 Enables the timer clock (clk_timer). More...
 
__STATIC_INLINE bool Cy_SysClk_ClkTimerIsEnabled (void)
 Reports the Enabled/Disabled status of the Timer. More...
 
__STATIC_INLINE void Cy_SysClk_ClkTimerDisable (void)
 Disables the timer clock (clk_timer). More...
 
uint32_t Cy_SysClk_ClkTimerGetFrequency (void)
 Reports the frequency of the timer clock (clk_timer). More...
 

Function Documentation

◆ Cy_SysClk_ClkTimerSetSource()

__STATIC_INLINE void Cy_SysClk_ClkTimerSetSource ( cy_en_clktimer_in_sources_t  source)

Sets the source for the timer clock (clk_timer).

The timer clock can be used as a source for SYSTICK as an alternate clock and one or more of the energy profiler counters.

Parameters
sourcecy_en_clktimer_in_sources_t
Function Usage
/* Scenario: The timer clock source needs to be updated to HFCLK0. */
{
}

◆ Cy_SysClk_ClkTimerGetSource()

__STATIC_INLINE cy_en_clktimer_in_sources_t Cy_SysClk_ClkTimerGetSource ( void  )

Reports the source for the timer clock (clk_timer).

Returns
cy_en_clktimer_in_sources_t
Function Usage
/* Scenario: The timer clock source needs to be updated to HFCLK0. */
{
}

◆ Cy_SysClk_ClkTimerSetDivider()

__STATIC_INLINE void Cy_SysClk_ClkTimerSetDivider ( uint8_t  divider)

Sets the divider for the timer clock (clk_timer).

Parameters
dividerDivider value; valid range is 0 to 255. Divides the selected source (Cy_SysClk_ClkTimerSetSource) by the (value + 1).
Note
Do not change the divider value while the timer clock is enabled.
Function Usage
/* Scenario: The timer divider needs to be updated to 64. */
{
Cy_SysClk_ClkTimerSetDivider(63u); /* divider = value + 1 */
}

◆ Cy_SysClk_ClkTimerGetDivider()

__STATIC_INLINE uint8_t Cy_SysClk_ClkTimerGetDivider ( void  )

Reports the divider value for the timer clock (clk_timer).

Returns
The divider value
Function Usage
/* Scenario: The timer divider needs to be updated to 64. */
{
Cy_SysClk_ClkTimerSetDivider(63u); /* divider = value + 1 */
}

◆ Cy_SysClk_ClkTimerEnable()

__STATIC_INLINE void Cy_SysClk_ClkTimerEnable ( void  )

Enables the timer clock (clk_timer).

The timer clock can be used as a source for SYSTICK and one or more of the energy profiler counters.

Function Usage
/* Scenario: Timer clock needs to operate at HFCLK/32. */
Cy_SysClk_ClkTimerSetDivider(3u); /* divider = value + 1 */
/* Use the Timer clock as a source for the alternative ARM SysTick clock or
for an Energy Profile counter clock. */
/* In case if there is a need to get the timer clock frequency */
uint32_t timerClkFreq = Cy_SysClk_ClkTimerGetFrequency();

◆ Cy_SysClk_ClkTimerIsEnabled()

__STATIC_INLINE bool Cy_SysClk_ClkTimerIsEnabled ( void  )

Reports the Enabled/Disabled status of the Timer.

Returns
Boolean status of Timer: true - Enabled, false - Disabled.
Function Usage
/* Scenario: Timer clock is no longer required and needs to be disabled.
All peripherals clocked using this source are disabled. */
{
}

◆ Cy_SysClk_ClkTimerDisable()

__STATIC_INLINE void Cy_SysClk_ClkTimerDisable ( void  )

Disables the timer clock (clk_timer).

Function Usage
/* Scenario: Timer clock is no longer required and needs to be disabled.
All peripherals clocked using this source are disabled. */
{
}

◆ Cy_SysClk_ClkTimerGetFrequency()

uint32_t Cy_SysClk_ClkTimerGetFrequency ( void  )

Reports the frequency of the timer clock (clk_timer).

Note
If the the timer clock is not enabled - a zero frequency is reported.
Function Usage
/* Scenario: Timer clock needs to operate at HFCLK/32. */
Cy_SysClk_ClkTimerSetDivider(3u); /* divider = value + 1 */
/* Use the Timer clock as a source for the alternative ARM SysTick clock or
for an Energy Profile counter clock. */
/* In case if there is a need to get the timer clock frequency */
uint32_t timerClkFreq = Cy_SysClk_ClkTimerGetFrequency();