pub trait Instance: Enable + Reset {
Show 14 methods
// Required methods
fn clk(clocks: &Clocks) -> Hertz;
fn set_psc(&mut self, psc: u16);
fn read_psc(&self) -> u16;
fn set_car(&mut self, car: u16);
fn read_car(&self) -> u16;
fn read_cnt(&self) -> u16;
fn gen_update(&mut self);
fn set_cen(&mut self, on: bool);
fn set_ups(&mut self, on: bool);
fn set_upie(&mut self, on: bool);
fn read_upie(&self) -> bool;
fn read_upif(&self) -> bool;
fn clear_upif(&mut self);
unsafe fn steal(&self) -> Self;
}Expand description
A timer peripheral, tying it to the bus that clocks it.
Required Methods§
Sourcefn clk(clocks: &Clocks) -> Hertz
fn clk(clocks: &Clocks) -> Hertz
The CK_TIMERx branch feeding this timer, taken from a frozen tree.
Sourcefn set_psc(&mut self, psc: u16)
fn set_psc(&mut self, psc: u16)
Writes the prescaler, which reaches the counter on the next update event.
Sourcefn gen_update(&mut self)
fn gen_update(&mut self)
Raises an update event in software, loading the shadowed dividers.
Sourcefn set_ups(&mut self, on: bool)
fn set_ups(&mut self, on: bool)
Restricts what counts as an update event to overflow/underflow — UPG no
longer raises UPIF, only the counter rolling over does.
Sourcefn set_upie(&mut self, on: bool)
fn set_upie(&mut self, on: bool)
Lets the update event through to the NVIC. The flag is raised either way.
Sourcefn read_upif(&self) -> bool
fn read_upif(&self) -> bool
Update flag — set by hardware on every rollover, never cleared by it.
Sourcefn clear_upif(&mut self)
fn clear_upif(&mut self)
Clears the update flag.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".