/******************************************************************************* * Function Name: Timer_1_SaveConfig ******************************************************************************** * * Summary: * Save the current user configuration * * Parameters: * void * * Return: * void * * Global variables: * Timer_1_backup: Variables of this global structure are modified to * store the values of non retention configuration registers when Sleep() API is * called. * *******************************************************************************/ void Timer_1_SaveConfig(void) { #if (!Timer_1_UsingFixedFunction) /* Backup the UDB non-rentention registers for CY_UDB_V0 */ #if (CY_UDB_V0) Timer_1_backup.TimerUdb = Timer_1_ReadCounter(); Timer_1_backup.TimerPeriod = Timer_1_ReadPeriod(); Timer_1_backup.InterruptMaskValue = Timer_1_STATUS_MASK; #if (Timer_1_UsingHWCaptureCounter) Timer_1_backup.TimerCaptureCounter = Timer_1_ReadCaptureCount(); #endif /* Backup the UDB non-rentention register capture counter for CY_UDB_V0 */ #endif /* Backup the UDB non-rentention registers for CY_UDB_V0 */ #if (CY_UDB_V1) Timer_1_backup.TimerUdb = Timer_1_ReadCounter(); Timer_1_backup.InterruptMaskValue = Timer_1_STATUS_MASK; #if (Timer_1_UsingHWCaptureCounter) Timer_1_backup.TimerCaptureCounter = Timer_1_ReadCaptureCount(); #endif /* Back Up capture counter register */ #endif /* Backup non retention registers, interrupt mask and capture counter for CY_UDB_V1 */ #if(!Timer_1_ControlRegRemoved) Timer_1_backup.TimerControlRegister = Timer_1_ReadControlRegister(); #endif /* Backup the enable state of the Timer component */ #endif /* Backup non retention registers in UDB implementation. All fixed function registers are retention */ }
/******************************************************************************* * Function Name: Timer_1_SaveConfig ******************************************************************************** * * Summary: * Save the current user configuration * * Parameters: * void * * Return: * void * * Global variables: * Timer_1_backup: Variables of this global structure are modified to * store the values of non retention configuration registers when Sleep() API is * called. * *******************************************************************************/ void Timer_1_SaveConfig(void) { #if (!Timer_1_UsingFixedFunction) Timer_1_backup.TimerUdb = Timer_1_ReadCounter(); Timer_1_backup.InterruptMaskValue = Timer_1_STATUS_MASK; #if (Timer_1_UsingHWCaptureCounter) Timer_1_backup.TimerCaptureCounter = Timer_1_ReadCaptureCount(); #endif /* Back Up capture counter register */ #if(!Timer_1_UDB_CONTROL_REG_REMOVED) Timer_1_backup.TimerControlRegister = Timer_1_ReadControlRegister(); #endif /* Backup the enable state of the Timer component */ #endif /* Backup non retention registers in UDB implementation. All fixed function registers are retention */ }