Efuse

Struct Efuse 

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

A struct representing the eFuse functionality of the chip.

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

Source

pub fn flash_encryption() -> bool

Get status of SPI boot encryption.

Source

pub fn rwdt_multiplier() -> u8

Get the multiplier for the timeout value of the RWDT STAGE 0 register.

Source

pub fn block_version() -> (u8, u8)

Source

pub fn rtc_calib_version() -> u8

Source

pub fn rtc_calib_init_code( _unit: AdcCalibUnit, atten: Attenuation, ) -> Option<u16>

Source

pub fn rtc_calib_cal_mv(_unit: AdcCalibUnit, atten: Attenuation) -> u16

Get ADC reference point voltage for specified attenuation in millivolts

see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42

Source

pub fn rtc_calib_cal_code( _unit: AdcCalibUnit, atten: Attenuation, ) -> Option<u16>

Get ADC reference point digital code for specified attenuation

see https://github.com/espressif/esp-idf/blob/903af13e8/components/efuse/esp32c6/esp_efuse_rtc_calib.c#L42

Source

pub fn major_chip_version() -> u8

Returns the major hardware revision

Source

pub fn minor_chip_version() -> u8

Returns the minor hardware revision

Source§

impl Efuse

Source

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

Reads chip’s MAC address from the eFuse storage.

§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

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

Read field value in a little-endian order

§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

pub fn read_bit(field: EfuseField) -> bool

Read bit value.

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

§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

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.

§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

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.

§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

pub fn chip_revision() -> u16

Returns the hardware revision

The chip version is calculated using the following formula: MAJOR * 100 + MINOR. (if the result is 1, then version is v0.1)

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.