Struct stm32f1xx_hal::timer::monotonic::MonoTimer
source · pub struct MonoTimer<TIM, const FREQ: u32> { /* private fields */ }
Implementations§
Methods from Deref<Target = FTimer<TIM, FREQ>>§
sourcepub fn listen(&mut self, event: Event)
pub fn listen(&mut self, event: Event)
Starts listening for an event
Note, you will also have to enable the TIM2 interrupt in the NVIC to start receiving events.
sourcepub fn clear_interrupt(&mut self, event: Event)
pub fn clear_interrupt(&mut self, event: Event)
Clears interrupt associated with event
.
If the interrupt is not cleared, it will immediately retrigger after the ISR has finished.
pub fn get_interrupt(&mut self) -> Event
sourcepub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
pub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool)
Stopping timer in debug mode can cause troubles when sampling the signal
pub fn set_master_mode(&mut self, mode: TIM::Mms)
Trait Implementations§
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM1, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM1, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM2, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM2, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM3, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM3, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM4, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM4, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM5, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM5, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more
source§impl<const FREQ: u32> Monotonic for MonoTimer<TIM8, FREQ>
impl<const FREQ: u32> Monotonic for MonoTimer<TIM8, FREQ>
§type Duration = Duration<u32, 1, FREQ>
type Duration = Duration<u32, 1, FREQ>
The type for duration, defining an duration of time. Read more
source§unsafe fn reset(&mut self)
unsafe fn reset(&mut self)
Optionally resets the counter to zero for a fixed baseline in a system. Read more
source§fn set_compare(&mut self, instant: Self::Instant)
fn set_compare(&mut self, instant: Self::Instant)
Set the compare value of the timer interrupt. Read more
source§fn clear_compare_flag(&mut self)
fn clear_compare_flag(&mut self)
Clear the compare interrupt flag.
source§fn on_interrupt(&mut self)
fn on_interrupt(&mut self)
Optional. Commonly used for performing housekeeping of a timer when it has been extended,
e.g. a 16 bit timer extended to 32/64 bits. This will be called at the end of the interrupt
handler after all other operations have finished. Read more
source§fn zero() -> Self::Instant
fn zero() -> Self::Instant
The time at time zero. Used by RTIC before the monotonic has been initialized.
source§const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
const DISABLE_INTERRUPT_ON_EMPTY_QUEUE: bool = true
This tells RTIC if it should disable the interrupt bound to the monotonic if there are no
scheduled tasks. One may want to set this to
false
if one is using the on_interrupt
method to perform housekeeping and need overflow interrupts to happen, such as when
extending a 16 bit timer to 32/64 bits, even if there are no scheduled tasks. Read moresource§fn enable_timer(&mut self)
fn enable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
enabled. Read more
source§fn disable_timer(&mut self)
fn disable_timer(&mut self)
Optional. This is used to save power, this is called when the Monotonic interrupt is
disabled. Read more