Interface to a TIMER instance
Right now, this is a very basic interface. The timer will always be
hardcoded to a frequency of 1 MHz and 32 bits accuracy.
Return the raw interface to the underlying timer peripheral
Enables the interrupt for this timer
Enables an interrupt that is fired when the timer reaches the value that
is given as an argument to start
.
Disables the interrupt for this timer
Disables an interrupt that is fired when the timer reaches the value
that is given as an argument to start
.
Start the timer
The timer will run for the given number of cycles, then it will stop and
reset.
Wait for the timer to stop
Will return Err(nb::Error::WouldBlock)
while the timer is still
running. Once the timer reached the number of cycles given in the
start
method, it will return Ok(())
.
To block until the timer has stopped, use the block!
macro from the
nb
crate. Please refer to the documentation of nb
for other options.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static