/* Get TC module count value. 
Retrieves the current count value of a TC module. The specified TC module may be started or stopped. */
uint32_t tc_get_count_value(const struct tc_module *const module_inst)
/* Get TC module count value. 
Retrieves the current count value of a TC module. The specified TC module may be started or stopped. */
uint32_t tc_get_count_value(const struct tc_module *const module_inst)
{
	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:
			return (uint32_t)tc_module->COUNT8.COUNT.reg;
		case TC_COUNTER_SIZE_16BIT:
			return (uint32_t)tc_module->COUNT16.COUNT.reg;
		case TC_COUNTER_SIZE_32BIT:
			return tc_module->COUNT32.COUNT.reg;
	}
	Assert(false);
	return 0;
}