struct
system_gclk_gen_config gclock_gen_conf;
system_gclk_gen_get_config_defaults(&gclock_gen_conf);
gclock_gen_conf.source_clock = SYSTEM_CLOCK_SOURCE_OSC16M;
gclock_gen_conf.division_factor = 128;
system_gclk_gen_set_config(GCLK_GENERATOR_1, &gclock_gen_conf);
system_gclk_gen_enable(GCLK_GENERATOR_1);
struct
system_gclk_chan_config gclk_chan_conf;
system_gclk_chan_get_config_defaults(&gclk_chan_conf);
gclk_chan_conf.source_generator = GCLK_GENERATOR_1;
system_gclk_chan_set_config(TC1_GCLK_ID, &gclk_chan_conf);
system_gclk_chan_enable(TC1_GCLK_ID);