esp_hal::peripherals

Struct MCPWM0

Source
pub struct MCPWM0 { /* 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 MCPWM0

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 MCPWM0

Source

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

Pointer to the register block

Source

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

Return the pointer to the register block

Methods from Deref<Target = RegisterBlock>§

Source

pub fn clk_cfg(&self) -> &Reg<CLK_CFG_SPEC>

0x00 - PWM clock prescaler register.

Source

pub fn timer(&self, n: usize) -> &TIMER

0x04..0x34 - Cluster TIMER%s, containing TIMER?_CFG0, TIMER?_CFG1, TIMER?_SYNC, TIMER?_STATUS

Source

pub fn timer_iter(&self) -> impl Iterator<Item = &TIMER>

Iterator for array of: 0x04..0x34 - Cluster TIMER%s, containing TIMER?_CFG0, TIMER?_CFG1, TIMER?_SYNC, TIMER?_STATUS

Source

pub fn timer_synci_cfg(&self) -> &Reg<TIMER_SYNCI_CFG_SPEC>

0x34 - Synchronization input selection for three PWM timers.

Source

pub fn operator_timersel(&self) -> &Reg<OPERATOR_TIMERSEL_SPEC>

0x38 - Select specific timer for PWM operators.

Source

pub fn ch(&self, n: usize) -> &CH

0x3c..0xe4 - Cluster CH%s, containing GEN?_STMP_CFG, GEN?_TSTMP_A, GEN?_TSTMP_B, GEN?_CFG0, GEN?_FORCE, GEN?_A, GEN?_B, DT?_CFG, DT?_FED_CFG, DT?_RED_CFG, CARRIER?_CFG, FH?_CFG0, FH?_CFG1, FH?_STATUS

Source

pub fn ch_iter(&self) -> impl Iterator<Item = &CH>

Iterator for array of: 0x3c..0xe4 - Cluster CH%s, containing GEN?_STMP_CFG, GEN?_TSTMP_A, GEN?_TSTMP_B, GEN?_CFG0, GEN?_FORCE, GEN?_A, GEN?_B, DT?_CFG, DT?_FED_CFG, DT?_RED_CFG, CARRIER?_CFG, FH?_CFG0, FH?_CFG1, FH?_STATUS

Source

pub fn fault_detect(&self) -> &Reg<FAULT_DETECT_SPEC>

0xe4 - Fault detection configuration and status

Source

pub fn cap_timer_cfg(&self) -> &Reg<CAP_TIMER_CFG_SPEC>

0xe8 - Configure capture timer

Source

pub fn cap_timer_phase(&self) -> &Reg<CAP_TIMER_PHASE_SPEC>

0xec - Phase for capture timer sync

Source

pub fn cap_ch_cfg(&self, n: usize) -> &Reg<CAP_CH_CFG_SPEC>

0xf0..0xfc - Capture channel %s configuration and enable

Source

pub fn cap_ch_cfg_iter(&self) -> impl Iterator<Item = &Reg<CAP_CH_CFG_SPEC>>

Iterator for array of: 0xf0..0xfc - Capture channel %s configuration and enable

Source

pub fn cap_ch0_cfg(&self) -> &Reg<CAP_CH_CFG_SPEC>

0xf0 - Capture channel 0 configuration and enable

Source

pub fn cap_ch1_cfg(&self) -> &Reg<CAP_CH_CFG_SPEC>

0xf4 - Capture channel 1 configuration and enable

Source

pub fn cap_ch2_cfg(&self) -> &Reg<CAP_CH_CFG_SPEC>

0xf8 - Capture channel 2 configuration and enable

Source

pub fn cap_ch(&self, n: usize) -> &Reg<CAP_CH_SPEC>

0xfc..0x108 - Value of last capture on channel %s

Source

pub fn cap_ch_iter(&self) -> impl Iterator<Item = &Reg<CAP_CH_SPEC>>

Iterator for array of: 0xfc..0x108 - Value of last capture on channel %s

Source

pub fn cap_status(&self) -> &Reg<CAP_STATUS_SPEC>

0x108 - Edge of last capture trigger

Source

pub fn update_cfg(&self) -> &Reg<UPDATE_CFG_SPEC>

0x10c - Enable update.

Source

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

0x110 - Interrupt enable bits

Source

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

0x114 - Raw interrupt status

Source

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

0x118 - Masked interrupt status

Source

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

0x11c - Interrupt clear bits

Source

pub fn evt_en(&self) -> &Reg<EVT_EN_SPEC>

0x120 - MCPWM event enable register

Source

pub fn task_en(&self) -> &Reg<TASK_EN_SPEC>

0x124 - MCPWM task enable register

Source

pub fn clk(&self) -> &Reg<CLK_SPEC>

0x128 - MCPWM APB configuration register

Source

pub fn version(&self) -> &Reg<VERSION_SPEC>

0x12c - Version register.

Trait Implementations§

Source§

impl Debug for MCPWM0

Source§

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

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

impl Deref for MCPWM0

Source§

type Target = <MCPWM0 as Deref>::Target

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for MCPWM0

Source§

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

Mutably dereferences the value.
Source§

impl Peripheral for MCPWM0

Source§

type P = MCPWM0

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
Source§

impl PwmPeripheral for MCPWM0

Source§

fn enable()

Enable peripheral
Source§

fn reset()

Reset peripheral
Source§

fn block() -> *const RegisterBlock

Get a pointer to the peripheral RegisterBlock
Source§

fn output_signal<const OP: u8, const IS_A: bool>() -> OutputSignal

Get operator GPIO mux output signal

Auto Trait Implementations§

§

impl Freeze for MCPWM0

§

impl RefUnwindSafe for MCPWM0

§

impl Send for MCPWM0

§

impl Sync for MCPWM0

§

impl Unpin for MCPWM0

§

impl UnwindSafe for MCPWM0

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.