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

pub trait TimerWithInterrupt: CountDown + Periodic + Cancel {
    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; }

Timer trait

Required methods

fn listen(&mut self, event: Event)

Starts listening for an Event

fn unlisten(&mut self, event: Event)

Stops listening for an Event

fn clear_interrupt(&mut self) -> &mut Self

Clear interrupt once fired

fn set_value<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self

Set timer value

fn get_value(&self) -> TicksU64

Get timer value

fn get_value_in_ns(&self) -> NanoSecondsU64

Get timer value in ns

fn get_alarm(&self) -> TicksU64

Get alarm value

fn get_alarm_in_ns(&self) -> NanoSecondsU64

Get alarm value in ns

fn set_alarm<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self

Set alarm value

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

fn set_alarm_in_ns<T: Into<NanoSecondsU64>>(&mut self, value: T) -> &mut Self

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.

fn enable(&mut self, enable: bool) -> &mut Self

Enable or disables the timer

fn is_enabled(&mut self) -> bool

Enable or disables the timer

fn stop(&mut self)

Stop the timer

fn increasing(&mut self, enable: bool) -> &mut Self

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

fn is_increasing(&mut self) -> bool

Returns true if the timer is increasing, otherwise decreasing

fn auto_reload(&mut self, enable: bool) -> &mut Self

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

fn enable_alarm(&mut self, enable: bool) -> &mut Self

Enable alarm triggering

fn alarm_active(&mut self) -> bool

Is the alarm active

fn set_divider(&mut self, divider: u32) -> Result<&mut Self, Error>

Set clock divider.

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

fn get_divider(&self) -> u32

Get the current clock divider

Loading content...

Implementors

impl<TIMG: TimerGroup> TimerWithInterrupt for Timer<TIMG, Timer0>[src]

fn listen(&mut self, event: Event)[src]

Starts listening for an event

fn unlisten(&mut self, event: Event)[src]

Stops listening for an event

fn clear_interrupt(&mut self) -> &mut Self[src]

Clear interrupt once fired

fn set_value<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set timer value

fn get_value(&self) -> TicksU64[src]

Get timer value

fn get_value_in_ns(&self) -> NanoSecondsU64[src]

Get timer value in ns

fn get_alarm(&self) -> TicksU64[src]

Get alarm value

fn get_alarm_in_ns(&self) -> NanoSecondsU64[src]

Get alarm value in ns

fn set_alarm<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set alarm value

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

fn set_alarm_in_ns<T: Into<NanoSecondsU64>>(&mut self, value: T) -> &mut Self[src]

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.

fn enable(&mut self, enable: bool) -> &mut Self[src]

Enable or disables the timer

fn is_enabled(&mut self) -> bool[src]

Enable or disables the timer

fn stop(&mut self)[src]

Stop the timer

fn increasing(&mut self, enable: bool) -> &mut Self[src]

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

fn is_increasing(&mut self) -> bool[src]

Returns true if the timer is increasing, otherwise decreasing

fn auto_reload(&mut self, enable: bool) -> &mut Self[src]

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

fn enable_alarm(&mut self, enable: bool) -> &mut Self[src]

Enable alarm triggering

fn alarm_active(&mut self) -> bool[src]

Is the alarm active

fn set_divider(&mut self, divider: u32) -> Result<&mut Self, Error>[src]

Set clock divider.

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

fn get_divider(&self) -> u32[src]

Get the current clock divider

impl<TIMG: TimerGroup> TimerWithInterrupt for Timer<TIMG, Timer1>[src]

fn listen(&mut self, event: Event)[src]

Starts listening for an event

fn unlisten(&mut self, event: Event)[src]

Stops listening for an event

fn clear_interrupt(&mut self) -> &mut Self[src]

Clear interrupt once fired

fn set_value<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set timer value

fn get_value(&self) -> TicksU64[src]

Get timer value

fn get_value_in_ns(&self) -> NanoSecondsU64[src]

Get timer value in ns

fn get_alarm(&self) -> TicksU64[src]

Get alarm value

fn get_alarm_in_ns(&self) -> NanoSecondsU64[src]

Get alarm value in ns

fn set_alarm<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set alarm value

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

fn set_alarm_in_ns<T: Into<NanoSecondsU64>>(&mut self, value: T) -> &mut Self[src]

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.

fn enable(&mut self, enable: bool) -> &mut Self[src]

Enable or disables the timer

fn is_enabled(&mut self) -> bool[src]

Enable or disables the timer

fn stop(&mut self)[src]

Stop the timer

fn increasing(&mut self, enable: bool) -> &mut Self[src]

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

fn is_increasing(&mut self) -> bool[src]

Returns true if the timer is increasing, otherwise decreasing

fn auto_reload(&mut self, enable: bool) -> &mut Self[src]

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

fn enable_alarm(&mut self, enable: bool) -> &mut Self[src]

Enable alarm triggering

fn alarm_active(&mut self) -> bool[src]

Is the alarm active

fn set_divider(&mut self, divider: u32) -> Result<&mut Self, Error>[src]

Set clock divider.

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

fn get_divider(&self) -> u32[src]

Get the current clock divider

impl<TIMG: TimerGroup> TimerWithInterrupt for Timer<TIMG, TimerLact>[src]

fn listen(&mut self, event: Event)[src]

Starts listening for an event

fn unlisten(&mut self, event: Event)[src]

Stops listening for an event

fn clear_interrupt(&mut self) -> &mut Self[src]

Clear interrupt once fired

fn set_value<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set timer value

fn get_value(&self) -> TicksU64[src]

Get timer value

fn get_value_in_ns(&self) -> NanoSecondsU64[src]

Get timer value in ns

fn get_alarm(&self) -> TicksU64[src]

Get alarm value

fn get_alarm_in_ns(&self) -> NanoSecondsU64[src]

Get alarm value in ns

fn set_alarm<T: Into<TicksU64>>(&mut self, value: T) -> &mut Self[src]

Set alarm value

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

fn set_alarm_in_ns<T: Into<NanoSecondsU64>>(&mut self, value: T) -> &mut Self[src]

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.

fn enable(&mut self, enable: bool) -> &mut Self[src]

Enable or disables the timer

fn is_enabled(&mut self) -> bool[src]

Enable or disables the timer

fn stop(&mut self)[src]

Stop the timer

fn increasing(&mut self, enable: bool) -> &mut Self[src]

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

fn is_increasing(&mut self) -> bool[src]

Returns true if the timer is increasing, otherwise decreasing

fn auto_reload(&mut self, enable: bool) -> &mut Self[src]

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

fn enable_alarm(&mut self, enable: bool) -> &mut Self[src]

Enable alarm triggering

fn alarm_active(&mut self) -> bool[src]

Is the alarm active

fn set_divider(&mut self, divider: u32) -> Result<&mut Self, Error>[src]

Set clock divider.

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

fn get_divider(&self) -> u32[src]

Get the current clock divider

Loading content...