예제 #1
0
/*******************************************************************************
* Function Name: WaveDAC8_1_Init
********************************************************************************
*
* Summary:
*  Initializes component with parameters set in the customizer.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void WaveDAC8_1_Init(void)
{
    WaveDAC8_1_VDAC8_Init();
    WaveDAC8_1_VDAC8_SetSpeed(WaveDAC8_1_HIGHSPEED);
    WaveDAC8_1_VDAC8_SetRange(WaveDAC8_1_DAC_RANGE);

#if(WaveDAC8_1_DAC_MODE == WaveDAC8_1_CURRENT_MODE)
    WaveDAC8_1_IDAC8_SetPolarity(WaveDAC8_1_DAC_POL);
#endif /* WaveDAC8_1_DAC_MODE == WaveDAC8_1_CURRENT_MODE */

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

    /* Get the TD Number for the DMA channel 1 and 2   */
    WaveDAC8_1_Wave1TD = CyDmaTdAllocate();
    WaveDAC8_1_Wave2TD = CyDmaTdAllocate();

    /* Initialize waveform pointers  */
    WaveDAC8_1_Wave1Setup(WaveDAC8_1_wave1, WaveDAC8_1_WAVE1_LENGTH) ;
    WaveDAC8_1_Wave2Setup(WaveDAC8_1_wave2, WaveDAC8_1_WAVE2_LENGTH) ;

    /* Initialize the internal clock if one present  */
#if defined(WaveDAC8_1_DacClk_PHASE)
    WaveDAC8_1_DacClk_SetPhase(WaveDAC8_1_CLK_PHASE_0nS);
#endif /* defined(WaveDAC8_1_DacClk_PHASE) */
}
예제 #2
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();
}