/* Set Input Filter and Dead-time Clock Divider Ratio. 
This forms the sampling clock for the input filters and the dead-time clock in the advanced timers 1 and 8, by division from the timer clock. */
void timer_set_clock_division(uint32_t timer_peripheral, uint32_t clock_div)
/* Set Input Filter and Dead-time Clock Divider Ratio. 
This forms the sampling clock for the input filters and the dead-time clock in the advanced timers 1 and 8, by division from the timer clock. */
void timer_set_clock_division(uint32_t timer_peripheral, uint32_t clock_div)
{
	clock_div &= TIM_CR1_CKD_CK_INT_MASK;
	TIM_CR1(timer_peripheral) &= ~TIM_CR1_CKD_CK_INT_MASK;
	TIM_CR1(timer_peripheral) |= clock_div;
}