Esempio n. 1
0
/*******************************************************************************
* Function Name: PWM_2_Sleep
********************************************************************************
*
* Summary:
*  Stops the component operation and saves the user configuration.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void PWM_2_Sleep(void)
{
    if(0u != (PWM_2_BLOCK_CONTROL_REG & PWM_2_MASK))
    {
        PWM_2_backup.enableState = 1u;
    }
    else
    {
        PWM_2_backup.enableState = 0u;
    }

    PWM_2_Stop();
    PWM_2_SaveConfig();
}
Esempio n. 2
0
/*******************************************************************************
* Function Name: PWM_2_Sleep
********************************************************************************
*
* Summary:
*  Disables block's operation and saves the user configuration. Should be called
*  just prior to entering sleep.
*
* Parameters:
*  None
*
* Return:
*  None
*
* Global variables:
*  PWM_2_backup.PWMEnableState:  Is modified depending on the enable
*  state of the block before entering sleep mode.
*
*******************************************************************************/
void PWM_2_Sleep(void) 
{
    #if(PWM_2_UseControl)
        if(PWM_2_CTRL_ENABLE == (PWM_2_CONTROL & PWM_2_CTRL_ENABLE))
        {
            /*Component is enabled */
            PWM_2_backup.PWMEnableState = 1u;
        }
        else
        {
            /* Component is disabled */
            PWM_2_backup.PWMEnableState = 0u;
        }
    #endif /* (PWM_2_UseControl) */

    /* Stop component */
    PWM_2_Stop();

    /* Save registers configuration */
    PWM_2_SaveConfig();
}