[−][src]Struct nrf52832_hal::nrf52_hal_common::timer::Timer
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.
Methods
impl<T> Timer<T> where
T: TimerExt,
[src]
impl<T> Timer<T> where
T: TimerExt,
pub fn free(self) -> T
[src]
pub fn free(self) -> T
Return the raw interface to the underlying timer peripheral
pub fn enable_interrupt(&mut self, nvic: &mut NVIC)
[src]
pub fn enable_interrupt(&mut self, nvic: &mut NVIC)
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
.
pub fn disable_interrupt(&mut self, nvic: &mut NVIC)
[src]
pub fn disable_interrupt(&mut self, nvic: &mut NVIC)
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
.
pub fn start(&mut self, cycles: u32)
[src]
pub fn start(&mut self, cycles: u32)
Start the timer
The timer will run for the given number of cycles, then it will stop and reset.
pub fn wait(&mut self) -> Result<(), Error<Void>>
[src]
pub fn wait(&mut self) -> Result<(), Error<Void>>
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.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more