/* Configure Timer Counter 0 (TC0) to generate an interrupt every 200ms. This interrupt will be used to flush USART input and echo back.  */
static void configure_tc(void)
/* Configure Timer Counter 0 (TC0) to generate an interrupt every 200ms. This interrupt will be used to flush USART input and echo back.  */
static void configure_tc(void)
{
	uint32_t ul_div;
	uint32_t ul_tcclks;
	static uint32_t ul_pbaclk;
	sysclk_enable_peripheral_clock(TC0);
	ul_pbaclk = sysclk_get_peripheral_bus_hz(TC0);
	tc_find_mck_divisor(TC_FREQ, ul_pbaclk, &ul_div, &ul_tcclks, ul_pbaclk);
	tc_init(TC0, 0, ul_tcclks | TC_CMR_CPCTRG);
	tc_write_rc(TC0, 0, (ul_pbaclk / ul_div) / TC_FREQ);
	NVIC_EnableIRQ(TC00_IRQn);
	tc_enable_interrupt(TC0, 0, TC_IER_CPCS);
}