Esempio n. 1
0
/*******************************************************************************
* Function Name: VDAC8_1_Wakeup
********************************************************************************
*
* Summary:
*  Restores and enables the user configuration
*  
* Parameters:  
*  void
*
* Return: 
*  void
*
* Global variables:
*  VDAC8_1_backup.enableState:  Is used to restore the enable state of 
*  block on wakeup from sleep mode.
*
* Reenrancy: 
*  Yes
*
*******************************************************************************/
void VDAC8_1_Wakeup(void) 
{
    VDAC8_1_RestoreConfig();
    
    if(VDAC8_1_backup.enableState == 1u)
    {
        /* Enable VDAC8's operation */
        VDAC8_1_Enable();

        /* Restore the data register */
        VDAC8_1_SetValue(VDAC8_1_Data);
    } /* Do nothing if VDAC8 was disabled before */    
}
/*******************************************************************************
* Function Name: VDAC8_1_Start
********************************************************************************
*
* Summary:
*  The start function initializes the voltage DAC with the default values, 
*  and sets the power to the given level.  A power level of 0, is the same as
*  executing the stop function.
*
* Parameters:
*  Power: Sets power level between off (0) and (3) high power
*
* Return:
*  void 
*
* Global variables:
*  VDAC8_1_initVar: Is modified when this function is called for the 
*  first time. Is used to ensure that initialization happens only once.
*
*******************************************************************************/
void VDAC8_1_Start(void)  
{
    /* Hardware initiazation only needs to occure the first time */
    if(VDAC8_1_initVar == 0u)
    { 
        VDAC8_1_Init();
        VDAC8_1_initVar = 1u;
    }

    /* Enable power to DAC */
    VDAC8_1_Enable();

    /* Set default value */
    VDAC8_1_SetValue(VDAC8_1_DEFAULT_DATA); 
}