/* Disables a Generic Clock Generator that was previously enabled. 
Stops the clock generation of a Generic Clock Generator that was previously started via a call to  */
void system_gclk_gen_disable(const uint8_t generator)
/* Disables a Generic Clock Generator that was previously enabled. 
Stops the clock generation of a Generic Clock Generator that was previously started via a call to  */
void system_gclk_gen_disable(const uint8_t generator)
{
	while (system_gclk_is_syncing(generator)) {
	};
	system_interrupt_enter_critical_section();
	GCLK->GENCTRL[generator].reg &= ~GCLK_GENCTRL_GENEN;
	while (GCLK->GENCTRL[generator].reg & GCLK_GENCTRL_GENEN) {
	}
	system_interrupt_leave_critical_section();
}