/* Check if samples for specific channel are correct. It can check samples with arithmetic sequence with common difference.  */
static void check_samples(int expected_count, int32_t start_mv_value, int step, int num_channels, int channel_id, int32_t ref_mv, enum adc_gain gain)
/* Check if samples for specific channel are correct. It can check samples with arithmetic sequence with common difference.  */
static void check_samples(int expected_count, int32_t start_mv_value, int step, int num_channels, int channel_id, int32_t ref_mv, enum adc_gain gain)
{
	int32_t output, expected;
	int i, ret;
	for (i = channel_id; i < expected_count; i += num_channels) {
		expected = start_mv_value + i / num_channels * step;
		output = m_sample_buffer[i];
		ret = adc_raw_to_millivolts(ref_mv, gain, ADC_RESOLUTION,
					    &output);
		zassert_ok(ret, "adc_raw_to_millivolts() failed with code %d",
			   ret);
		zassert_within(expected, output, MV_OUTPUT_EPS,
			       "%u != %u [%u] should has set value",
			       expected, output, i);
	}
}