HrTimer

Trait HrTimer 

Source
pub trait HrTimer {
    type Timer: Instance;
    type Prescaler: HrtimPrescaler;
    type DacResetTrigger: DacResetTrigger;

    // Required methods
    fn get_period(&self) -> u16;
    fn set_period(&mut self, period: u16);
    fn get_counter_value(&self) -> u16;
    fn start(&mut self, _hr_control: &mut HrPwmCtrl);
    fn stop(&mut self, _hr_control: &mut HrPwmCtrl);
    fn stop_and_reset(&mut self, _hr_control: &mut HrPwmCtrl);
    fn clear_repetition_interrupt(&mut self);
    fn as_reset_adc_trigger(&self) -> TimerReset<Self::Timer>;
    fn as_period_adc_trigger(&self) -> TimerPeriod<Self::Timer>;
    fn disable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl);
    fn enable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl);
}

Required Associated Types§

Required Methods§

Source

fn get_period(&self) -> u16

Get period of timer in number of ticks

This is also the maximum duty usable for HrCompareRegister::set_duty

NOTE: The effective period in number of ticks will be twice as large as returned by this function when running in UpDown mode or PushPull mode. 4 times as large when having both modes active

Source

fn set_period(&mut self, period: u16)

Set period of timer in number of ticks

NOTE: This will affect the maximum duty usable for HrCompareRegister::set_duty

Source

fn get_counter_value(&self) -> u16

Get the current counter value

NOTE: The least significant bits may not be significant depending on prescaler

Source

fn start(&mut self, _hr_control: &mut HrPwmCtrl)

Start timer

Source

fn stop(&mut self, _hr_control: &mut HrPwmCtrl)

Stop timer

Source

fn stop_and_reset(&mut self, _hr_control: &mut HrPwmCtrl)

Stop timer and reset counter

Source

fn clear_repetition_interrupt(&mut self)

Source

fn as_reset_adc_trigger(&self) -> TimerReset<Self::Timer>

Make a handle to this timers reset/roll-over event to use as adc trigger

Source

fn as_period_adc_trigger(&self) -> TimerPeriod<Self::Timer>

Make a handle to this timers period event to use as adc trigger

Source

fn disable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl)

Disable register updates

Calling this function temporarily disables the transfer from preload to active registers, whatever the selected update event. This allows to modify several registers. The regular update event takes place once Self::enable_register_updates is called.

Source

fn enable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl)

Enable register updates

See Self::disable_register_updates.

NOTE: Register updates are enabled by default, no need to call this unless Self::disable_register_updates has been called.

Implementors§

Source§

impl<TIM: Instance, PSCL: HrtimPrescaler, CPT1, CPT2, DacRst: DacResetTrigger> HrTimer for HrTim<TIM, PSCL, CPT1, CPT2, DacRst>

Source§

type Prescaler = PSCL

Source§

type Timer = TIM

Source§

type DacResetTrigger = DacRst