/* Initializes the DAC peripheral according to the specified parameters in the DAC_InitStruct.  */
void DAC_Init(emDACCH_TypeDef channel, DAC_InitTypeDef *init_struct)
/* Initializes the DAC peripheral according to the specified parameters in the DAC_InitStruct.  */
void DAC_Init(emDACCH_TypeDef channel, DAC_InitTypeDef *init_struct)
{
    DAC->CR &= ~((DAC_CR_BOFF1 | DAC_CR_TEN1 | DAC_CR_TSEL1 | DAC_CR_WAVE1 | DAC_CR_MAMP1) << channel);
    DAC->CR |= (((u32)(init_struct->DAC_Trigger) | (u32)(init_struct->DAC_WaveGeneration) |
                 (u32)(init_struct->DAC_LFSRUnmask_TriangleAmplitude) | (u32)(init_struct->DAC_OutputBuffer))
                << channel);
}