Available on crate feature
unstable
only.Expand description
§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.
§Reading of eFuses (ESP32-H2)
§Overview
The efuse
module provides functionality for reading eFuse data
from the ESP32-H2
chip, allowing access to various chip-specific
information such as:
- MAC address
- ADC calibration data
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.
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());
Structs§
- Efuse
- A struct representing the eFuse functionality of the chip.
Constants§
- ACTIVE_
HP_ DBIAS - Stores the PMU active hp dbias
- ACTIVE_
LP_ DBIAS - Stores the PMU active lp dbias
- ADC1_
AVE_ INITCODE_ ATTE N0 - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N1 - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N2 - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N3 - ADC1 calibration data
- ADC1_
CH0_ ATTE N0_ INITCODE_ DIFF - ADC1 calibration data
- ADC1_
CH1_ ATTE N0_ INITCODE_ DIFF - ADC1 calibration data
- ADC1_
CH2_ ATTE N0_ INITCODE_ DIFF - ADC1 calibration data
- ADC1_
CH3_ ATTE N0_ INITCODE_ DIFF - ADC1 calibration data
- ADC1_
CH4_ ATTE N0_ INITCODE_ DIFF - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N0 - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N1 - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N2 - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N3 - ADC1 calibration data
- BLK_
VERSION_ MAJOR - BLK_VERSION_MAJOR of BLOCK2
- BLK_
VERSION_ MINOR - BLK_VERSION_MINOR of BLOCK2. 1: RF Calibration data in BLOCK1
- 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 low 1 bit of 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_ 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 - Set this bit to disable USB-Serial-JTAG print during rom boot
- DSLP_
DBIAS - Stores the PMU sleep dbias
- ECC_
FORCE_ CONST_ TIME - Set this bit to permanently turn on ECC const-time mode
- ECDSA_
CURVE_ MODE - Configures the curve of ECDSA calculation: 0: only enable P256. 1: only enable P192. 2: both enable P256 and P192. 3: only enable P256
- ENABLE_
SECURITY_ DOWNLOAD - Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
- FLASH_
CAP - Stores the flash cap
- FLASH_
TEMP - Stores the 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 - Stores the flash vendor
- FORCE_
SEND_ RESUME - Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
- HYS_
EN_ PAD0 - Set bits to enable hysteresis function of PAD0~5
- HYS_
EN_ PAD1 - Set bits to enable hysteresis function of PAD6~27
- JTAG_
SEL_ ENABLE - Set this bit to enable selection between usb_to_jtag and pad_to_jtag through strapping gpio25 when both EFUSE_DIS_PAD_JTAG and EFUSE_DIS_USB_JTAG are equal to 0
- 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
- MAC0
- MAC address
- MAC1
- MAC address
- MAC_EXT
- Stores the extended bits of MAC address
- MAC_
RESERVED_ 2 - Reserved
- OPTIONAL_
UNIQUE_ ID - Optional unique 128-bit ID
- PKG_
VERSION - Package version
- POWERGLITCH_
EN - Represents whether power glitch function is enabled. 1: enabled. 0: disabled
- POWERGLITCH_
EN1 - Set these bits to enable power glitch function when chip power on
- RD_DIS
- Disable reading from BlOCK4-10
- RESERVED_
0_ 123 - reserved
- RESERVED_
1_ 131 - reserved
- RESERVED_
2_ 128 - reserved
- RESERVED_
2_ 245 - reserved
- RESERVED_
3_ 192 - reserved
- RESERVED_
3_ 248 - reserved
- RESERVE_
0_ 114 - Reserved
- RPT4_
RESERVE D0_ 4 - Reserved
- RPT4_
RESERVE D1_ 1 - Reserved
- RPT4_
RESERVE D3_ 5 - Reserved
- RPT4_
RESERVE D4_ 0 - Reserved
- RPT4_
RESERVE D4_ 1 - Reserved
- RXIQ_0
- Stores RF Calibration data. RXIQ data 0
- RXIQ_1
- Stores RF Calibration data. RXIQ data 1
- RXIQ_
VERSION - Stores RF Calibration data. RXIQ version
- 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
- 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 - Stores the wafer version major
- WAFER_
VERSION_ MINOR - Stores the 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
- XTS_
DPA_ PSEUDO_ LEVEL - Set this bit to control the xts pseudo-round anti-dpa attack function: 0: controlled by register. 1-3: the higher the value is; the more pseudo-rounds are inserted to the xts-aes calculation