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§
- 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 active hp dbias
- ACTIVE_
LP_ DBIAS unstable - Stores the active lp dbias
- ADC1_
CAL_ VOL_ ATTE N0 unstable - ADC1 calibration voltage at atten0
- ADC1_
CAL_ VOL_ ATTE N1 unstable - ADC1 calibration voltage at atten1
- ADC1_
CAL_ VOL_ ATTE N2 unstable - ADC1 calibration voltage at atten2
- ADC1_
CAL_ VOL_ ATTE N3 unstable - ADC1 calibration voltage at atten3
- ADC1_
INIT_ CODE_ ATTE N0 unstable - ADC1 init code at atten0
- ADC1_
INIT_ CODE_ ATTE N0_ CH0 unstable - ADC1 init code at atten0 ch0
- ADC1_
INIT_ CODE_ ATTE N0_ CH1 unstable - ADC1 init code at atten0 ch1
- ADC1_
INIT_ CODE_ ATTE N0_ CH2 unstable - ADC1 init code at atten0 ch2
- ADC1_
INIT_ CODE_ ATTE N0_ CH3 unstable - ADC1 init code at atten0 ch3
- ADC1_
INIT_ CODE_ ATTE N0_ CH4 unstable - ADC1 init code at atten0 ch4
- ADC1_
INIT_ CODE_ ATTE N0_ CH5 unstable - ADC1 init code at atten0 ch5
- ADC1_
INIT_ CODE_ ATTE N0_ CH6 unstable - ADC1 init code at atten0 ch6
- ADC1_
INIT_ CODE_ ATTE N1 unstable - ADC1 init code at atten1
- ADC1_
INIT_ CODE_ ATTE N2 unstable - ADC1 init code at atten2
- ADC1_
INIT_ CODE_ ATTE N3 unstable - ADC1 init code at 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
- 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 hp and lp 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_ ICACHE unstable - Represents whether icache is disabled or enabled in Download mode. 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 - Represents whether print from USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled
- DSLP_
LP_ DBG unstable - Stores the dslp lp dbg
- DSLP_
LP_ DBIAS unstable - Stores the dslp lp dbias
- ENABLE_
SECURITY_ DOWNLOAD unstable - Represents whether security download is enabled or disabled. 1: enabled. 0: disabled
- FLASH_
CAP unstable - FLASH_
TEMP unstable - 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 - FORCE_
SEND_ RESUME unstable - Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced
- 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
- LSLP_
HP_ DBG unstable - Stores the lslp hp dbg
- LSLP_
HP_ DBIAS unstable - Stores the lslp hp dbias
- MAC0
unstable - MAC address
- MAC1
unstable - MAC address
- MAC_EXT
unstable - Stores the extended bits of MAC address
- OCODE
unstable - ADC OCode
- OPTIONAL_
UNIQUE_ ID unstable - Optional unique 128-bit ID
- PKG_
VERSION unstable - Package version
- RD_DIS
unstable - Disable reading from BlOCK4-10
- RESERVED_
0_ 162 unstable - reserved
- RESERVED_
1_ 136 unstable - reserved
- RESERVED_
2_ 253 unstable - reserved
- RESERVED_
3_ 192 unstable - reserved
- RESERVED_
3_ 248 unstable - reserved
- RPT4_
RESERVE D0_ 0 unstable - Reserved
- RPT4_
RESERVE D0_ 1 unstable - Reserved
- RPT4_
RESERVE D0_ 2 unstable - Reserved
- RPT4_
RESERVE D1_ 0 unstable - Reserved
- RPT4_
RESERVE D2_ 0 unstable - Reserved
- RPT4_
RESERVE D2_ 1 unstable - Reserved
- RPT4_
RESERVE D3_ 0 unstable - Reserved
- RPT4_
RESERVE D3_ 1 unstable - Reserved
- RPT4_
RESERVE D3_ 2 unstable - Reserved
- RPT4_
RESERVE D3_ 3 unstable - Reserved
- RPT4_
RESERVE D3_ 4 unstable - Reserved
- RPT4_
RESERVE D3_ 5 unstable - Reserved
- RPT4_
RESERVE D4_ 0 unstable - Reserved
- 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
- SPI_
PAD_ CONF_ 1 unstable - Stores the first part of SPI_PAD_CONF
- SPI_
PAD_ CONF_ 2 unstable - Stores the second part of SPI_PAD_CONF
- SWAP_
UART_ SDIO_ EN unstable - Represents whether pad of uart and sdio is swapped or not. 1: swapped. 0: not swapped
- 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 - WAFER_
VERSION_ MINOR unstable - 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
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 - Get ADC reference point digital code for specified attenuation
- 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.