/* Gets the TC module capture value. 
Retrieves the capture value in the indicated TC module capture channel. */
uint32_t tc_get_capture_value(const struct tc_module *const module_inst, const enum tc_compare_capture_channel channel_index)
/* Gets the TC module capture value. 
Retrieves the capture value in the indicated TC module capture channel. */
uint32_t tc_get_capture_value(const struct tc_module *const module_inst, const enum tc_compare_capture_channel channel_index)
{
	Assert(module_inst);
	Assert(module_inst->hw);
	Tc *const tc_module = module_inst->hw;
	while (tc_is_syncing(module_inst)) {
	}
	switch (module_inst->counter_size) {
		case TC_COUNTER_SIZE_8BIT:
			if (channel_index <
					NUMBER_OF_COMPARE_CAPTURE_CHANNELS) {
				return tc_module->COUNT8.CC[channel_index].reg;
			}
		case TC_COUNTER_SIZE_16BIT:
			if (channel_index <
					NUMBER_OF_COMPARE_CAPTURE_CHANNELS) {
				return tc_module->COUNT16.CC[channel_index].reg;
			}
		case TC_COUNTER_SIZE_32BIT:
			if (channel_index <
					NUMBER_OF_COMPARE_CAPTURE_CHANNELS) {
				return tc_module->COUNT32.CC[channel_index].reg;
			}
	}
	Assert(false);
	return 0;
}