/* Specify the counter alignment mode. 
The mode can be edge aligned or centered. */
void timer_set_alignment(uint32_t timer_peripheral, uint32_t alignment)
/* Specify the counter alignment mode. 
The mode can be edge aligned or centered. */
void timer_set_alignment(uint32_t timer_peripheral, uint32_t alignment)
{
	alignment &= TIM_CR1_CMS_MASK;
	TIM_CR1(timer_peripheral) &= ~TIM_CR1_CMS_MASK;
	TIM_CR1(timer_peripheral) |= alignment;
}