/* Enable circular option for double buffered compare values. 
Enable circular option for the double buffered channel compare values. On each UPDATE condition, the contents of CCBx and CCx are switched, meaning that the contents of CCBx are transferred to CCx and the contents of CCx are transferred to CCBx. */
enum status_code tcc_enable_circular_buffer_compare(struct tcc_module *const module_inst, enum tcc_match_capture_channel channel_index)
/* Enable circular option for double buffered compare values. 
Enable circular option for the double buffered channel compare values. On each UPDATE condition, the contents of CCBx and CCx are switched, meaning that the contents of CCBx are transferred to CCx and the contents of CCx are transferred to CCBx. */
enum status_code tcc_enable_circular_buffer_compare(struct tcc_module *const module_inst, enum tcc_match_capture_channel channel_index)
{
	Assert(module_inst);
	Assert(module_inst->hw);
	Tcc *const tcc_module = module_inst->hw;
	uint8_t module_index = _tcc_get_inst_index(tcc_module);
	if (channel_index > 3) {
		return STATUS_ERR_INVALID_ARG;
	}
	if (channel_index >= _tcc_cc_nums[module_index]) {
		return STATUS_ERR_INVALID_ARG;
	}
	tcc_module->WAVE.reg |=  (TCC_WAVE_CICCEN0 << channel_index);
	return STATUS_OK;
}