a simple example to use stm32's TIM input capture function