Struct esp32_hal::clock_control::ClockControl[][src]

pub struct ClockControl { /* fields omitted */ }
Expand description

Clock Control for initialization. Once initialization is done, call the freeze function to lock the clock configuration. This will return a ClockControlConfig, which can be copied for e.g. use in multiple peripherals.

Implementations

Start the APP (second) core

The second core will start running with the function entry.

Get the current count of the PCU, APB, Awake and PLL/2 locks

Note that this function cannot be used form within a callback as it tries to lock the mutex, leading to a dead-lock.

Get PLL frequency

Create new ClockControl structure

Freeze clock settings and return ClockControlConfig

Check if 8MHz oscillator is enabled

Check if 8MHz oscillator is enabled

Set CPU default, locked and apb frequencies for Dynamic Frequency Switching.

The default source and frequency are used when no locks are acquired. (Typically this would be) the lowest frequency.)

The cpu_locked source & frequency are used when the cpu frequency is locked, unless an apb lock is acquired and the apb_locked frequency is higher then the cpu_locked frequency.

The apb_locked source & frequency is used when peripherals request a locked apb frequency.

This function switches to the default source & frequency (locks can not have been acquired yet as this can only be done from ClockControlConfig).

Get Ref Tick frequency

This frequency is usually 1MHz, but cannot be maintained when the APB_CLK is < 10MHz

Get APB frequency

This gets the APB frequency from the scratch register, which is initialized during the clock calibration

Get Slow RTC frequency

Get Slow RTC source

Set the Slow RTC clock source

Get Fast RTC frequency

Get the Fast RTC clock source

Set the Fast RTC clock source

Get Xtal frequency.

This gets the Xtal frequency from a scratch register, which is initialized during the clock calibration

Get RTC tick count since boot

This function can usually take up to one RTC clock cycle (~300us).

In exceptional circumstances it could take up to two RTC clock cycles. This can happen when an interrupt routine or the other core calls this function exactly in between the loop checking for the valid bit and entering the critical section.

Interrupts are only blocked during the actual reading of the clock register, not during the wait for valid data.

Get nanoseconds since boot based on RTC tick count

Trait Implementations

Custom debug formatter

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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.