How fast am I able to switch the alternate function on a given GPIO between a timer PWM output and GPIO during runtime?
I am using an STM32G4. I want to output PWM from a timer channel on one pin (call it pin A) and have a GPIO output on another (pin B). Then I want to be able to switch the functions on the two pins so that pin A is now a GPIO output and pin B is the PWM output. Is this possible to do at runtime? How fast can this be done? I am looking for a switching speed of at least 1kHz.
Additional details: I am driving an H-bridge that takes two PWMs but only actually needs one switching (PWM) at HIGH or LOW and the other switching at out desired frequency (PWM). But we need to be able to change which pin in switching.
