Struct Efuse

Source
pub struct Efuse;
Available on crate feature unstable only.
Expand description

A struct representing the eFuse functionality of the chip.

Implementations§

Source§

impl Efuse

Source

pub fn core_count() -> u32

Returns the number of CPUs available on the chip.

While ESP32 chips usually come with two mostly equivalent CPUs (protocol CPU and application CPU), the application CPU is unavailable on some.

Source

pub fn max_cpu_frequency() -> Rate

Returns the maximum rated clock of the CPU in MHz.

Note that the actual clock may be lower, depending on the current power configuration of the chip, clock source, and other settings.

Source

pub fn is_bluetooth_enabled() -> bool

Returns the CHIP_VER_DIS_BT eFuse value.

Source

pub fn chip_type() -> ChipType

Returns the CHIP_VER_PKG eFuse value.

Source

pub fn flash_encryption() -> bool

Get status of SPI boot encryption.

Source§

impl Efuse

Source

pub fn read_base_mac_address() -> [u8; 6]

Reads chip’s MAC address from the eFuse storage.

Source

pub fn read_field_le<T: AnyBitPattern>(field: EfuseField) -> T

Read field value in a little-endian order

Source

pub fn read_bit(field: EfuseField) -> bool

Read bit value.

This function panics if the field’s bit length is not equal to 1.

Source§

impl Efuse

Source

pub fn set_mac_address(mac: [u8; 6]) -> Result<(), SetMacError>

Set the base mac address

The new value will be returned by read_mac_address instead of the one hard-coded in eFuse. This does not persist across device resets.

Can only be called once. Returns Err(SetMacError::AlreadySet) otherwise.

Source

pub fn mac_address() -> [u8; 6]

Get base mac address

By default this reads the base mac address from eFuse, but it can be overridden by set_mac_address.

Auto Trait Implementations§

§

impl Freeze for Efuse

§

impl RefUnwindSafe for Efuse

§

impl Send for Efuse

§

impl Sync for Efuse

§

impl Unpin for Efuse

§

impl UnwindSafe for Efuse

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.