MTB CAT1 Peripheral driver library

General Description

Functions

void Cy_SysClk_ClkLfSetSource (cy_en_clklf_in_sources_t source)
 Sets the source for the low frequency clock(clkLf). More...
 
cy_en_clklf_in_sources_t Cy_SysClk_ClkLfGetSource (void)
 Reports the source for the low frequency clock (clkLf). More...
 
uint32_t Cy_SysClk_ClkLfGetFrequency (void)
 Reports the frequency of the clklf. More...
 

Function Documentation

◆ Cy_SysClk_ClkLfSetSource()

void Cy_SysClk_ClkLfSetSource ( cy_en_clklf_in_sources_t  source)

Sets the source for the low frequency clock(clkLf).

Parameters
sourcecy_en_clklf_in_sources_t
Note
The watchdog timer (WDT) must be unlocked before calling this function.
It takes four cycles of the originally selected clock to switch away from it. Do not disable the original clock during this time.
Function Usage
/* Scenario: LFCLK source needs to be updated to the ILO. */
{
}

◆ Cy_SysClk_ClkLfGetSource()

cy_en_clklf_in_sources_t Cy_SysClk_ClkLfGetSource ( void  )

Reports the source for the low frequency clock (clkLf).

Returns
cy_en_clklf_in_sources_t
Function Usage
/* Scenario: LFCLK source needs to be updated to the ILO. */
{
}

◆ Cy_SysClk_ClkLfGetFrequency()

uint32_t Cy_SysClk_ClkLfGetFrequency ( void  )

Reports the frequency of the clklf.

Returns
The frequency, in Hz.
Function Usage
/* Scenario: Generate clklf csv using the below lfConfig, csvConfig configuration.*/
bool manualConfig = 1UL;
/* Configure faults using sysFault API */
/* CSV Config. */
if (manualConfig)
{
cy_stc_clklf_csv_manual_config_t csvConfig = {198, 195, 205, 208}; // Start time, lower limit, upper limit, period.
Cy_SysClk_ClkLfCsvManualConfigure(4 , &csvConfig); // ref clock.
Cy_SysClk_ClkLfCsvEnable(); // Enable clklf csv
}
else
{
// Auto config
Cy_SysClk_ClkLfCsvConfigure(4, 1); // Accuracy 1%
Cy_SysClk_ClkLfCsvEnable(); // Enable clklf csv
}
if(Cy_SysClk_IsClkLfCsvEnabled())
Cy_SysClk_ClkLfCsvDisable();