MTB CAT1 Peripheral driver library

General Description

Functions

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

Function Documentation

◆ Cy_SysClk_ClkTimerSetSource()

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
Note
This API is available for CAT1A (excluding TVIIBE) devices.
Function Usage
/* Scenario: The timer clock source needs to be updated to HFCLK0. */
{
}

◆ Cy_SysClk_ClkTimerGetSource()

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
Note
This API is available for CAT1A (excluding TVIIBE) devices.
Function Usage
/* Scenario: The timer clock source needs to be updated to HFCLK0. */
{
}

◆ Cy_SysClk_ClkTimerSetDivider()

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.
This API is available for CAT1A (excluding TVIIBE) devices.
Function Usage
/* Scenario: The timer divider needs to be updated to 64. */
{
Cy_SysClk_ClkTimerSetDivider(63u); /* divider = value + 1 */
}

◆ Cy_SysClk_ClkTimerGetDivider()

uint8_t Cy_SysClk_ClkTimerGetDivider ( void  )

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

Returns
The divider value
Note
This API is available for CAT1A (excluding TVIIBE) devices.
Function Usage
/* Scenario: The timer divider needs to be updated to 64. */
{
Cy_SysClk_ClkTimerSetDivider(63u); /* divider = value + 1 */
}

◆ Cy_SysClk_ClkTimerEnable()

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.

Note
This API is available for CAT1A (excluding TVIIBE) devices.
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_ClkTimerDisable()

void Cy_SysClk_ClkTimerDisable ( void  )

Disables the timer clock (clk_timer).

Note
This API is available for CAT1A (excluding TVIIBE) devices.
Function Usage
/* Scenario: Timer clock is no longer required and needs to be disabled.
All peripherals clocked using this source are disabled. */
{
}

◆ Cy_SysClk_ClkTimerIsEnabled()

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. */
{
}
Note
This API is available for CAT1A (excluding TVIIBE) devices.

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