Reading Encoder and Input Capture on Same Timer
Hi everyone!
I'm using an STM32F767ZI and I want to read an encoder: I'm new to STM, so I am using CubeMX in order to set the mcu in the right way.
I would like to read encoder's signals with only 1 timer, like timer 1.
So I have 3 channels: CH_A and CH_B, that are assigned repectively to
TIMx_CH1 and TIMx_CH2 ; and also the index, CH_I.
For CH_I, I've read that is possible to set up a third timer channel, like CH3 or CH4, in 'input capture mode' to trig the Index signal, on the same timer, but how can I do that?
I found a callback function in an application note: 'HAL_TIM_IC_CaptureCallback(&htim_that_I_want)' , should I use it and write inside this funcion to reset the related timer?
Is there any automatic way to auto resetting timers when the Input Capture on CH3 or CH4 detects an edge?
Thanks!