/* Load DAC Dual Data Register. 
Loads the appropriate digital to analog converter dual data register with 12 or 8 bit data to be converted for both channels. This allows high bandwidth simultaneous or independent analog output. The data in both channels are aligned identically. */
void dac_load_data_buffer_dual(uint32_t dac, uint16_t data1, uint16_t data2, enum dac_align align)
/* Load DAC Dual Data Register. 
Loads the appropriate digital to analog converter dual data register with 12 or 8 bit data to be converted for both channels. This allows high bandwidth simultaneous or independent analog output. The data in both channels are aligned identically. */
void dac_load_data_buffer_dual(uint32_t dac, uint16_t data1, uint16_t data2, enum dac_align align)
{
	switch (align) {
	case DAC_ALIGN_RIGHT8:
		DAC_DHR8RD(dac) = ((data1 & 0xFF) | ((data2 & 0xFF) << 8));
		break;
	case DAC_ALIGN_RIGHT12:
		DAC_DHR12RD(dac) = ((data1 & 0xFFF) |
				((data2 & 0xFFF) << 16));
		break;
	case DAC_ALIGN_LEFT12:
		DAC_DHR12LD(dac) = ((data1 & 0xFFF) |
				((data2 & 0xFFF) << 16));
		break;
	default:
		break;
	}
}