/* Run adc_read for given channels and collect specified number of samples.  */
static void start_adc_read(const struct device *adc_dev, uint32_t channel_mask, int samples)
/* Run adc_read for given channels and collect specified number of samples.  */
static void start_adc_read(const struct device *adc_dev, uint32_t channel_mask, int samples)
{
	int ret;
	const struct adc_sequence_options *options_ptr;
	const struct adc_sequence_options options = {
		.extra_samplings = samples - 1,
	};
	if (samples > 1) {
		options_ptr = &options;
	} else {
		options_ptr = NULL;
	}
	const struct adc_sequence sequence = {
		.options     = options_ptr,
		.channels    = channel_mask,
		.buffer      = m_sample_buffer,
		.buffer_size = sizeof(m_sample_buffer),
		.resolution  = ADC_RESOLUTION,
	};
	ret = adc_read(adc_dev, &sequence);
	zassert_ok(ret, "adc_read() failed with code %d", ret);
}