#[non_exhaustive]pub struct CpuFrequencyLock;unstable only.Expand description
A guard that keeps the CPU clock unchanged while the CPU waits for an interrupt.
When the ESP_HAL_CONFIG_IDLE_FREQUENCY_SCALING option is enabled,
wait_for_interrupt switches the CPU clock to
XTAL_CLK until an interrupt occurs. The CPU clock returns to its configured source before the
interrupt handler runs, which increases the interrupt latency. While at least one
CpuFrequencyLock is held, the CPU clock does not change. The lock is released when the guard
is dropped.
When the option is disabled, or the chip does not support it, CpuFrequencyLock does nothing.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Implementations§
Source§impl CpuFrequencyLock
impl CpuFrequencyLock
Sourcepub fn new() -> Self
pub fn new() -> Self
Acquires a CPU frequency lock, which is released when it is dropped.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn acquire()
pub fn acquire()
Acquires a CPU frequency lock.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn release()
pub fn release()
Releases a CPU frequency lock.
Must only be called to release a lock acquired via Self::acquire.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
Source§impl Clone for CpuFrequencyLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
impl Clone for CpuFrequencyLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Source§impl Debug for CpuFrequencyLock
impl Debug for CpuFrequencyLock
Source§impl Default for CpuFrequencyLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
impl Default for CpuFrequencyLock
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Source§impl Drop for CpuFrequencyLock
impl Drop for CpuFrequencyLock
Auto Trait Implementations§
impl Freeze for CpuFrequencyLock
impl RefUnwindSafe for CpuFrequencyLock
impl Send for CpuFrequencyLock
impl Sync for CpuFrequencyLock
impl Unpin for CpuFrequencyLock
impl UnsafeUnpin for CpuFrequencyLock
impl UnwindSafe for CpuFrequencyLock
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)