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