/* Enables or disables the tim's Hall sensor interface.  */
void TIM_SelectHallSensor(TIM_TypeDef *tim, FunctionalState state)
/* Enables or disables the tim's Hall sensor interface.  */
void TIM_SelectHallSensor(TIM_TypeDef *tim, FunctionalState state)
{
    (state) ? SET_BIT(tim->CR2, TIM_CR2_TI1S) : CLEAR_BIT(tim->CR2, TIM_CR2_TI1S);
}