Can you simulate a GPIO input on STM32F0?
Use the internal pullup and pulldown resistors.

As long as a pin has nothing connected to it, and it's an input pin, setting the corresponding bits in GPIOx_PUPDR will activate pullup or pulldown resistors, directly affecting the pin state. It will not only simulate the pin going high or low, but the voltage will actually appear on the pin. The current might be too weak to drive anything  else, but the pin state would change. It should work even when the pin has an alternate input function, like the external trigger or capture input of a timer.

For example, setting PA12 (TIM1 external trigger) to high

GPIOA-&gt;PUPDR=(GPIOA-&gt;PUPDR &amp; ~(3 &lt;&lt; (2 * 12))) | (1 &lt;&lt; 2 * 12);


Setting the same pin to low

GPIOA-&gt;PUPDR=(GPIOA-&gt;PUPDR &amp; ~(3 &lt;&lt; (2 * 12))) | (2 &lt;&lt; 2 * 12);