* using `stm32-hal`: ```rust let _pwm_pin = gpioa.new_pin(PinNum::P0, PinMode::Alt(AltFn::Af1)); // Set up a PWM timer that will output to PA0, run at 2400Hz in edge-aligned mode, // count up, with a 50% duty cycle. let mut ec_timer = Timer::new_tim2(dp.TIM2, 2_400., &clock_cfg, &mut dp.RCC); ec_timer.enable_pwm_output(Channel::One, OutputCompare::Pwm1, CountDir::Up, 0.5); ec_timer.enable(); // Setting auto reload preload allow changing frequency (period) while the timer is running. ec_timer.set_auto_reload_preload(true); ec_timer.set_freq(1_000.); // Change freq to 1000Hz. // Or set PSC and ARR manually, eg to set freq, while preventing additional calculations. ec_timer.set_auto_reload(100); ec_timer.set_prescaler(100); ```