Application Note
25 of 80
002-26071 Rev. *B
2021-09-07
Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Configuration of the clock resources
Code Listing 15
AllClockConfiguration () function
static void AllClockConfiguration(void)
{
:
#ifdef LPECO_ENABLE
/***** LPECO setting ******/
{
Cy_SysClk_ClkBak_LPECO_SetLoadCap(CY_SYSCLK_BAK_LPECO_LCAP_5TO10PF);
Cy_SysClk_ClkBak_LPECO_SetFrequency(CY_SYSCLK_BAK_LPECO_FREQ_6TO8MHZ);
Cy_SysClk_ClkBak_LPECO_SetAmplitude(CY_SYSCLK_BAK_LPECO_AMP_MAX_1P35V);
Cy_SysClk_ClkBak_LPECO_Enable();
while(Cy_SysClk_ClkBak_LPECO_Ready() == false);
}
:
#endif
:
return;
}
Code Listing 16
Cy_SysClk_ClkBak_LPECO_SetLoadCap () function
__STATIC_INLINE void Cy_SysClk_ClkBak_LPECO_SetLoadCap(cy_en_clkbak_lpeco_loadcap_range_t capValue)
{
BACKUP->unLPECO_CTL.stcField.u2LPECO_CRANGE = capValue;
}
Code Listing 17
Cy_SysClk_ClkBak_LPECO_SetFrequency () function
__STATIC_INLINE void Cy_SysClk_ClkBak_LPECO_SetFrequency(cy_en_clkbak_lpeco_frequency_range_t freqValue)
{
BACKUP->unLPECO_CTL.stcField.u1LPECO_FRANGE = freqValue;
}
Code Listing 18
Cy_SysClk_ClkBak_LPECO_SetAmplitude () function
__STATIC_INLINE void Cy_SysClk_ClkBak_LPECO_SetAmplitude(cy_en_clkbak_lpeco_max_amplitude_t ampValue)
{
BACKUP->unLPECO_CTL.stcField.u1LPECO_AMP_SEL = ampValue;
}
Code Listing 19
Cy_SysClk_ClkBak_LPECO_Enable () function
__STATIC_INLINE void Cy_SysClk_ClkBak_LPECO_Enable(bool enable)
{
BACKUP->unLPECO_CTL.stcField.u1LPECO_EN = enable;
}
Code Listing 20
Cy_SysClk_ClkBak_LPECO_Ready () function
__STATIC_INLINE bool Cy_SysClk_ClkBak_LPECO_Ready(void)
{
return (BACKUP->unLPECO_STATUS.stcField.u1LPECO_READY);
}
:
(1) Configure the value to
BACKUP_LPECO_CTL. See
(2) Enable the LPECO. See
(3) Wait until the LPECO is available. See