/* Initialize a PIT channel, but do not enable it  */
static void kinetis_pit_init(unsigned int timer, u32 ticks)
/* Initialize a PIT channel, but do not enable it  */
static void kinetis_pit_init(unsigned int timer, u32 ticks)
{
	volatile struct kinetis_pit_channel_regs *timer_regs =
		&KINETIS_PIT->ch[timer];
	kinetis_periph_enable(KINETIS_CG_PIT, 1);
	KINETIS_PIT->mcr = 0;
	timer_regs->tctrl = 0;
	timer_regs->tflg = KINETIS_PIT_TFLG_TIF_MSK;
	timer_regs->ldval = ticks;
	timer_regs->cval = 0;
	timer_regs->tctrl = KINETIS_PIT_TCTRL_TIE_MSK;
}