/* Sets TC module count value. 
Sets the current timer count value of a initialized TC module. The specified TC module may be started or stopped. */
enum status_code tc_set_count_value(const struct tc_module *const module_inst, const uint32_t count)
/* Sets TC module count value. 
Sets the current timer count value of a initialized TC module. The specified TC module may be started or stopped. */
enum status_code tc_set_count_value(const struct tc_module *const module_inst, const uint32_t count)
{
	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:
			tc_module->COUNT8.COUNT.reg  = (uint8_t)count;
			return STATUS_OK;
		case TC_COUNTER_SIZE_16BIT:
			tc_module->COUNT16.COUNT.reg = (uint16_t)count;
			return STATUS_OK;
		case TC_COUNTER_SIZE_32BIT:
			tc_module->COUNT32.COUNT.reg = (uint32_t)count;
			return STATUS_OK;
		default:
			return STATUS_ERR_INVALID_ARG;
	}
}