esp_hal::peripherals

Struct PCNT

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

Represents a virtual peripheral with no associated hardware.

This struct is generated by the create_peripheral! macro when the peripheral is defined as virtual.

Implementations§

Source§

impl PCNT

Source

pub unsafe fn steal() -> Self

Unsafely create an instance of this peripheral out of thin air.

§Safety

You must ensure that you’re only using one instance of this type at a time.

Source§

impl PCNT

Source

pub const PTR: *const <PCNT as Deref>::Target = {0x60012000 as *const <esp32c6::PCNT as core::ops::Deref>::Target}

Pointer to the register block

Source

pub const fn ptr() -> *const <PCNT as Deref>::Target

Return the pointer to the register block

Methods from Deref<Target = RegisterBlock>§

Source

pub fn unit(&self, n: usize) -> &UNIT

0x00..0x30 - Cluster UNIT%s, containing U?_CONF0, U?_CONF1, U?_CONF2

Source

pub fn unit_iter(&self) -> impl Iterator<Item = &UNIT>

Iterator for array of: 0x00..0x30 - Cluster UNIT%s, containing U?_CONF0, U?_CONF1, U?_CONF2

Source

pub fn u_cnt(&self, n: usize) -> &Reg<U_CNT_SPEC>

0x30..0x40 - Counter value for unit %s

Source

pub fn u_cnt_iter(&self) -> impl Iterator<Item = &Reg<U_CNT_SPEC>>

Iterator for array of: 0x30..0x40 - Counter value for unit %s

Source

pub fn u0_cnt(&self) -> &Reg<U_CNT_SPEC>

0x30 - Counter value for unit 0

Source

pub fn u1_cnt(&self) -> &Reg<U_CNT_SPEC>

0x34 - Counter value for unit 1

Source

pub fn u2_cnt(&self) -> &Reg<U_CNT_SPEC>

0x38 - Counter value for unit 2

Source

pub fn u3_cnt(&self) -> &Reg<U_CNT_SPEC>

0x3c - Counter value for unit 3

Source

pub fn int_raw(&self) -> &Reg<INT_RAW_SPEC>

0x40 - Interrupt raw status register

Source

pub fn int_st(&self) -> &Reg<INT_ST_SPEC>

0x44 - Interrupt status register

Source

pub fn int_ena(&self) -> &Reg<INT_ENA_SPEC>

0x48 - Interrupt enable register

Source

pub fn int_clr(&self) -> &Reg<INT_CLR_SPEC>

0x4c - Interrupt clear register

Source

pub fn u_status(&self, n: usize) -> &Reg<U_STATUS_SPEC>

0x50..0x60 - PNCT UNIT%s status register

Source

pub fn u_status_iter(&self) -> impl Iterator<Item = &Reg<U_STATUS_SPEC>>

Iterator for array of: 0x50..0x60 - PNCT UNIT%s status register

Source

pub fn u0_status(&self) -> &Reg<U_STATUS_SPEC>

0x50 - PNCT UNIT0 status register

Source

pub fn u1_status(&self) -> &Reg<U_STATUS_SPEC>

0x54 - PNCT UNIT1 status register

Source

pub fn u2_status(&self) -> &Reg<U_STATUS_SPEC>

0x58 - PNCT UNIT2 status register

Source

pub fn u3_status(&self) -> &Reg<U_STATUS_SPEC>

0x5c - PNCT UNIT3 status register

Source

pub fn ctrl(&self) -> &Reg<CTRL_SPEC>

0x60 - Control register for all counters

Source

pub fn date(&self) -> &Reg<DATE_SPEC>

0xfc - PCNT version control register

Trait Implementations§

Source§

impl Debug for PCNT

Source§

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

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

impl Deref for PCNT

Source§

type Target = <PCNT as Deref>::Target

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for PCNT

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Peripheral for PCNT

Source§

type P = PCNT

Peripheral singleton type
Source§

unsafe fn clone_unchecked(&self) -> Self::P

Unsafely clone (duplicate) a peripheral singleton. Read more
Source§

fn into_ref<'a>(self) -> PeripheralRef<'a, Self::P>
where Self: 'a,

Convert a value into a PeripheralRef. Read more
Source§

fn map_into<U>(self) -> U
where Self::P: Into<U>, U: Peripheral<P = U>,

Map the peripheral using Into. Read more

Auto Trait Implementations§

§

impl Freeze for PCNT

§

impl RefUnwindSafe for PCNT

§

impl Send for PCNT

§

impl Sync for PCNT

§

impl Unpin for PCNT

§

impl UnwindSafe for PCNT

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.