/* Disables a Generic Clock that was previously enabled. 
Stops the clock generation of a Generic Clock that was previously started via a call to  */
void system_gclk_chan_disable(const uint8_t channel)
/* Disables a Generic Clock that was previously enabled. 
Stops the clock generation of a Generic Clock that was previously started via a call to  */
void system_gclk_chan_disable(const uint8_t channel)
{
	system_interrupt_enter_critical_section();
	Assert(!GCLK->PCHCTRL[channel].bit.WRTLOCK);
	GCLK->PCHCTRL[channel].reg &= ~GCLK_PCHCTRL_CHEN;
	while (GCLK->PCHCTRL[channel].reg & GCLK_PCHCTRL_CHEN) {
	}
	system_interrupt_leave_critical_section();
}