CAT2 Peripheral Driver Library

Functions

cy_en_sysclk_status_t Cy_SysClk_ClkLfSetSource (cy_en_sysclk_clklf_src_t source)
 Selects the source of the LFCLK. More...
 
uint32_t Cy_SysClk_ClkLfGetFrequency (void)
 Reports the frequency of the LFCLK. More...
 
__STATIC_INLINE cy_en_sysclk_clklf_src_t Cy_SysClk_ClkLfGetSource (void)
 Reports the source of the LFCLK. More...
 

Detailed Description

Function Documentation

◆ Cy_SysClk_ClkLfSetSource()

cy_en_sysclk_status_t Cy_SysClk_ClkLfSetSource ( cy_en_sysclk_clklf_src_t  source)

Selects the source of the LFCLK.

Parameters
sourcecy_en_sysclk_clklf_src_t
Returns
Error / status code cy_en_sysclk_status_t :
CY_SYSCLK_SUCCESS - the source is successfully set;
CY_SYSCLK_INVALID_STATE - the selected clock source is not enabled or does not working;
CY_SYSCLK_BAD_PARAM - the source parameter is invalid.
Note
Applicable to PSOC4 HVMS/PA only.
Warning
The Watchdog timer should be unlocked before set source of the LFCLK. Call the Cy_WDT_Unlock() API to unlock the WDT.
Note
It takes about (3 + 1) LF clock cycles of the new selected clock to switch away from the old clock to the new clock. Do not disable the original clock during this time.
If a clock source is disabled while selected, then the clock merely stops to all sources that receive it. In such a scenario, the disabled clock must be re-enabled, prior to switching FROM this clock source.
This function is not re-entrant.
Function Usage
/* The Watchdog timer should be unlocked before PILO being enabled. */
/* Enable the PILO */
/* Now switch the LFCLK source to PILO */
{
/* Insert error handling */
}

◆ Cy_SysClk_ClkLfGetFrequency()

uint32_t Cy_SysClk_ClkLfGetFrequency ( void  )

Reports the frequency of the LFCLK.

Returns
The frequency is in Hz units and equals 0 in case of an unknown frequency.
Note
The reported value may be zero, which indicates the frequency is unknown.
Applicable to PSOC4 HVMS/PA only.
Function Usage
uint32_t clkLfFreq = 0;
/* The Watchdog timer should be unlocked before PILO being enabled. */
/* Enable the PILO */
/* Enable the ILO */
/* Now switch the LFCLK source to PILO */
if (CY_SYSCLK_SUCCESS == retVal)
{
/* LFCLK clock frequency should match with PILO frequency */
}
/* Now switch the LFCLK source to ILO */
if (CY_SYSCLK_SUCCESS == retVal)
{
/* LFCLK clock frequency should match with ILO frequency */
}

◆ Cy_SysClk_ClkLfGetSource()

__STATIC_INLINE cy_en_sysclk_clklf_src_t Cy_SysClk_ClkLfGetSource ( void  )

Reports the source of the LFCLK.

Returns
cy_en_sysclk_clklf_src_t :
CY_SYSCLK_CLKLF_IN_ILO - ILO - Internal Low Frequency Oscillator.
CY_SYSCLK_CLKLF_IN_PILO - PILO - Precision Internal Low Frequency Oscillator.
Note
Only applicable for PSOC4 HVMS/PA.
Function Usage
/* The Watchdog timer should be unlocked before PILO being enabled. */
/* Enable the PILO */
/* Now switch the LFCLK source to PILO */
{
/* Insert error handling */
}