예제 #1
0
/*******************************************************************************
* Function Name:   WaveDAC8_1_BuffAmp_Start
********************************************************************************
*
* Summary:
*  The start function initializes the Analog Buffer with the default values and 
*  sets the power to the given level. A power level of 0, is same as 
*  executing the stop function.
*
* Parameters:
*  void
*
* Return:
*  void
*
* Global variables:
*  WaveDAC8_1_BuffAmp_initVar: Used to check the initial configuration, modified 
*  when this function is called for the first time.
*
*******************************************************************************/
void WaveDAC8_1_BuffAmp_Start(void) 
{
    if(WaveDAC8_1_BuffAmp_initVar == 0u)
    {
        WaveDAC8_1_BuffAmp_initVar = 1u;
        WaveDAC8_1_BuffAmp_Init();
    }

    WaveDAC8_1_BuffAmp_Enable();
}
예제 #2
0
/*******************************************************************************
* Function Name: WaveDAC8_1_Enable
********************************************************************************
*
* Summary:
*  Enables the DAC block and DMA operation.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void WaveDAC8_1_Enable(void)
{
    WaveDAC8_1_VDAC8_Enable();

#if(WaveDAC8_1_OUT_MODE == WaveDAC8_1_BUFFER_MODE)
    WaveDAC8_1_BuffAmp_Enable();
#endif /* WaveDAC8_1_OUT_MODE == WaveDAC8_1_BUFFER_MODE */

    /*
    * Enable the channel. It is configured to remember the TD value so that
    * it can be restored from the place where it has been stopped.
    */
    (void)CyDmaChEnable(WaveDAC8_1_Wave1Chan, 1u);
    (void)CyDmaChEnable(WaveDAC8_1_Wave2Chan, 1u);

    /* set the initial value */
    WaveDAC8_1_SetValue(0u);

#if(WaveDAC8_1_CLOCK_SRC == WaveDAC8_1_CLOCK_INT)
    WaveDAC8_1_DacClk_Start();
#endif /* WaveDAC8_1_CLOCK_SRC == WaveDAC8_1_CLOCK_INT */
}