Struct esp32_hal::mcpwm::timer::Timer

source ·
pub struct Timer<const TIM: u8, PWM> { /* private fields */ }
Expand description

A MCPWM timer

Every timer of a particular MCPWM peripheral can be used as a timing reference for every Operator of that peripheral

Implementations§

Apply the given timer configuration.

Note:

The prescalar and period configuration will be applied immediately and before setting the PwmWorkingMode. If the timer is already running you might want to call Timer::stop and/or Timer::set_counter first (if the new period is larger than the current counter value this will cause weird behavior).

The hardware supports writing these settings in sync with certain timer events but this HAL does not expose these for now.

Stop the timer in its current state

Set the timer counter to the provided value

Read the counter value and counter direction of the timer

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.