/* ADC Enable Analog Watchdog for a Selected Channel. 
The analog watchdog allows the monitoring of an analog signal between two threshold levels. The thresholds must be preset. Comparison is done before data alignment takes place, so the thresholds are left-aligned. */
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t channel)
/* ADC Enable Analog Watchdog for a Selected Channel. 
The analog watchdog allows the monitoring of an analog signal between two threshold levels. The thresholds must be preset. Comparison is done before data alignment takes place, so the thresholds are left-aligned. */
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t channel)
{
	uint32_t reg32;
	reg32 = (ADC_CFGR1(adc) & ~ADC_CFGR1_AWD1CH);
	if (channel < 18) {
		reg32 |= channel;
	}
	ADC_CFGR1(adc) = reg32;
	ADC_CFGR1(adc) |= ADC_CFGR1_AWD1SGL;
}