/* Configure the XOSC32K external 32KHz oscillator clock source. 
Configures the external 32KHz oscillator clock source with the given configuration settings. */
void system_clock_source_xosc32k_set_config(struct system_clock_source_xosc32k_config *const config)
/* Configure the XOSC32K external 32KHz oscillator clock source. 
Configures the external 32KHz oscillator clock source with the given configuration settings. */
void system_clock_source_xosc32k_set_config(struct system_clock_source_xosc32k_config *const config)
{
	SYSCTRL_XOSC32K_Type temp = SYSCTRL->XOSC32K;
	temp.bit.STARTUP = config->startup_time;
	if (config->external_clock == SYSTEM_CLOCK_EXTERNAL_CRYSTAL) {
		temp.bit.XTALEN = 1;
	} else {
		temp.bit.XTALEN = 0;
	}
	temp.bit.AAMPEN = config->auto_gain_control;
	temp.bit.EN1K = config->enable_1khz_output;
	temp.bit.EN32K = config->enable_32khz_output;
	temp.bit.ONDEMAND = config->on_demand;
	temp.bit.RUNSTDBY = config->run_in_standby;
	temp.bit.WRTLOCK  = config->write_once;
	_system_clock_inst.xosc32k.frequency = config->frequency;
	SYSCTRL->XOSC32K = temp;
}