pub fn set_counter(&mut self, phase: u16, direction: CounterDirection) {
        // SAFETY:
        // We only write to our TIMERx_SYNC register
        let tmr = unsafe { Self::tmr() };
        let sw = tmr.sync().read().sw().bit_is_set();
        tmr.sync().write(|w| {
            w.phase_direction().bit(direction as u8 != 0);
            unsafe {
                w.phase().bits(phase);
            }
            w.sw().bit(!sw)
        });
    }
Set the timer counter to the provided value
esp-hal/src/mcpwm/timer.rs