/* Configure EVENT to route RTC events to the ADC.  */
static void configure_event(void)
/* Configure EVENT to route RTC events to the ADC.  */
static void configure_event(void)
{
	struct events_config config;
	system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBD,MCLK_APBDMASK_EVSYS);
	events_get_config_defaults(&config);
	config.generator    = EVSYS_ID_GEN_RTC_CMP_0;
	config.path         = EVENTS_PATH_ASYNCHRONOUS;
    config.run_in_standby = true;
    config.on_demand      = true;
	config.clock_source = GCLK_GENERATOR_0;
	events_allocate(&event, &config);
	events_attach_user(&event, EVSYS_ID_USER_ADC_START);
}