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§
- Chip
Type unstable - Representing different types of ESP32 chips.
- Interface
MacAddress - Interface selection for
interface_mac_address. - SetMac
Error unstable - Error indicating issues with setting the MAC address.
Constants§
- ABS_
DONE_ 0 unstable - Secure boot V1 is enabled for bootloader image
- ABS_
DONE_ 1 unstable - Secure boot V2 is enabled for bootloader image
- ADC1_
TP_ HIGH unstable - ADC1 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
- ADC1_
TP_ LOW unstable - ADC1 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
- ADC2_
TP_ HIGH unstable - ADC2 Two Point calibration high point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
- ADC2_
TP_ LOW unstable - ADC2 Two Point calibration low point. Only valid if EFUSE_RD_BLK3_PART_RESERVE
- ADC_
VREF unstable - True ADC reference voltage
- BLK3_
PART_ RESERVE unstable - BLOCK3 partially served for ADC calibration data
- BLK3_
RESERVED_ 2 unstable - read for BLOCK3
- BLK3_
RESERVED_ 6 unstable - read for BLOCK3
- BLK3_
RESERVED_ 7 unstable - read for BLOCK3
- BLOCK1
unstable - Flash encryption key
- BLOCK2
unstable - Security boot key
- CHIP_
CPU_ FREQ_ LOW unstable - If set alongside EFUSE_RD_CHIP_CPU_FREQ_RATED; the ESP32’s max CPU frequency is rated for 160MHz. 240MHz otherwise
- CHIP_
CPU_ FREQ_ RATED unstable - If set; the ESP32’s maximum CPU frequency has been rated
- CHIP_
PACKAGE unstable - Chip package identifier
- CHIP_
PACKAGE_ 4BIT unstable - Chip package identifier #4bit
- CHIP_
VER_ REV1 unstable - bit is set to 1 for rev1 silicon
- CHIP_
VER_ REV2 unstable - CLK8M_
FREQ unstable - 8MHz clock freq override
- CODING_
SCHEME unstable - Efuse variable block length scheme
- CONSOLE_
DEBUG_ DISABLE unstable - Disable ROM BASIC interpreter fallback
- CUSTOM_
MAC unstable - Custom MAC address
- CUSTOM_
MAC_ CRC unstable - CRC8 for custom MAC address
- DISABLE_
APP_ CPU unstable - Disables APP CPU
- DISABLE_
BT unstable - Disables Bluetooth
- DISABLE_
DL_ CACHE unstable - Disable flash cache in UART bootloader
- DISABLE_
DL_ DECRYPT unstable - Disable flash decryption in UART bootloader
- DISABLE_
DL_ ENCRYPT unstable - Disable flash encryption in UART bootloader
- DISABLE_
SDIO_ HOST unstable - DIS_
CACHE unstable - Disables cache
- FLASH_
CRYPT_ CNT unstable - Flash encryption is enabled if this field has an odd number of bits set
- FLASH_
CRYPT_ CONFIG unstable - Flash encryption config (key tweak bits)
- JTAG_
DISABLE unstable - Disable JTAG
- KEY_
STATUS unstable - Usage of efuse block 3 (reserved)
- MAC0
unstable - MAC address
- MAC1
unstable - MAC address
- MAC_CRC
unstable - CRC8 for MAC address
- MAC_
VERSION unstable - Version of the MAC field
- RD_DIS
unstable - Disable reading from BlOCK1-3
- RESERVED_
0_ 28 unstable - reserved
- RESERVED_
3_ 56 unstable - reserved
- RESERVED_
3_ 160 unstable - reserved
- RESERVE_
0_ 88 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 112 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 141 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 145 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 181 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 186 unstable - Reserved; it was created by set_missed_fields_in_regs func
- RESERVE_
0_ 203 unstable - Reserved; it was created by set_missed_fields_in_regs func
- SECURE_
VERSION unstable - Secure version for anti-rollback
- SPI_
PAD_ CONFIG_ CLK unstable - Override SD_CLK pad (GPIO6/SPICLK)
- SPI_
PAD_ CONFIG_ CS0 unstable - Override SD_CMD pad (GPIO11/SPICS0)
- SPI_
PAD_ CONFIG_ D unstable - Override SD_DATA_1 pad (GPIO8/SPID)
- SPI_
PAD_ CONFIG_ HD unstable - read for SPI_pad_config_hd
- SPI_
PAD_ CONFIG_ Q unstable - Override SD_DATA_0 pad (GPIO7/SPIQ)
- UART_
DOWNLOAD_ DIS unstable - Disable UART download mode. Valid for ESP32 V3 and newer; only
- VOL_
LEVEL_ HP_ INV unstable - This field stores the voltage level for CPU to run at 240 MHz; or for flash/PSRAM to run at 80 MHz.0x0: level 7; 0x1: level 6; 0x2: level 5; 0x3: level 4. (RO)
- WAFER_
VERSION_ MINOR unstable - WR_DIS
unstable - Efuse write disable mask
- XPD_
SDIO_ FORCE unstable - Ignore MTDI pin (GPIO12) for VDD_SDIO on reset
- XPD_
SDIO_ REG unstable - read for XPD_SDIO_REG
- XPD_
SDIO_ TIEH unstable - If XPD_SDIO_FORCE & XPD_SDIO_REG
Functions§
- base_
mac_ address unstable - Returns the base MAC address programmed into eFuse during manufacturing.
- chip_
revision - Returns the hardware revision.
- chip_
type unstable - Returns the CHIP_VER_PKG eFuse value.
- core_
count unstable - Returns the number of CPUs available on the chip.
- 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.
- is_
bluetooth_ enabled unstable - Returns the CHIP_VER_DIS_BT eFuse value.
- major_
chip_ version unstable - Returns the major hardware revision
- max_
cpu_ frequency unstable - Returns the maximum rated clock of the CPU in MHz.
- 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