/******************************************************************************* * Function Name: ADC_SAR_Seq_1_SAR_Start ******************************************************************************** * * Summary: * This is the preferred method to begin component operation. * ADC_SAR_Seq_1_SAR_Start() sets the initVar variable, calls the * ADC_SAR_Seq_1_SAR_Init() function, and then calls the * ADC_SAR_Seq_1_SAR_Enable() function. * * Parameters: * None. * * Return: * None. * * Global variables: * The ADC_SAR_Seq_1_SAR_initVar variable is used to indicate when/if initial * configuration of this component has happened. The variable is initialized to * zero and set to 1 the first time ADC_Start() is called. This allows for * component Re-Start without re-initialization in all subsequent calls to the * ADC_SAR_Seq_1_SAR_Start() routine. * If re-initialization of the component is required the variable should be set * to zero before call of ADC_SAR_Seq_1_SAR_Start() routine, or the user may call * ADC_SAR_Seq_1_SAR_Init() and ADC_SAR_Seq_1_SAR_Enable() as done in the * ADC_SAR_Seq_1_SAR_Start() routine. * * Side Effect: * If the initVar variable is already set, this function only calls the * ADC_SAR_Seq_1_SAR_Enable() function. * *******************************************************************************/ void ADC_SAR_Seq_1_SAR_Start(void) { /* If not Initialized then initialize all required hardware and software */ if(ADC_SAR_Seq_1_SAR_initVar == 0u) { ADC_SAR_Seq_1_SAR_Init(); ADC_SAR_Seq_1_SAR_initVar = 1u; } ADC_SAR_Seq_1_SAR_Enable(); }
/******************************************************************************* * Function Name: ADC_SAR_Seq_1_SAR_Wakeup ******************************************************************************** * * Summary: * This is the preferred routine to restore the component to the state when * ADC_SAR_Seq_1_SAR_Sleep() was called. If the component was enabled before the * ADC_SAR_Seq_1_SAR_Sleep() function was called, the * ADC_SAR_Seq_1_SAR_Wakeup() function also re-enables the component. * * Parameters: * None. * * Return: * None. * * Global Variables: * ADC_SAR_Seq_1_SAR_backup - The structure field 'enableState' is used to * restore the enable state of block after wakeup from sleep mode. * *******************************************************************************/ void ADC_SAR_Seq_1_SAR_Wakeup(void) { if(ADC_SAR_Seq_1_SAR_backup.enableState != ADC_SAR_Seq_1_SAR_DISABLED) { ADC_SAR_Seq_1_SAR_Enable(); #if(ADC_SAR_Seq_1_SAR_DEFAULT_CONV_MODE != ADC_SAR_Seq_1_SAR__HARDWARE_TRIGGER) if((ADC_SAR_Seq_1_SAR_backup.enableState & ADC_SAR_Seq_1_SAR_STARTED) != 0u) { ADC_SAR_Seq_1_SAR_StartConvert(); } #endif /* End ADC_SAR_Seq_1_SAR_DEFAULT_CONV_MODE != ADC_SAR_Seq_1_SAR__HARDWARE_TRIGGER */ } }