/* Resets the TC module. 
Resets the TC module, restoring all hardware module registers to their default values and disabling the module. The TC module will not be accessible while the reset is being performed. */
enum status_code tc_reset(const struct tc_module *const module_inst)
/* Resets the TC module. 
Resets the TC module, restoring all hardware module registers to their default values and disabling the module. The TC module will not be accessible while the reset is being performed. */
enum status_code tc_reset(const struct tc_module *const module_inst)
{
	Assert(module_inst);
	Assert(module_inst->hw);
	TcCount8 *const tc_module = &(module_inst->hw->COUNT8);
	if (tc_module->STATUS.reg & TC_STATUS_SLAVE) {
		return STATUS_ERR_UNSUPPORTED_DEV;
	}
	if (tc_module->CTRLA.reg & TC_CTRLA_ENABLE) {
		tc_disable(module_inst);
		while (tc_is_syncing(module_inst)) {
		}
	}
	tc_module->CTRLA.reg  |= TC_CTRLA_SWRST;
	return STATUS_OK;
}