/* DAC Channel Trigger Enable. 
Enable a digital to analog converter channel external trigger mode. This allows an external trigger to initiate register transfers from the buffer register to the DAC output register, followed by a DMA transfer to the buffer register if DMA is enabled. The trigger source must also be selected. */
void dac_trigger_enable(uint32_t dac, int channel)
/* DAC Channel Trigger Enable. 
Enable a digital to analog converter channel external trigger mode. This allows an external trigger to initiate register transfers from the buffer register to the DAC output register, followed by a DMA transfer to the buffer register if DMA is enabled. The trigger source must also be selected. */
void dac_trigger_enable(uint32_t dac, int channel)
{
	switch (channel) {
	case DAC_CHANNEL1:
		DAC_CR(dac) |= DAC_CR_TEN1;
		break;
	case DAC_CHANNEL2:
		DAC_CR(dac) |= DAC_CR_TEN2;
		break;
	case DAC_CHANNEL_BOTH:
		DAC_CR(dac) |= (DAC_CR_TEN1 | DAC_CR_TEN2);
		break;
	default:
		break;
	}
}