It's really nuts how much functionality is packed into these little microcontrollers. But it makes configuring them a bit obtuse.
Here's the code that (I hope) configures GPIO pin D11 to act as an external reset line for Timer 8:<code> // CH2 = input capture mapped to TI2, used as DEN trigger source<br> TIM8->CCMR1 &= ~(<br> TIM_CCMR1_CC2S_Msk |<br> TIM_CCMR1_IC2PSC_Msk |<br> TIM_CCMR1_IC2F_Msk<br> );<br> TIM8->CCMR1 |= TIM_CCMR1_CC2S_0; // CC2 mapped to TI2<br><br> // Apply a modest digital filter (fSAMPLING = fDTS, N = 8) to ignore noise<br> TIM8->CCMR1 |= (0x3UL << TIM_CCMR1_IC2F_Pos);<br><br> TIM8->CCER |= TIM_CCER_CC2E;<br></code>