PWM on GPIO pins

Is there any demo code available that generates a PWM(freq, duty) signal on one of the external GPIO pins?

Assuming (P)A7 as my example, I believe I need to switch to Alternate Function #1 to access TIM1_CH1N [qv STM32 datasheet] and configure the timer. I’ve tried reading the furi_hal*.* code, but I think I’m missing some critical way of thinking :confused:

Also, once it is configured, which function()s would I call to stop & start the signal?

BC

Cracked it

The only thing I don’t understand is why 500 is a good prescaler [found in the speaker demo code] …or more to the point, how to choose a good prescaler.