/* Set up the measurement and comparison timers for calibration. */
static void setup_tc_channels(void)
/* Set up the measurement and comparison timers for calibration. */
static void setup_tc_channels(void)
{
	struct tc_config config;
	tc_get_config_defaults(&config);
	config.counter_size    = TC_COUNTER_SIZE_32BIT;
	config.clock_prescaler = TC_CLOCK_PRESCALER_DIV1;
	config.wave_generation = TC_WAVE_GENERATION_NORMAL_FREQ;
	config.enable_capture_on_channel[0] = true;
	tc_init(&tc_calib, CONF_TC_MEASUREMENT, &config);
	config.counter_size    = TC_COUNTER_SIZE_16BIT;
	config.clock_source    = REFERENCE_CLOCK;
	config.enable_capture_on_channel[0] = false;
	config.counter_16_bit.compare_capture_channel[0] = (1 << CALIBRATION_RESOLUTION);
	tc_init(&tc_comp, CONF_TC_REFERENCE, &config);
}