Functions

group group_sysclk_ilo_funcs

Functions

void Cy_SysClk_IloEnable(void)

Enables the ILO.

note

The watchdog timer (WDT) must be unlocked before calling this function.

Function Usage

    /* Scenario: ILO needs to source the LFCLK. The watchdog timer (WDT) is unlocked
                 and all peripherals clocked using the LFCLK are disabled. */

    /* Enable the ILO */
    Cy_SysClk_IloEnable();

    /* Set the LFCLK source to the ILO */
    Cy_SysClk_ClkLfSetSource(CY_SYSCLK_CLKLF_IN_ILO);

bool Cy_SysClk_IloIsEnabled(void)

Reports the Enabled/Disabled status of the ILO.

note

This API is available for CAT1A devices.

Return

Boolean status of ILO: true - Enabled, false - Disabled.

Function Usage

    /* Scenario: LFCLK needs to be sourced by the PILO instead of the ILO. All
                 peripherals clocked by the LFCLK are disabled and the Watchdog
                 timer (WDT) is unlocked. */

    if (Cy_SysClk_IloIsEnabled())
    {
        /* Disable the ILO */
        Cy_SysClk_IloDisable();

        /* Enable the PILO */
        Cy_SysClk_PiloEnable();

        /* Set the LFCLK source to the PILO */
        Cy_SysClk_ClkLfSetSource(CY_SYSCLK_CLKLF_IN_PILO);
    }

cy_en_sysclk_status_t Cy_SysClk_IloDisable(void)

Disables the ILO.

ILO can’t be disabled if WDT is enabled.

note

The watchdog timer (WDT) must be unlocked before calling this function. Do not call this function if the WDT is enabled, because the WDT is clocked by the ILO.

Return

Error / status code:

CY_SYSCLK_SUCCESS - ILO successfully disabled

CY_SYSCLK_INVALID_STATE - Cannot disable the ILO if the WDT is enabled. CY_SYSCLK_INVALID_STATE - ECO already enabled For the PSoC 64 devices there are possible situations when function returns the PRA error status code. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to

cy_en_pra_status_t for more details.

Function Usage

    /* Scenario: LFCLK needs to be sourced by the PILO instead of the ILO. All
                 peripherals clocked by the LFCLK are disabled and the Watchdog
                 timer (WDT) is unlocked. */

    if (Cy_SysClk_IloIsEnabled())
    {
        /* Disable the ILO */
        Cy_SysClk_IloDisable();

        /* Enable the PILO */
        Cy_SysClk_PiloEnable();

        /* Set the LFCLK source to the PILO */
        Cy_SysClk_ClkLfSetSource(CY_SYSCLK_CLKLF_IN_PILO);
    }

void Cy_SysClk_IloHibernateOn(bool on)

Controls whether the ILO stays on during a hibernate, or through an XRES or brown-out detect (BOD) event.

note

Writes to the register/bit are ignored if the watchdog (WDT) is locked.

Function Usage

    /* Scenario: The ILO needs to clock the Real-Time-clock (RTC) during chip
                 hibernate, hard reset (XRES) and Brown-out detect (BOD) events.
                 All peripherals clocked by the LFCLK are disabled and the
                 Watchdog timer (WDT) is unlocked. */

    /* Enable ILO operation during chip hibernate mode */
    Cy_SysClk_IloHibernateOn(true);

    /* Enable the ILO */
    Cy_SysClk_IloEnable();

    /* Set the LFCLK source to the ILO */
    Cy_SysClk_ClkLfSetSource(CY_SYSCLK_CLKLF_IN_ILO);

Parameters
  • on: true = ILO stays on during hibernate or across XRES/BOD.

    false = ILO turns off for hibernate or XRES/BOD.