2021-08-31 12:08 PM
In my application I need to design a multi purpose digital input which can operate in 3 modes
I can do the last 2 using HW Timers in Input Capture mode and configuring it for both edges. In the alternate interrupts I calculate frequency and I have a separate counter to count pulses on every interrupt and then divide the final result by 2 since the interrupt is for both edges.
But for the first application I am unable to find a solution. The application needs to be able to change the Input modes on the fly so I was thinking that anything in Input Capture mode will be helpful.
Thanks
2021-08-31 12:16 PM
Read the GPIO_IDR register to determine the state of the pin, even when in AF mode. HAL_GPIO_ReadPin does this.
2021-08-31 01:10 PM
Thanks for the solution. I will try it then.