/* Set Input Polarity. 
The timer channel must be set to input capture mode. */
void timer_ic_set_polarity(uint32_t timer_peripheral, enum tim_ic_id ic, enum tim_ic_pol pol)
/* Set Input Polarity. 
The timer channel must be set to input capture mode. */
void timer_ic_set_polarity(uint32_t timer_peripheral, enum tim_ic_id ic, enum tim_ic_pol pol)
{
	TIM_CCER(timer_peripheral) &= ~(0xa << (ic * 4));
	switch (pol) {
	case TIM_IC_RISING:
		break;
	case TIM_IC_BOTH:
		TIM_CCER(timer_peripheral) |= (0xa << (ic * 4));
		break;
	case TIM_IC_FALLING:
		TIM_CCER(timer_peripheral) |= (0x2 << (ic * 4));
	}
}
/**@}