Trait esp32_hal::timer::TimerWithInterrupt[][src]

pub trait TimerWithInterrupt: CountDown + Periodic + Cancel {
Show 20 methods fn listen(&mut self, event: Event);
fn unlisten(&mut self, event: Event);
fn clear_interrupt(&mut self) -> &mut Self;
fn set_value<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self;
fn get_value(&self) -> TicksU64;
fn get_value_in_ns(&self) -> NanoSecondsU64;
fn get_alarm(&self) -> TicksU64;
fn get_alarm_in_ns(&self) -> NanoSecondsU64;
fn set_alarm<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self;
fn set_alarm_in_ns<T: Into<NanoSecondsU64>>(
        &mut self,
        value: T
    ) -> &mut Self;
fn enable(&mut self, enable: bool) -> &mut Self;
fn is_enabled(&mut self) -> bool;
fn stop(&mut self);
fn increasing(&mut self, enable: bool) -> &mut Self;
fn is_increasing(&mut self) -> bool;
fn auto_reload(&mut self, enable: bool) -> &mut Self;
fn enable_alarm(&mut self, enable: bool) -> &mut Self;
fn alarm_active(&mut self) -> bool;
fn set_divider(&mut self, divider: u32) -> Result<&mut Self, Error>;
fn get_divider(&self) -> u32;
}
Expand description

Timer trait

Required methods

Starts listening for an Event

Stops listening for an Event

Clear interrupt once fired

Set timer value

Get timer value

Get timer value in ns

Get alarm value

Get alarm value in ns

Set alarm value

Note: timer is not disabled, so there is a risk for false triggering between setting upper and lower 32 bits.

Set alarm value in ns

Note: timer is not disabled, so there is a risk for false triggering between setting upper and lower 32 bits.

Enable or disables the timer

Enable or disables the timer

Stop the timer

Set to true to increase the timer value on each tick, set to false to decrease the timer value on each tick.

Returns true if the timer is increasing, otherwise decreasing

Set to true if the timer needs to be reloaded to initial value once the alarm is reached.

Enable alarm triggering

Is the alarm active

Set clock divider.

Value must be between 2 and 65536 inclusive for Timer 0 and 1 and between 3 and 65535 for TimerLact.

Get the current clock divider

Implementors