Available on crate feature 
unstable only.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.
The Efuse struct represents the eFuse peripheral and is responsible for
reading various eFuse fields and values.
§Examples
§Read data from the eFuse storage.
use esp_hal::efuse::{Efuse, SECURE_VERSION};
let mac_address = Efuse::read_base_mac_address();
println!(
    "MAC: {:#X}:{:#X}:{:#X}:{:#X}:{:#X}:{:#X}",
    mac_address[0],
    mac_address[1],
    mac_address[2],
    mac_address[3],
    mac_address[4],
    mac_address[5]
);
println!("MAC address {:02x?}", Efuse::mac_address());
println!("Flash Encryption {:?}", Efuse::flash_encryption());
// Besides the helper methods, various eFuse field constants can also be read with a lower-level API:
println!(
    "Secure version {:?}",
    Efuse::read_field_le::<u16>(SECURE_VERSION)
);Structs§
- Efuse
- A struct representing the eFuse functionality of the chip.
- EfuseField 
- The bit field for get access to efuse data
Enums§
- AdcCalibUnit 
- Selects which ADC we are interested in the efuse calibration data for
- SetMacError 
- Error indicating issues with setting the MAC address.
Constants§
- ACTIVE_HP_ DBIAS 
- Stores the active hp dbias
- ACTIVE_LP_ DBIAS 
- Stores the active lp dbias
- ADC1_CAL_ VOL_ ATTE N0 
- ADC1 calibration voltage at atten0
- ADC1_CAL_ VOL_ ATTE N1 
- ADC1 calibration voltage at atten1
- ADC1_CAL_ VOL_ ATTE N2 
- ADC1 calibration voltage at atten2
- ADC1_CAL_ VOL_ ATTE N3 
- ADC1 calibration voltage at atten3
- ADC1_INIT_ CODE_ ATTE N0 
- ADC1 init code at atten0
- ADC1_INIT_ CODE_ ATTE N0_ CH0 
- ADC1 init code at atten0 ch0
- ADC1_INIT_ CODE_ ATTE N0_ CH1 
- ADC1 init code at atten0 ch1
- ADC1_INIT_ CODE_ ATTE N0_ CH2 
- ADC1 init code at atten0 ch2
- ADC1_INIT_ CODE_ ATTE N0_ CH3 
- ADC1 init code at atten0 ch3
- ADC1_INIT_ CODE_ ATTE N0_ CH4 
- ADC1 init code at atten0 ch4
- ADC1_INIT_ CODE_ ATTE N0_ CH5 
- ADC1 init code at atten0 ch5
- ADC1_INIT_ CODE_ ATTE N0_ CH6 
- ADC1 init code at atten0 ch6
- ADC1_INIT_ CODE_ ATTE N1 
- ADC1 init code at atten1
- ADC1_INIT_ CODE_ ATTE N2 
- ADC1 init code at atten2
- ADC1_INIT_ CODE_ ATTE N3 
- ADC1 init code at atten3
- BLK_VERSION_ MAJOR 
- BLK_VERSION_MAJOR of BLOCK2
- BLK_VERSION_ MINOR 
- BLK_VERSION_MINOR of BLOCK2
- BLOCK_KEY0 
- Key0 or user data
- BLOCK_KEY1 
- Key1 or user data
- BLOCK_KEY2 
- Key2 or user data
- BLOCK_KEY3 
- Key3 or user data
- BLOCK_KEY4 
- Key4 or user data
- BLOCK_KEY5 
- Key5 or user data
- BLOCK_SYS_ DATA2 
- System data part 2 (reserved)
- BLOCK_USR_ DATA 
- User data
- CRYPT_DPA_ ENABLE 
- Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled
- CUSTOM_MAC 
- Custom MAC
- DBIAS_VOL_ GAP 
- Stores the hp and lp dbias vol gap
- DISABLE_BLK_ VERSION_ MAJOR 
- Disables check of blk version major
- DISABLE_WAFER_ VERSION_ MAJOR 
- Disables check of wafer version major
- DIS_DIRECT_ BOOT 
- Represents whether direct boot mode is disabled or enabled. 1: disabled. 0: enabled
- DIS_DOWNLOAD_ ICACHE 
- Represents whether icache is disabled or enabled in Download mode. 1: disabled. 0: enabled
- DIS_DOWNLOAD_ MANUAL_ ENCRYPT 
- Represents whether flash encrypt function is disabled or enabled(except in SPI boot mode). 1: disabled. 0: enabled
- DIS_DOWNLOAD_ MODE 
- Represents whether Download mode is disabled or enabled. 1: disabled. 0: enabled
- DIS_FORCE_ DOWNLOAD 
- Represents whether the function that forces chip into download mode is disabled or enabled. 1: disabled. 0: enabled
- DIS_ICACHE 
- Represents whether icache is disabled or enabled. 1: disabled. 0: enabled
- DIS_PAD_ JTAG 
- Represents whether JTAG is disabled in the hard way(permanently). 1: disabled. 0: enabled
- DIS_TWAI 
- Represents whether TWAI function is disabled or enabled. 1: disabled. 0: enabled
- DIS_USB_ JTAG 
- Represents whether the function of usb switch to jtag is disabled or enabled. 1: disabled. 0: enabled
- DIS_USB_ SERIAL_ JTAG 
- Represents whether USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled
- DIS_USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE 
- Represents whether the USB-Serial-JTAG download function is disabled or enabled. 1: disabled. 0: enabled
- DIS_USB_ SERIAL_ JTAG_ ROM_ PRINT 
- Represents whether print from USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled
- DSLP_LP_ DBG 
- Stores the dslp lp dbg
- DSLP_LP_ DBIAS 
- Stores the dslp lp dbias
- ENABLE_SECURITY_ DOWNLOAD 
- Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
- FLASH_CAP 
- FLASH_TEMP 
- FLASH_TPUW 
- 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_VENDOR 
- FORCE_SEND_ RESUME 
- Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
- JTAG_SEL_ ENABLE 
- 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 
- Represents the purpose of Key0
- KEY_PURPOSE_ 1 
- Represents the purpose of Key1
- KEY_PURPOSE_ 2 
- Represents the purpose of Key2
- KEY_PURPOSE_ 3 
- Represents the purpose of Key3
- KEY_PURPOSE_ 4 
- Represents the purpose of Key4
- KEY_PURPOSE_ 5 
- Represents the purpose of Key5
- LSLP_HP_ DBG 
- Stores the lslp hp dbg
- LSLP_HP_ DBIAS 
- Stores the lslp hp dbias
- MAC0
- MAC address
- MAC1
- MAC address
- MAC_EXT
- Stores the extended bits of MAC address
- OCODE
- ADC OCode
- OPTIONAL_UNIQUE_ ID 
- Optional unique 128-bit ID
- PKG_VERSION 
- Package version
- RD_DIS
- Disable reading from BlOCK4-10
- RESERVED_0_ 162 
- reserved
- RESERVED_1_ 136 
- reserved
- RESERVED_2_ 253 
- reserved
- RESERVED_3_ 192 
- reserved
- RESERVED_3_ 248 
- reserved
- RPT4_RESERVE D0_ 0 
- Reserved
- RPT4_RESERVE D0_ 1 
- Reserved
- RPT4_RESERVE D0_ 2 
- Reserved
- RPT4_RESERVE D1_ 0 
- Reserved
- RPT4_RESERVE D2_ 0 
- Reserved
- RPT4_RESERVE D2_ 1 
- Reserved
- RPT4_RESERVE D3_ 0 
- Reserved
- RPT4_RESERVE D3_ 1 
- Reserved
- RPT4_RESERVE D3_ 2 
- Reserved
- RPT4_RESERVE D3_ 3 
- Reserved
- RPT4_RESERVE D3_ 4 
- Reserved
- RPT4_RESERVE D3_ 5 
- Reserved
- RPT4_RESERVE D4_ 0 
- Reserved
- SECURE_BOOT_ AGGRESSIVE_ REVOKE 
- Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled
- SECURE_BOOT_ DISABLE_ FAST_ WAKE 
- Represents whether FAST VERIFY ON WAKE is disabled or enabled when Secure Boot is enabled. 1: disabled. 0: enabled
- SECURE_BOOT_ EN 
- Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled
- SECURE_BOOT_ KEY_ REVOK E0 
- Revoke 1st secure boot key
- SECURE_BOOT_ KEY_ REVOK E1 
- Revoke 2nd secure boot key
- SECURE_BOOT_ KEY_ REVOK E2 
- Revoke 3rd secure boot key
- SECURE_VERSION 
- Represents the version used by ESP-IDF anti-rollback feature
- SEC_DPA_ LEVEL 
- Represents the spa secure level by configuring the clock random divide mode
- SOFT_DIS_ JTAG 
- Represents whether JTAG is disabled in soft way. Odd number: disabled. Even number: enabled
- SPI_BOOT_ CRYPT_ CNT 
- Enables flash encryption when 1 or 3 bits are set and disables otherwise
- SPI_DOWNLOAD_ MSPI_ DIS 
- Represents whether SPI0 controller during boot_mode_download is disabled or enabled. 1: disabled. 0: enabled
- SPI_PAD_ CONF_ 1 
- Stores the first part of SPI_PAD_CONF
- SPI_PAD_ CONF_ 2 
- Stores the second part of SPI_PAD_CONF
- SWAP_UART_ SDIO_ EN 
- Represents whether pad of uart and sdio is swapped or not. 1: swapped. 0: not swapped
- SYS_DATA_ PART0_ 2 
- Stores the second 32 bits of the zeroth part of system data
- TEMP_CALIB 
- Temperature calibration data
- UART_PRINT_ CONTROL 
- Set the default UARTboot message output mode
- USB_DREFH 
- Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV
- USB_DREFL 
- Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV
- USB_EXCHG_ PINS 
- Represents whether the D+ and D- pins is exchanged. 1: exchanged. 0: not exchanged
- VDD_SPI_ AS_ GPIO 
- Represents whether vdd spi pin is functioned as gpio. 1: functioned. 0: not functioned
- WAFER_VERSION_ MAJOR 
- WAFER_VERSION_ MINOR 
- WDT_DELAY_ SEL 
- Represents whether RTC watchdog timeout threshold is selected at startup. 1: selected. 0: not selected
- WR_DIS
- Disable programming of individual eFuses