Struct esp32_hal::ledc::timer::Timer

source ·
pub struct Timer<'a, S>
where S: TimerSpeed,
{ /* private fields */ }
Expand description

Timer struct

Implementations§

source§

impl<'a, S> Timer<'a, S>
where S: TimerSpeed,

source

pub fn new( ledc: &'a RegisterBlock, clock_control_config: &'a Clocks<'_>, number: Number ) -> Timer<'a, S>

Create a new intance of a timer

Trait Implementations§

source§

impl<'a> TimerHW<HighSpeed> for Timer<'a, HighSpeed>

Timer HW implementation for HighSpeed timers

source§

fn get_freq_hw(&self) -> Option<Rate<u32, 1, 1>>

Get the current source timer frequency from the HW

source§

fn configure_hw(&self, divisor: u32)

Configure the HW for the timer

source§

fn update_hw(&self)

Update the timer in HW

source§

impl<'a> TimerHW<LowSpeed> for Timer<'a, LowSpeed>

Timer HW implementation for LowSpeed timers

source§

fn get_freq_hw(&self) -> Option<Rate<u32, 1, 1>>

Get the current source timer frequency from the HW

source§

fn configure_hw(&self, divisor: u32)

Configure the HW for the timer

source§

fn update_hw(&self)

Update the timer in HW

source§

impl<'a, S> TimerIFace<S> for Timer<'a, S>
where S: TimerSpeed, Timer<'a, S>: TimerHW<S>,

source§

fn get_freq(&self) -> Option<Rate<u32, 1, 1>>

Return the frequency of the timer

source§

fn configure( &mut self, config: Config<<S as TimerSpeed>::ClockSourceType> ) -> Result<(), Error>

Configure the timer

source§

fn is_configured(&self) -> bool

Check if the timer has been configured

source§

fn get_duty(&self) -> Option<Duty>

Return the duty resolution of the timer

source§

fn get_number(&self) -> Number

Return the timer number

source§

fn get_frequency(&self) -> u32

Return the timer frequency

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for Timer<'a, S>

§

impl<'a, S> !Send for Timer<'a, S>

§

impl<'a, S> !Sync for Timer<'a, S>

§

impl<'a, S> Unpin for Timer<'a, S>

§

impl<'a, S> !UnwindSafe for Timer<'a, S>

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.