pub fn reset_and_compute_prescaler<T: Into<<Self as CountDown>::Time>>(
        &mut self,
        timeout: T,
    ) -> &Self {
        let params = TimerParams::new_us(timeout, self.rtc_clock_freq.0);
        let divider = params.divider;

        // Disable the timer while we reconfigure it
        self.sync();
        self.enable(false);

        // Now that we have a clock routed to the peripheral, we
        // can ask it to perform a reset.
        self.sync();
        self.reset();

        while self.mode0_ctrla().read().swrst().bit_is_set() {}

        self.mode0_ctrla().modify(|_, w| {
            // set clock divider...
            w.prescaler().variant(divider);
            // and enable RTC.
            w.enable().set_bit()
        });
        self
    }
/// This resets the internal counter and sets the prescaler to match the
/// provided timeout. You should configure the prescaler using the longest
/// timeout you plan to measure.
This resets the internal counter and sets the prescaler to match the
provided timeout. You should configure the prescaler using the longest
timeout you plan to measure.
This resets the internal counter and sets the prescaler to match the provided timeout . You should configure the prescaler using the longest timeout you plan to measure .
pub fn reset_and_compute_prescaler<T: Into<<Self as CountDown>::Time>>(
        &mut self,
        timeout: T,
    ) -> &Self {
        let params = TimerParams::new_us(timeout, self.rtc_clock_freq.0);
        let divider = params.divider;
        // Disable the timer while we reconfigure it
        self.sync();
        self.enable(false);
        // Now that we have a clock routed to the peripheral, we
        // can ask it to perform a reset.
        self.sync();
        self.reset();
        while self.mode0_ctrla().read().swrst().bit_is_set() {}
        self.mode0_ctrla().modify(|_, w| {
            // set clock divider...
            w.prescaler().variant(divider);
            // and enable RTC.
            w.enable().set_bit()
        });
        self
    }
pub fn reset_and_compute_prescaler < T : Into < < Self as CountDown > :: Time > > ( & mut self , timeout : T , ) -> & Self { let params = TimerParams :: new_us ( timeout , self . rtc_clock_freq . 0 ) ; let divider = params . divider ; // Disable the timer while we reconfigure it self . sync ( ) ; self . enable ( false ) ; // Now that we have a clock routed to the peripheral, we // can ask it to perform a reset. self . sync ( ) ; self . reset ( ) ; while self . mode0_ctrla ( ) . read ( ) . swrst ( ) . bit_is_set ( ) { } self . mode0_ctrla ( ) . modify ( | _ , w | { // set clock divider... w . prescaler ( ) . variant ( divider ) ; // and enable RTC. w . enable ( ) . set_bit ( ) } ) ; self }
This resets the internal counter and sets the prescaler to match the
provided timeout.
This resets the internal counter and sets the prescaler to match the provided timeout .
&mut self
timeout
T
&mut self
timeout
T