pub trait TimerControl {
// Required methods
fn set_interrupt_period(&mut self, period: u16);
fn set_mode(&mut self, mode: TimerMode);
fn set_count_max(&mut self, max: u16);
fn start(&self, handler: TimerIsrCallback);
fn stop(&self);
fn get_count(&self) -> u16;
fn reset_count(&mut self);
}
Required Methods§
sourcefn set_interrupt_period(&mut self, period: u16)
fn set_interrupt_period(&mut self, period: u16)
Set the period (number of underlying timer interrupts) that trigger an interrupt callback (i.e. if 10, every 10 timer events the callback passed to start() will be called.)
sourcefn set_count_max(&mut self, max: u16)
fn set_count_max(&mut self, max: u16)
Set the clock’s counter trigger
sourcefn start(&self, handler: TimerIsrCallback)
fn start(&self, handler: TimerIsrCallback)
Start this timer. The given callback will be called periodically when timer interrupts occur (see the interrupting(period) method.)
If the timer is in a constant-run mode (e.g. TimerMode::Periodic), it will run constantly until either stopped (with the stop() method!) or until the callback function returns false.
sourcefn reset_count(&mut self)
fn reset_count(&mut self)
Reset the timer’s current count value