Ctimer4

Struct Ctimer4 

Source
pub struct Ctimer4 { /* private fields */ }
Expand description

LPC-Next0 Standard async counter/timer

Implementations§

Source§

impl Ctimer4

Source

pub const PTR: *const RegisterBlock = {0x4002c000 as *const ctimer0::RegisterBlock}

Pointer to the register block

Source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

Source

pub unsafe fn steal() -> Self

Steal an instance of this peripheral

§Safety

Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.

Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.

Methods from Deref<Target = RegisterBlock>§

Source

pub fn ir(&self) -> &Ir

0x00 - Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending.

Source

pub fn tcr(&self) -> &Tcr

0x04 - Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR.

Source

pub fn tc(&self) -> &Tc

0x08 - Timer Counter. The 32 bit TC is incremented every PR+1 cycles of the APB bus clock. The TC is controlled through the TCR.

Source

pub fn pr(&self) -> &Pr

0x0c - Prescale Register. When the Prescale Counter (PC) is equal to this value, the next clock increments the TC and clears the PC.

Source

pub fn pc(&self) -> &Pc

0x10 - Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface.

Source

pub fn mcr(&self) -> &Mcr

0x14 - Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs.

Source

pub fn mr(&self, n: usize) -> &Mr

0x18..0x28 - Match Register . MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.

Source

pub fn mr_iter(&self) -> impl Iterator<Item = &Mr>

Iterator for array of: 0x18..0x28 - Match Register . MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC.

Source

pub fn ccr(&self) -> &Ccr

0x28 - Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place.

Source

pub fn cr(&self, n: usize) -> &Cr

0x2c..0x3c - Capture Register . CR is loaded with the value of TC when there is an event on the CAPn. input.

Source

pub fn cr_iter(&self) -> impl Iterator<Item = &Cr>

Iterator for array of: 0x2c..0x3c - Capture Register . CR is loaded with the value of TC when there is an event on the CAPn. input.

Source

pub fn emr(&self) -> &Emr

0x3c - External Match Register. The EMR controls the match function and the external match pins.

Source

pub fn ctcr(&self) -> &Ctcr

0x70 - Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting.

Source

pub fn pwmc(&self) -> &Pwmc

0x74 - PWM Control Register. The PWMCON enables PWM mode for the external match pins.

Source

pub fn msr(&self, n: usize) -> &Msr

0x78..0x88 - Match Shadow Register . If enabled, the Match Register will be automatically reloaded with the contents of this register whenever the TC is reset to zero.

Source

pub fn msr_iter(&self) -> impl Iterator<Item = &Msr>

Iterator for array of: 0x78..0x88 - Match Shadow Register . If enabled, the Match Register will be automatically reloaded with the contents of this register whenever the TC is reset to zero.

Trait Implementations§

Source§

impl Debug for Ctimer4

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Ctimer4

Source§

type Target = RegisterBlock

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Send for Ctimer4

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.