Skip to main content

TimerIFace

Trait TimerIFace 

Source
pub trait TimerIFace<S: TimerSpeed> {
    // Required methods
    fn freq(&self) -> Option<Rate>;
    fn configure(
        &mut self,
        config: Config<S::ClockSourceType>,
    ) -> Result<(), Error>;
    fn is_configured(&self) -> bool;
    fn duty(&self) -> Option<Duty>;
    fn number(&self) -> Number;
    fn frequency(&self) -> u32;
}
Expand description

Interface for Timers

Required Methods§

Source

fn freq(&self) -> Option<Rate>

Returns the frequency of the timer.

Source

fn configure(&mut self, config: Config<S::ClockSourceType>) -> Result<(), Error>

Configures the timer.

Source

fn is_configured(&self) -> bool

Returns whether the timer has been configured.

Source

fn duty(&self) -> Option<Duty>

Returns the duty resolution of the timer.

Source

fn number(&self) -> Number

Returns the timer number.

Source

fn frequency(&self) -> u32

Returns the timer frequency, or 0 if not configured.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, S: TimerSpeed> TimerIFace<S> for Timer<'a, S>
where Timer<'a, S>: TimerHW<S>,

Available on crate feature unstable only.