/******************************************************************************* * Function Name: PWM_2_Wakeup ******************************************************************************** * * Summary: * Restores the user configuration and restores the enable state. * * Parameters: * None * * Return: * None * *******************************************************************************/ void PWM_2_Wakeup(void) { PWM_2_RestoreConfig(); if(0u != PWM_2_backup.enableState) { PWM_2_Enable(); } }
/******************************************************************************* * Function Name: PWM_2_Start ******************************************************************************** * * Summary: * The start function initializes the pwm with the default values, the * enables the counter to begin counting. It does not enable interrupts, * the EnableInt command should be called if interrupt generation is required. * * Parameters: * None * * Return: * None * * Global variables: * PWM_2_initVar: Is modified when this function is called for the * first time. Is used to ensure that initialization happens only once. * *******************************************************************************/ void PWM_2_Start(void) { /* If not Initialized then initialize all required hardware and software */ if(PWM_2_initVar == 0u) { PWM_2_Init(); PWM_2_initVar = 1u; } PWM_2_Enable(); }
/******************************************************************************* * Function Name: PWM_2_Wakeup ******************************************************************************** * * Summary: * Restores and enables the user configuration. Should be called just after * awaking from sleep. * * Parameters: * None * * Return: * None * * Global variables: * PWM_2_backup.pwmEnable: Is used to restore the enable state of * block on wakeup from sleep mode. * *******************************************************************************/ void PWM_2_Wakeup(void) { /* Restore registers values */ PWM_2_RestoreConfig(); if(PWM_2_backup.PWMEnableState != 0u) { /* Enable component's operation */ PWM_2_Enable(); } /* Do nothing if component's block was disabled before */ }