Struct nrf5x::timer::Timer
[−]
[src]
pub struct Timer { which: Location, client: Cell<Option<&'static CompareClient>>, }
Fields
which: Location
client: Cell<Option<&'static CompareClient>>
Methods
impl Timer
[src]
fn timer(&self) -> &'static TIMER
[src]
pub const fn new(location: Location) -> Timer
[src]
pub fn set_client(&self, client: &'static CompareClient)
[src]
pub fn start(&self)
[src]
pub fn stop(&self)
[src]
pub fn shutdown(&self)
[src]
pub fn clear(&self)
[src]
pub fn capture(&self, which: u8) -> u32
[src]
Capture the current timer value into the CC register specified by which, and return the value.
pub fn capture_to(&self, which: u8)
[src]
Capture the current value to the CC register specified by which and do not return the value.
pub fn get_shortcuts(&self) -> u32
[src]
Shortcuts can automatically stop or clear the timer on a particular compare event; refer to section 18.3 of the nRF reference manual for details. Implementation currently provides shortcuts as the raw bitmask.
pub fn set_shortcuts(&self, shortcut: u32)
[src]
pub fn get_cc0(&self) -> u32
[src]
pub fn set_cc0(&self, val: u32)
[src]
pub fn get_cc1(&self) -> u32
[src]
pub fn set_cc1(&self, val: u32)
[src]
pub fn get_cc2(&self) -> u32
[src]
pub fn set_cc2(&self, val: u32)
[src]
pub fn get_cc3(&self) -> u32
[src]
pub fn set_cc3(&self, val: u32)
[src]
pub fn enable_interrupts(&self, interrupts: u32)
[src]
pub fn disable_interrupts(&self, interrupts: u32)
[src]
pub fn set_prescaler(&self, val: u8)
[src]
pub fn get_prescaler(&self) -> u8
[src]
pub fn handle_interrupt(&self)
[src]
When an interrupt occurs, check if any of the 4 compares have created an event, and if so, add it to the bitmask of triggered events that is passed to the client.