/* ADC Set the Sample Time for Given Selection.  */
void adc_set_selection_sample_time(uint32_t adc, uint8_t selection, uint8_t time)
/* ADC Set the Sample Time for Given Selection.  */
void adc_set_selection_sample_time(uint32_t adc, uint8_t selection, uint8_t time)
{
	uint32_t reg32;
	reg32 = ADC_SMPR1(adc);
	switch (selection) {
		case ADC_SMPR_SMPSEL_SMP1:
			reg32 &= ~(ADC_SMPR_SMP1_MASK << ADC_SMPR_SMP1_SHIFT);
			reg32 |= (time << ADC_SMPR_SMP1_SHIFT);
			break;
		case ADC_SMPR_SMPSEL_SMP2:
			reg32 &= ~(ADC_SMPR_SMP2_MASK << ADC_SMPR_SMP2_SHIFT);
			reg32 |= (time << ADC_SMPR_SMP2_SHIFT);
			break;
	}
	ADC_SMPR1(adc) = reg32;
}