#[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: CpuClock) -> Self
pub fn with_cpu_clock(self, cpu_clock: CpuClock) -> Self
Assign the given value to the cpu_clock field.
Sourcepub fn with_psram(self, psram: PsramConfig) -> Self
Available on crate feature unstable only.
pub fn with_psram(self, psram: PsramConfig) -> Self
unstable only.Assign the given value to the psram field.
Sourcepub fn psram(&self) -> PsramConfig
Available on crate feature unstable only.
pub fn psram(&self) -> PsramConfig
unstable only.PSRAM configuration.
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 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)