/* Check if DAC channel is ready to receive data.  */
bool dac_is_ready(uint32_t dac, int channel)
/* Check if DAC channel is ready to receive data.  */
bool dac_is_ready(uint32_t dac, int channel)
{
	uint32_t mask = 0;
	if (channel & DAC_CHANNEL1) {
		mask |= DAC_SR_DAC1RDY;
	}
	if (channel & DAC_CHANNEL2) {
		mask |= DAC_SR_DAC2RDY;
	}
	return (DAC_SR(dac) & mask) != 0;
}