How to retrigger an externally triggered timer without changing the output channel state
I have a timer (TIM15) setup in trigger slave mode which uses CH1 for edge detect, and output compare on CH2. I have it working nicely to have the output low during the initial delay until the CNT reaches autoreload ARR. Then the output goes high as the output compare is 'Active level on match'. I then keep the oc in this state for some period of time (much longer than the resolution of timer can allow). At the end of this long period, I would like to be able to use the same delay triggered by an edge from CH1. I can get the final delay using 'inactive on match', but it doesn't wait for an edge on CH1, it just starts immediately. My main question is how can you reset the timer back into a state where it is waiting for an edge on CH1, without affecting the output on CH2? I want to hold the output high throughout the long delay and the also during the delay once the final edge is detected, until the output compare matches. If there are better strategies for timer setup, I'd like to hear them. I'm working on a STM32G070RB, but I would consider using a more advanced micro as long as the price is reasonable. I don't need a fast cpu, just a very flexible set of timers.
A second question is there a way to control the polarity of the edge on CH1? From the documentation I could not find any setting to control rising/falling edge.
Thanks.
