/* Config the DAC peripheral according to the specified parameters in the configStruct.  */
void DAC_Config(uint32_t channel, DAC_ConfigStruct_T *configStruct)
/* Config the DAC peripheral according to the specified parameters in the configStruct.  */
void DAC_Config(uint32_t channel, DAC_ConfigStruct_T *configStruct)
{
    uint32_t tmp1 = 0, tmp2 = 0;
    tmp1 = DAC->CTRL;
    tmp1 &= ~(((uint32_t)0x00000FFE) << channel);
    tmp2 = (configStruct->trigger | configStruct->waveGeneration | configStruct->maskAmplitudeSelect | configStruct->outputBuffer);
    tmp1 |= tmp2 << channel;
    DAC->CTRL = tmp1;
}