#[non_exhaustive]pub struct Config { /* private fields */ }Expand description
System configuration.
This struct is marked with #[non_exhaustive] and can’t be instantiated
directly. This is done to prevent breaking changes when new fields are added
to the struct. Instead, use the Config::default() method to create a
new instance.
§Examples
§Default initialization
let peripherals = esp_hal::init(esp_hal::Config::default());§Custom initialization
use esp_hal::{clock::CpuClock, time::Duration};
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
let peripherals = esp_hal::init(config);Implementations§
Source§impl Config
impl Config
Sourcepub fn with_cpu_clock(self, cpu_clock: impl Into<ClockConfig>) -> Self
pub fn with_cpu_clock(self, cpu_clock: impl Into<ClockConfig>) -> Self
Apply a clock configuration.
With the unstable feature enabled, this function accepts both ClockConfig and CpuClock.
Sourcepub fn clock_config(&self) -> ClockConfig
Available on crate feature unstable only.
pub fn clock_config(&self) -> ClockConfig
unstable only.The CPU clock configuration.
§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§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)