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::Bluetooth);
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§
- AdcCalib
Unit unstable - Selects which ADC we are interested in the efuse calibration data for
- Interface
MacAddress - Interface selection for
interface_mac_address. - SetMac
Error unstable - Error indicating issues with setting the MAC address.
Constants§
- ACTIVE_
HP_ DBIAS unstable - Stores the PMU active hp dbias
- ACTIVE_
LP_ DBIAS unstable - Stores the PMU active lp dbias
- ADC1_
AVE_ INITCODE_ ATTE N0 unstable - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N1 unstable - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N2 unstable - ADC1 calibration data
- ADC1_
AVE_ INITCODE_ ATTE N3 unstable - ADC1 calibration data
- ADC1_
CH0_ ATTE N0_ INITCODE_ DIFF unstable - ADC1 calibration data
- ADC1_
CH1_ ATTE N0_ INITCODE_ DIFF unstable - ADC1 calibration data
- ADC1_
CH2_ ATTE N0_ INITCODE_ DIFF unstable - ADC1 calibration data
- ADC1_
CH3_ ATTE N0_ INITCODE_ DIFF unstable - ADC1 calibration data
- ADC1_
CH4_ ATTE N0_ INITCODE_ DIFF unstable - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N0 unstable - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N1 unstable - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N2 unstable - ADC1 calibration data
- ADC1_
HI_ DOUT_ ATTE N3 unstable - ADC1 calibration data
- BLK_
VERSION_ MAJOR unstable - BLK_VERSION_MAJOR of BLOCK2
- BLK_
VERSION_ MINOR unstable - BLK_VERSION_MINOR of BLOCK2. 1: RF Calibration data in BLOCK1
- 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
- CRYPT_
DPA_ ENABLE unstable - Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled
- CUSTOM_
MAC unstable - Custom MAC
- DBIAS_
VOL_ GAP unstable - Stores the low 1 bit of dbias_vol_gap
- 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: disabled. 0: enabled
- 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 disabled or enabled. 1: disabled. 0: enabled
- 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 icache is disabled or enabled. 1: disabled. 0: enabled
- DIS_
PAD_ JTAG unstable - Represents whether JTAG is disabled in the hard way(permanently). 1: disabled. 0: enabled
- DIS_
TWAI unstable - Represents whether TWAI function is disabled or enabled. 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: disabled. 0: enabled
- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT unstable - Set this bit to disable USB-Serial-JTAG print during rom boot
- DSLP_
DBIAS unstable - Stores the PMU sleep dbias
- ECC_
FORCE_ CONST_ TIME unstable - Set this bit to permanently turn on ECC const-time mode
- ECDSA_
CURVE_ MODE unstable - 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 unstable - Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
- FLASH_
CAP unstable - Stores the flash cap
- FLASH_
TEMP unstable - Stores the flash temp
- 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 the programmed value. Otherwise; the waiting time is 2 times the programmed value
- FLASH_
VENDOR unstable - Stores the flash vendor
- FORCE_
SEND_ RESUME unstable - Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
- HYS_
EN_ PAD0 unstable - Set bits to enable hysteresis function of PAD0~5
- HYS_
EN_ PAD1 unstable - Set bits to enable hysteresis function of PAD6~27
- JTAG_
SEL_ ENABLE unstable - 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 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
- MAC0
unstable - MAC address
- MAC1
unstable - MAC address
- MAC_EXT
unstable - Stores the extended bits of MAC address
- MAC_
RESERVED_ 2 unstable - Reserved
- OPTIONAL_
UNIQUE_ ID unstable - Optional unique 128-bit ID
- PKG_
VERSION unstable - Package version
- POWERGLITCH_
EN unstable - Represents whether power glitch function is enabled. 1: enabled. 0: disabled
- POWERGLITCH_
EN1 unstable - Set these bits to enable power glitch function when chip power on
- RD_DIS
unstable - Disable reading from BlOCK4-10
- RESERVED_
0_ 123 unstable - reserved
- RESERVED_
1_ 131 unstable - reserved
- RESERVED_
2_ 128 unstable - reserved
- RESERVED_
2_ 245 unstable - reserved
- RESERVED_
3_ 192 unstable - reserved
- RESERVED_
3_ 248 unstable - reserved
- RESERVE_
0_ 114 unstable - Reserved
- RPT4_
RESERVE D0_ 4 unstable - Reserved
- RPT4_
RESERVE D1_ 1 unstable - Reserved
- RPT4_
RESERVE D3_ 5 unstable - Reserved
- RPT4_
RESERVE D4_ 0 unstable - Reserved
- RPT4_
RESERVE D4_ 1 unstable - Reserved
- RXIQ_0
unstable - Stores RF Calibration data. RXIQ data 0
- RXIQ_1
unstable - Stores RF Calibration data. RXIQ data 1
- RXIQ_
VERSION unstable - Stores RF Calibration data. RXIQ version
- SECURE_
BOOT_ AGGRESSIVE_ REVOKE unstable - Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled
- SECURE_
BOOT_ DISABLE_ FAST_ WAKE unstable - Represents whether FAST VERIFY ON WAKE is disabled or enabled when Secure Boot is enabled. 1: disabled. 0: enabled
- SECURE_
BOOT_ EN unstable - Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled
- 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
- SOFT_
DIS_ JTAG unstable - Represents whether JTAG is disabled in soft way. Odd number: disabled. Even number: enabled
- 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_ 2 unstable - Stores the second 32 bits of the zeroth part of system data
- TEMP_
CALIB unstable - Temperature calibration data
- UART_
PRINT_ CONTROL unstable - Set the default UARTboot message output mode
- USB_
DREFH unstable - Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV
- USB_
DREFL unstable - Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV
- USB_
EXCHG_ PINS unstable - Represents whether the D+ and D- pins 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 - Stores the wafer version major
- WAFER_
VERSION_ MINOR unstable - Stores the wafer version minor
- WDT_
DELAY_ SEL unstable - Represents whether RTC watchdog timeout threshold is selected at startup. 1: selected. 0: not selected
- WR_DIS
unstable - Disable programming of individual eFuses
- XTS_
DPA_ PSEUDO_ LEVEL unstable - 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
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_ cal_ code unstable - Returns the call code
- rtc_
calib_ cal_ mv unstable - Get ADC reference point voltage for specified attenuation in millivolts
- rtc_
calib_ init_ code unstable - Get ADC initial code for specified attenuation from efuse
- 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.