Struct esp32s2::LEDC

source ·
pub struct LEDC { /* private fields */ }
Expand description

LED Control PWM (Pulse Width Modulation)

Implementations§

source§

impl LEDC

source

pub const PTR: *const RegisterBlock = {0x3f419000 as *const ledc::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 ch_conf0(&self, n: usize) -> &CH_CONF0

0x00..0x20 - Configuration register 0 for channel %s

source

pub fn ch_conf0_iter(&self) -> impl Iterator<Item = &CH_CONF0>

Iterator for array of: 0x00..0x20 - Configuration register 0 for channel %s

source

pub fn ch0_conf0(&self) -> &CH_CONF0

0x00 - Configuration register 0 for channel 0

source

pub fn ch1_conf0(&self) -> &CH_CONF0

0x14 - Configuration register 0 for channel 1

source

pub fn ch2_conf0(&self) -> &CH_CONF0

0x28 - Configuration register 0 for channel 2

source

pub fn ch3_conf0(&self) -> &CH_CONF0

0x3c - Configuration register 0 for channel 3

source

pub fn ch4_conf0(&self) -> &CH_CONF0

0x50 - Configuration register 0 for channel 4

source

pub fn ch5_conf0(&self) -> &CH_CONF0

0x64 - Configuration register 0 for channel 5

source

pub fn ch6_conf0(&self) -> &CH_CONF0

0x78 - Configuration register 0 for channel 6

source

pub fn ch7_conf0(&self) -> &CH_CONF0

0x8c - Configuration register 0 for channel 7

source

pub fn ch_hpoint(&self, n: usize) -> &CH_HPOINT

0x04..0x24 - High point register for channel %s

source

pub fn ch_hpoint_iter(&self) -> impl Iterator<Item = &CH_HPOINT>

Iterator for array of: 0x04..0x24 - High point register for channel %s

source

pub fn ch0_hpoint(&self) -> &CH_HPOINT

0x04 - High point register for channel 0

source

pub fn ch1_hpoint(&self) -> &CH_HPOINT

0x18 - High point register for channel 1

source

pub fn ch2_hpoint(&self) -> &CH_HPOINT

0x2c - High point register for channel 2

source

pub fn ch3_hpoint(&self) -> &CH_HPOINT

0x40 - High point register for channel 3

source

pub fn ch4_hpoint(&self) -> &CH_HPOINT

0x54 - High point register for channel 4

source

pub fn ch5_hpoint(&self) -> &CH_HPOINT

0x68 - High point register for channel 5

source

pub fn ch6_hpoint(&self) -> &CH_HPOINT

0x7c - High point register for channel 6

source

pub fn ch7_hpoint(&self) -> &CH_HPOINT

0x90 - High point register for channel 7

source

pub fn ch_duty(&self, n: usize) -> &CH_DUTY

0x08..0x28 - Initial duty cycle for channel %s

source

pub fn ch_duty_iter(&self) -> impl Iterator<Item = &CH_DUTY>

Iterator for array of: 0x08..0x28 - Initial duty cycle for channel %s

source

pub fn ch0_duty(&self) -> &CH_DUTY

0x08 - Initial duty cycle for channel 0

source

pub fn ch1_duty(&self) -> &CH_DUTY

0x1c - Initial duty cycle for channel 1

source

pub fn ch2_duty(&self) -> &CH_DUTY

0x30 - Initial duty cycle for channel 2

source

pub fn ch3_duty(&self) -> &CH_DUTY

0x44 - Initial duty cycle for channel 3

source

pub fn ch4_duty(&self) -> &CH_DUTY

0x58 - Initial duty cycle for channel 4

source

pub fn ch5_duty(&self) -> &CH_DUTY

0x6c - Initial duty cycle for channel 5

source

pub fn ch6_duty(&self) -> &CH_DUTY

0x80 - Initial duty cycle for channel 6

source

pub fn ch7_duty(&self) -> &CH_DUTY

0x94 - Initial duty cycle for channel 7

source

pub fn ch_conf1(&self, n: usize) -> &CH_CONF1

0x0c..0x2c - Configuration register 1 for channel %s

source

pub fn ch_conf1_iter(&self) -> impl Iterator<Item = &CH_CONF1>

Iterator for array of: 0x0c..0x2c - Configuration register 1 for channel %s

source

pub fn ch0_conf1(&self) -> &CH_CONF1

0x0c - Configuration register 1 for channel 0

source

pub fn ch1_conf1(&self) -> &CH_CONF1

0x20 - Configuration register 1 for channel 1

source

pub fn ch2_conf1(&self) -> &CH_CONF1

0x34 - Configuration register 1 for channel 2

source

pub fn ch3_conf1(&self) -> &CH_CONF1

0x48 - Configuration register 1 for channel 3

source

pub fn ch4_conf1(&self) -> &CH_CONF1

0x5c - Configuration register 1 for channel 4

source

pub fn ch5_conf1(&self) -> &CH_CONF1

0x70 - Configuration register 1 for channel 5

source

pub fn ch6_conf1(&self) -> &CH_CONF1

0x84 - Configuration register 1 for channel 6

source

pub fn ch7_conf1(&self) -> &CH_CONF1

0x98 - Configuration register 1 for channel 7

source

pub fn ch_duty_r(&self, n: usize) -> &CH_DUTY_R

0x10..0x30 - Current duty cycle for channel %s

source

pub fn ch_duty_r_iter(&self) -> impl Iterator<Item = &CH_DUTY_R>

Iterator for array of: 0x10..0x30 - Current duty cycle for channel %s

source

pub fn ch0_duty_r(&self) -> &CH_DUTY_R

0x10 - Current duty cycle for channel 0

source

pub fn ch1_duty_r(&self) -> &CH_DUTY_R

0x24 - Current duty cycle for channel 1

source

pub fn ch2_duty_r(&self) -> &CH_DUTY_R

0x38 - Current duty cycle for channel 2

source

pub fn ch3_duty_r(&self) -> &CH_DUTY_R

0x4c - Current duty cycle for channel 3

source

pub fn ch4_duty_r(&self) -> &CH_DUTY_R

0x60 - Current duty cycle for channel 4

source

pub fn ch5_duty_r(&self) -> &CH_DUTY_R

0x74 - Current duty cycle for channel 5

source

pub fn ch6_duty_r(&self) -> &CH_DUTY_R

0x88 - Current duty cycle for channel 6

source

pub fn ch7_duty_r(&self) -> &CH_DUTY_R

0x9c - Current duty cycle for channel 7

source

pub fn timer_conf(&self, n: usize) -> &TIMER_CONF

0xa0..0xb0 - Timer %s configuration

source

pub fn timer_conf_iter(&self) -> impl Iterator<Item = &TIMER_CONF>

Iterator for array of: 0xa0..0xb0 - Timer %s configuration

source

pub fn timer0_conf(&self) -> &TIMER_CONF

0xa0 - Timer 0 configuration

source

pub fn timer1_conf(&self) -> &TIMER_CONF

0xa8 - Timer 1 configuration

source

pub fn timer2_conf(&self) -> &TIMER_CONF

0xb0 - Timer 2 configuration

source

pub fn timer3_conf(&self) -> &TIMER_CONF

0xb8 - Timer 3 configuration

source

pub fn timer_value(&self, n: usize) -> &TIMER_VALUE

0xa4..0xb4 - Timer %s current counter value

source

pub fn timer_value_iter(&self) -> impl Iterator<Item = &TIMER_VALUE>

Iterator for array of: 0xa4..0xb4 - Timer %s current counter value

source

pub fn timer0_value(&self) -> &TIMER_VALUE

0xa4 - Timer 0 current counter value

source

pub fn timer1_value(&self) -> &TIMER_VALUE

0xac - Timer 1 current counter value

source

pub fn timer2_value(&self) -> &TIMER_VALUE

0xb4 - Timer 2 current counter value

source

pub fn timer3_value(&self) -> &TIMER_VALUE

0xbc - Timer 3 current counter value

source

pub fn int_raw(&self) -> &INT_RAW

0xc0 - Raw interrupt status

source

pub fn int_st(&self) -> &INT_ST

0xc4 - Masked interrupt status

source

pub fn int_ena(&self) -> &INT_ENA

0xc8 - Interrupt enable bits

source

pub fn int_clr(&self) -> &INT_CLR

0xcc - Interrupt clear bits

source

pub fn conf(&self) -> &CONF

0xd0 - Global ledc configuration register

source

pub fn date(&self) -> &DATE

0xfc - Version control register

Trait Implementations§

source§

impl Debug for LEDC

source§

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

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

impl Deref for LEDC

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl Send for LEDC

Auto Trait Implementations§

§

impl RefUnwindSafe for LEDC

§

impl !Sync for LEDC

§

impl Unpin for LEDC

§

impl UnwindSafe for LEDC

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.