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§
- Chip
Revision - Represents the hardware revision.
- Efuse
Field unstable - The bit field for get access to efuse data
- MacAddress
- Hardware (MAC) address.
Enums§
- Interface
MacAddress - Interface selection for
interface_mac_address. - SetMac
Error unstable - Error indicating issues with setting the MAC address.
Constants§
- ACTIVE_
HP_ DBIAS unstable - Active HP DBIAS of fixed voltage
- ACTIVE_
LP_ DBIAS unstable - Active LP DBIAS of fixed voltage
- ADC1_
AVE_ INIT_ CODE_ ATTE N0 unstable - Average initcode of ADC1 atten0
- ADC1_
AVE_ INIT_ CODE_ ATTE N1 unstable - Average initcode of ADC1 atten1
- ADC1_
AVE_ INIT_ CODE_ ATTE N2 unstable - Average initcode of ADC1 atten2
- ADC1_
AVE_ INIT_ CODE_ ATTE N3 unstable - Average initcode of ADC1 atten3
- ADC1_
CH0_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH0 and average initcode
- ADC1_
CH1_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH1 and average initcode
- ADC1_
CH2_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH2 and average initcode
- ADC1_
CH3_ ATTE N0_ INITCODE_ DIFF unstable - Gap between ADC1 CH3 and average initcode
- ADC1_
HI_ DOUT_ ATTE N0 unstable - HI_DOUT of ADC1 atten0
- ADC1_
HI_ DOUT_ ATTE N1 unstable - HI_DOUT of ADC1 atten1
- ADC1_
HI_ DOUT_ ATTE N2 unstable - HI_DOUT of ADC1 atten2
- ADC1_
HI_ DOUT_ ATTE N3 unstable - HI_DOUT of ADC1 atten3
- BLK_
VERSION_ MAJOR unstable - BLK_VERSION_MAJOR of BLOCK2
- BLK_
VERSION_ MINOR unstable - BLK_VERSION_MINOR of BLOCK2
- BLOCK_
KEY0 unstable - Key0 or user data
- BLOCK_
KEY1 unstable - Key1 or user data
- BLOCK_
KEY2 unstable - Key2 or user data
- BLOCK_
KEY3 unstable - Key3 or user data
- BLOCK_
KEY4 unstable - Key4 or user data
- BLOCK_
KEY5 unstable - Key5 or user data
- BLOCK_
SYS_ DATA2 unstable - System data part 2 (reserved)
- BLOCK_
USR_ DATA unstable - User data
- BOOTLOADER_
ANTI_ ROLLBACK_ EN unstable - Represents whether the ani-rollback check for the 2nd stage bootloader is enabled.1: Enabled0: Disabled
- BOOTLOADER_
ANTI_ ROLLBACK_ SECURE_ VERSION unstable - Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader
- BOOTLOADER_
ANTI_ ROLLBACK_ UPDATE_ IN_ ROM unstable - Represents whether the ani-rollback SECURE_VERSION will be updated from the ROM bootloader.1: Enable0: Disable
- CUSTOM_
MAC unstable - Custom MAC
- DISABLE_
BLK_ VERSION_ MAJOR unstable - Disables check of blk version major
- DISABLE_
WAFER_ VERSION_ MAJOR unstable - Disables check of wafer version major
- DIS_
DIRECT_ BOOT unstable - Represents whether direct boot mode is disabled or enabled. 1. Disable 0: Enable
- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT unstable - Represents whether flash encrypt function is disabled or enabled(except in SPI boot mode). 1: disabled 0: enabled
- DIS_
DOWNLOAD_ MODE unstable - Represents whether Download mode is disable or enable. 1. Disable 0: Enable
- DIS_
FORCE_ DOWNLOAD unstable - Represents whether the function that forces chip into download mode is disabled or enabled. 1: disabled 0: enabled
- DIS_
ICACHE unstable - Represents whether cache is disabled. 1: Disabled 0: Enabled.
- DIS_
PAD_ JTAG unstable - Represents whether JTAG is disabled in the hard way(permanently). 1: disabled 0: enabled
- DIS_
USB_ JTAG unstable - Represents whether the function of usb switch to jtag is disabled or enabled. 1: disabled 0: enabled
- DIS_
USB_ SERIAL_ JTAG unstable - Represents whether USB-Serial-JTAG is disabled or enabled. 1: disabled 0: enabled
- DIS_
USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE unstable - Represents whether the USB-Serial-JTAG download function is disabled or enabled. 1: Disable 0: Enable
- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT unstable - Represents whether print from USB-Serial-JTAG is disabled or enabled. 1. Disable 0: Enable
- DIS_
WIFI6 unstable - Represents whether the WIFI6 feature is enable or disabled. 1: WIFI6 is disable; 0: WIFI6 is enabled
- DSLP_
LP_ DBG unstable - DSLP LP DBG of fixed voltage
- DSLP_
LP_ DBIAS unstable - DSLP LP DBIAS of fixed voltage
- ECC_
FORCE_ CONST_ TIME unstable - Represents whether to force ecc to use const-time calculation mode. 1: Enable. 0: Disable
- ECDSA_
DISABLE_ P192 unstable - Represents whether to disable P192 curve in ECDSA. 1: Disabled. 0: Not disabled
- ENABLE_
SECURITY_ DOWNLOAD unstable - Represents whether security download is enabled or disabled. 1: Enable 0: Disable
- FLASH_
CAP unstable - Flash capacity
- FLASH_
TPUW unstable - Represents the flash waiting time after power-up; in unit of ms. When the value less than 15; the waiting time is programmed value. Otherwise; the waiting time is 2 times the programmed value
- FLASH_
VENDOR unstable - Flash vendor
- FORCE_
SEND_ RESUME unstable - Represents whether ROM code is forced to send a resume command during SPI boot
- HYS_
EN_ PAD unstable - Set bits to enable hysteresis function of PAD0~27
- JTAG_
SEL_ ENABLE unstable - 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_ 0 unstable - Represents the purpose of Key0
- KEY_
PURPOSE_ 1 unstable - Represents the purpose of Key1
- KEY_
PURPOSE_ 2 unstable - Represents the purpose of Key2
- KEY_
PURPOSE_ 3 unstable - Represents the purpose of Key3
- KEY_
PURPOSE_ 4 unstable - Represents the purpose of Key4
- KEY_
PURPOSE_ 5 unstable - Represents the purpose of Key5
- LP_
HP_ DBIAS_ VOL_ GAP unstable - DBIAS gap between LP and HP
- LSLP_
HP_ DBG unstable - LSLP HP DBG of fixed voltage
- LSLP_
HP_ DBIAS unstable - LSLP HP DBIAS of fixed voltage
- MAC0
unstable - MAC address
- MAC1
unstable - MAC address
- OCODE
unstable - ADC OCode calibration
- OPTIONAL_
UNIQUE_ ID unstable - Optional unique 128-bit ID
- PKG_
VERSION unstable - Package version
- PSRAM_
CAP unstable - PSRAM capacity
- PSRAM_
VENDOR unstable - PSRAM vendor
- RD_DIS
unstable - Disable reading from BlOCK4-10
- RECOVERY_
BOOTLOADER_ FLASH_ SECTOR unstable - Represents the starting flash sector (flash sector size is 0x1000) of the recovery bootloader used by the ROM bootloader If the primary bootloader fails. 0 and 0xFFF - this feature is disabled
- REPEAT_
DATA4 unstable - Reserved
- RESERVED_
1_ 121 unstable - reserved
- RESERVED_
2_ 241 unstable - reserved
- RESERVED_
3_ 192 unstable - reserved
- RESERVED_
3_ 248 unstable - reserved
- RESERVE_
0_ 61 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 146 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 184 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
1_ 48 unstable - Reserved; it was created by set_missed_fields_in_regs func
- SECURE_
BOOT_ AGGRESSIVE_ REVOKE unstable - Represents whether revoking aggressive secure boot is enabled or disabled.
- SECURE_
BOOT_ DISABLE_ FAST_ WAKE unstable - Represents whether FAST_VERIFY_ON_WAKE is disable or enable when Secure Boot is enable
- SECURE_
BOOT_ EN unstable - Represents whether secure boot is enabled or disabled. 1. Enable 0: Disable
- SECURE_
BOOT_ KEY_ REVOK E0 unstable - Revoke 1st secure boot key
- SECURE_
BOOT_ KEY_ REVOK E1 unstable - Revoke 2nd secure boot key
- SECURE_
BOOT_ KEY_ REVOK E2 unstable - Revoke 3rd secure boot key
- SECURE_
VERSION unstable - Represents the version used by ESP-IDF anti-rollback feature
- SEC_
DPA_ LEVEL unstable - Represents the spa secure level by configuring the clock random divide mode
- SPI_
BOOT_ CRYPT_ CNT unstable - Enables flash encryption when 1 or 3 bits are set and disables otherwise
- SPI_
DOWNLOAD_ MSPI_ DIS unstable - Represents whether SPI0 controller during boot_mode_download is disabled or enabled. 1: disabled 0: enabled
- SYS_
DATA_ PART0_ 1 unstable - Represents the first 14-bit of zeroth part of system data
- SYS_
DATA_ PART0_ 2 unstable - Represents the second 32-bit of zeroth part of system data
- TEMP
unstable - Temperature
- TEMPERATURE_
SENSOR unstable - Temperature calibration data
- UART_
PRINT_ CONTROL unstable - Represents the types of UART printing
- USB_
DREFH unstable - Represents the single-end input threshold vrefh of USB_SERIAL_JTAG PHY; 1.76 V to 2 V with step of 80 mV
- USB_
DREFL unstable - Represents the single-end input threshold vrefl of USB_SERIAL_JTAG PHY; 1.76 V to 2 V with step of 80 mV
- USB_
EXCHG_ PINS unstable - Represents whether the D+ and D- pins of USB_SERIAL_JTAG PHY is exchanged. 1: exchanged 0: not exchanged
- VDD_
SPI_ AS_ GPIO unstable - Represents whether vdd spi pin is functioned as gpio. 1: functioned 0: not functioned
- WAFER_
VERSION_ MAJOR unstable - Major chip version
- WAFER_
VERSION_ MINOR unstable - Minor chip version
- WDT_
DELAY_ SEL unstable - lp wdt timeout threshold at startup = initial timeout value * (2 ^ (EFUSE_WDT_DELAY_SEL + 1))
- WR_DIS
unstable - Disable programming of individual eFuses
- XTS_
DPA_ CLK_ ENABLE unstable - Represents whether xts-aes anti-dpa attack clock is enabled. 1. Enable. 0: Disable.
- XTS_
DPA_ PSEUDO_ LEVEL unstable - Represents the pseudo round level of xts-aes anti-dpa attack. 3: High. 2: Moderate 1. Low 0: Disabled
Functions§
- base_
mac_ address unstable - Returns the base MAC address programmed into eFuse during manufacturing.
- block_
version unstable - Get efuse block version
- chip_
revision - Returns the hardware revision.
- flash_
encryption unstable - Get status of SPI boot encryption.
- interface_
mac_ address - Returns the MAC address for a specific interface, derived from the base MAC.
- major_
chip_ version unstable - Returns the major hardware revision
- minor_
chip_ version unstable - Returns the minor hardware revision
- override_
mac_ address unstable - Overrides the base MAC address used by
interface_mac_address. - read_
bit unstable - Read bit value.
- read_
field_ le unstable - Read field value in a little-endian order
- rtc_
calib_ version unstable - Get version of RTC calibration block
- rwdt_
multiplier unstable - Get the multiplier for the timeout value of the RWDT STAGE 0 register.