pub fn timer_clock_with_frequency(
        &self,
        period: u16,
        mode: timer::PwmWorkingMode,
        target_freq: Rate,
    ) -> Result<timer::TimerClockConfig, FrequencyError> {
        timer::TimerClockConfig::with_frequency(self, period, mode, target_freq)
    }
Get a timer clock configuration with the given frequency.

### Note:
This will try to select an appropriate prescaler for the timer.
If the calculated prescaler is not in the range `0..u8::MAX`
[`FrequencyError`] will be returned.

See [`PeripheralClockConfig::timer_clock_with_prescaler`] for how the
frequency is calculated.
esp-hal/src/mcpwm/mod.rs