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§
type Timer: Instance
type Prescaler: HrtimPrescaler
type DacResetTrigger: DacResetTrigger
Required Methods§
Sourcefn get_period(&self) -> u16
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
Sourcefn set_period(&mut self, period: u16)
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
Sourcefn get_counter_value(&self) -> u16
fn get_counter_value(&self) -> u16
Get the current counter value
NOTE: The least significant bits may not be significant depending on prescaler
Sourcefn stop_and_reset(&mut self, _hr_control: &mut HrPwmCtrl)
fn stop_and_reset(&mut self, _hr_control: &mut HrPwmCtrl)
Stop timer and reset counter
fn clear_repetition_interrupt(&mut self)
Sourcefn as_reset_adc_trigger(&self) -> TimerReset<Self::Timer>
fn as_reset_adc_trigger(&self) -> TimerReset<Self::Timer>
Make a handle to this timers reset/roll-over event to use as adc trigger
Sourcefn as_period_adc_trigger(&self) -> TimerPeriod<Self::Timer>
fn as_period_adc_trigger(&self) -> TimerPeriod<Self::Timer>
Make a handle to this timers period event to use as adc trigger
Sourcefn disable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl)
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.
Sourcefn enable_register_updates(&mut self, _hr_control: &mut HrPwmCtrl)
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.