Skip to main content

Module efuse

Module efuse 

Source
Expand description

§eFuse (one-time programmable configuration)

§Overview

The efuse module provides functionality for reading eFuse data from the chip, allowing access to various chip-specific information such as:

  • MAC address
  • Chip revision

and more. It is useful for retrieving chip-specific configuration and identification data during runtime.

§Examples

§Reading interface MAC addresses

use esp_hal::efuse::{self, InterfaceMacAddress};

let mac = efuse::interface_mac_address(InterfaceMacAddress::Station);
println!("MAC: {mac}");
println!("MAC bytes: {:02x?}", mac.as_bytes());

Structs§

ChipRevision
Represents the hardware revision.
EfuseFieldunstable
The bit field for get access to efuse data
MacAddress
Hardware (MAC) address.

Enums§

AdcCalibUnitunstable
Selects which ADC we are interested in the efuse calibration data for
InterfaceMacAddress
Interface selection for interface_mac_address.
SetMacErrorunstable
Error indicating issues with setting the MAC address.

Constants§

ACTIVE_HP_DBIASunstable
Stores the active hp dbias
ACTIVE_LP_DBIASunstable
Stores the active lp dbias
ADC1_CAL_VOL_ATTEN0unstable
ADC1 calibration voltage at atten0
ADC1_CAL_VOL_ATTEN1unstable
ADC1 calibration voltage at atten1
ADC1_CAL_VOL_ATTEN2unstable
ADC1 calibration voltage at atten2
ADC1_CAL_VOL_ATTEN3unstable
ADC1 calibration voltage at atten3
ADC1_INIT_CODE_ATTEN0unstable
ADC1 init code at atten0
ADC1_INIT_CODE_ATTEN0_CH0unstable
ADC1 init code at atten0 ch0
ADC1_INIT_CODE_ATTEN0_CH1unstable
ADC1 init code at atten0 ch1
ADC1_INIT_CODE_ATTEN0_CH2unstable
ADC1 init code at atten0 ch2
ADC1_INIT_CODE_ATTEN0_CH3unstable
ADC1 init code at atten0 ch3
ADC1_INIT_CODE_ATTEN0_CH4unstable
ADC1 init code at atten0 ch4
ADC1_INIT_CODE_ATTEN0_CH5unstable
ADC1 init code at atten0 ch5
ADC1_INIT_CODE_ATTEN0_CH6unstable
ADC1 init code at atten0 ch6
ADC1_INIT_CODE_ATTEN1unstable
ADC1 init code at atten1
ADC1_INIT_CODE_ATTEN2unstable
ADC1 init code at atten2
ADC1_INIT_CODE_ATTEN3unstable
ADC1 init code at atten3
BLK_VERSION_MAJORunstable
BLK_VERSION_MAJOR of BLOCK2
BLK_VERSION_MINORunstable
BLK_VERSION_MINOR of BLOCK2
BLOCK_KEY0unstable
Key0 or user data
BLOCK_KEY1unstable
Key1 or user data
BLOCK_KEY2unstable
Key2 or user data
BLOCK_KEY3unstable
Key3 or user data
BLOCK_KEY4unstable
Key4 or user data
BLOCK_KEY5unstable
Key5 or user data
BLOCK_SYS_DATA2unstable
System data part 2 (reserved)
BLOCK_USR_DATAunstable
User data
CRYPT_DPA_ENABLEunstable
Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled
CUSTOM_MACunstable
Custom MAC
DBIAS_VOL_GAPunstable
Stores the hp and lp dbias vol gap
DISABLE_BLK_VERSION_MAJORunstable
Disables check of blk version major
DISABLE_WAFER_VERSION_MAJORunstable
Disables check of wafer version major
DIS_DIRECT_BOOTunstable
Represents whether direct boot mode is disabled or enabled. 1: disabled. 0: enabled
DIS_DOWNLOAD_ICACHEunstable
Represents whether icache is disabled or enabled in Download mode. 1: disabled. 0: enabled
DIS_DOWNLOAD_MANUAL_ENCRYPTunstable
Represents whether flash encrypt function is disabled or enabled(except in SPI boot mode). 1: disabled. 0: enabled
DIS_DOWNLOAD_MODEunstable
Represents whether Download mode is disabled or enabled. 1: disabled. 0: enabled
DIS_FORCE_DOWNLOADunstable
Represents whether the function that forces chip into download mode is disabled or enabled. 1: disabled. 0: enabled
DIS_ICACHEunstable
Represents whether icache is disabled or enabled. 1: disabled. 0: enabled
DIS_PAD_JTAGunstable
Represents whether JTAG is disabled in the hard way(permanently). 1: disabled. 0: enabled
DIS_TWAIunstable
Represents whether TWAI function is disabled or enabled. 1: disabled. 0: enabled
DIS_USB_JTAGunstable
Represents whether the function of usb switch to jtag is disabled or enabled. 1: disabled. 0: enabled
DIS_USB_SERIAL_JTAGunstable
Represents whether USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODEunstable
Represents whether the USB-Serial-JTAG download function is disabled or enabled. 1: disabled. 0: enabled
DIS_USB_SERIAL_JTAG_ROM_PRINTunstable
Represents whether print from USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled
DSLP_LP_DBGunstable
Stores the dslp lp dbg
DSLP_LP_DBIASunstable
Stores the dslp lp dbias
ENABLE_SECURITY_DOWNLOADunstable
Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
FLASH_CAPunstable
FLASH_TEMPunstable
FLASH_TPUWunstable
Represents the flash waiting time after power-up; in unit of ms. When the value less than 15; the waiting time is the programmed value. Otherwise; the waiting time is 2 times the programmed value
FLASH_VENDORunstable
FORCE_SEND_RESUMEunstable
Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
JTAG_SEL_ENABLEunstable
Represents whether the selection between usb_to_jtag and pad_to_jtag through strapping gpio15 when both EFUSE_DIS_PAD_JTAG and EFUSE_DIS_USB_JTAG are equal to 0 is enabled or disabled. 1: enabled. 0: disabled
KEY_PURPOSE_0unstable
Represents the purpose of Key0
KEY_PURPOSE_1unstable
Represents the purpose of Key1
KEY_PURPOSE_2unstable
Represents the purpose of Key2
KEY_PURPOSE_3unstable
Represents the purpose of Key3
KEY_PURPOSE_4unstable
Represents the purpose of Key4
KEY_PURPOSE_5unstable
Represents the purpose of Key5
LSLP_HP_DBGunstable
Stores the lslp hp dbg
LSLP_HP_DBIASunstable
Stores the lslp hp dbias
MAC0unstable
MAC address
MAC1unstable
MAC address
MAC_EXTunstable
Stores the extended bits of MAC address
OCODEunstable
ADC OCode
OPTIONAL_UNIQUE_IDunstable
Optional unique 128-bit ID
PKG_VERSIONunstable
Package version
RD_DISunstable
Disable reading from BlOCK4-10
RESERVED_0_162unstable
reserved
RESERVED_1_136unstable
reserved
RESERVED_2_253unstable
reserved
RESERVED_3_192unstable
reserved
RESERVED_3_248unstable
reserved
RPT4_RESERVED0_0unstable
Reserved
RPT4_RESERVED0_1unstable
Reserved
RPT4_RESERVED0_2unstable
Reserved
RPT4_RESERVED1_0unstable
Reserved
RPT4_RESERVED2_0unstable
Reserved
RPT4_RESERVED2_1unstable
Reserved
RPT4_RESERVED3_0unstable
Reserved
RPT4_RESERVED3_1unstable
Reserved
RPT4_RESERVED3_2unstable
Reserved
RPT4_RESERVED3_3unstable
Reserved
RPT4_RESERVED3_4unstable
Reserved
RPT4_RESERVED3_5unstable
Reserved
RPT4_RESERVED4_0unstable
Reserved
SECURE_BOOT_AGGRESSIVE_REVOKEunstable
Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled
SECURE_BOOT_DISABLE_FAST_WAKEunstable
Represents whether FAST VERIFY ON WAKE is disabled or enabled when Secure Boot is enabled. 1: disabled. 0: enabled
SECURE_BOOT_ENunstable
Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled
SECURE_BOOT_KEY_REVOKE0unstable
Revoke 1st secure boot key
SECURE_BOOT_KEY_REVOKE1unstable
Revoke 2nd secure boot key
SECURE_BOOT_KEY_REVOKE2unstable
Revoke 3rd secure boot key
SECURE_VERSIONunstable
Represents the version used by ESP-IDF anti-rollback feature
SEC_DPA_LEVELunstable
Represents the spa secure level by configuring the clock random divide mode
SOFT_DIS_JTAGunstable
Represents whether JTAG is disabled in soft way. Odd number: disabled. Even number: enabled
SPI_BOOT_CRYPT_CNTunstable
Enables flash encryption when 1 or 3 bits are set and disables otherwise
SPI_DOWNLOAD_MSPI_DISunstable
Represents whether SPI0 controller during boot_mode_download is disabled or enabled. 1: disabled. 0: enabled
SPI_PAD_CONF_1unstable
Stores the first part of SPI_PAD_CONF
SPI_PAD_CONF_2unstable
Stores the second part of SPI_PAD_CONF
SWAP_UART_SDIO_ENunstable
Represents whether pad of uart and sdio is swapped or not. 1: swapped. 0: not swapped
SYS_DATA_PART0_2unstable
Stores the second 32 bits of the zeroth part of system data
TEMP_CALIBunstable
Temperature calibration data
UART_PRINT_CONTROLunstable
Set the default UARTboot message output mode
USB_DREFHunstable
Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV
USB_DREFLunstable
Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV
USB_EXCHG_PINSunstable
Represents whether the D+ and D- pins is exchanged. 1: exchanged. 0: not exchanged
VDD_SPI_AS_GPIOunstable
Represents whether vdd spi pin is functioned as gpio. 1: functioned. 0: not functioned
WAFER_VERSION_MAJORunstable
WAFER_VERSION_MINORunstable
WDT_DELAY_SELunstable
Represents whether RTC watchdog timeout threshold is selected at startup. 1: selected. 0: not selected
WR_DISunstable
Disable programming of individual eFuses

Functions§

base_mac_addressunstable
Returns the base MAC address programmed into eFuse during manufacturing.
block_versionunstable
Get efuse block version
chip_revision
Returns the hardware revision.
flash_encryptionunstable
Get status of SPI boot encryption.
interface_mac_address
Returns the MAC address for a specific interface, derived from the base MAC.
major_chip_versionunstable
Returns the major hardware revision
minor_chip_versionunstable
Returns the minor hardware revision
override_mac_addressunstable
Overrides the base MAC address used by interface_mac_address.
read_bitunstable
Read bit value.
read_field_leunstable
Read field value in a little-endian order
rtc_calib_cal_codeunstable
Get ADC reference point digital code for specified attenuation
rtc_calib_cal_mvunstable
Get ADC reference point voltage for specified attenuation in millivolts
rtc_calib_init_codeunstable
Get ADC initial code for specified attenuation from efuse
rtc_calib_versionunstable
Get version of RTC calibration block
rwdt_multiplierunstable
Get the multiplier for the timeout value of the RWDT STAGE 0 register.