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-C3)
§Overview
The efuse
module provides functionality for reading eFuse data
from the ESP32-C3
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§
- 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 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 {0: “No calibration”; 1: “With calibration”}- BLK_
VERSION_ MINOR []
BLK_VERSION_MINOR- DIG_
DBIAS_ HVT []
BLOCK1 digital dbias when hvt- DISABLE_
BLK_ VERSION_ MAJOR []
Disables check of blk version major- DISABLE_
WAFER_ VERSION_ MAJOR []
Disables check of wafer version major- DIS_
DIRECT_ BOOT [DIS_LEGACY_SPI_BOOT]
Disable direct boot mode- DIS_
DOWNLOAD_ ICACHE []
Set this bit to disable Icache in download mode (boot_mode[3:0]
is 0; 1; 2; 3; 6; 7)- DIS_
DOWNLOAD_ MANUAL_ ENCRYPT []
Set this bit to disable flash encryption when in download boot modes- DIS_
DOWNLOAD_ MODE []
Set this bit to disable download mode (boot_mode[3:0]
= 0; 1; 2; 3; 6; 7)- DIS_
FORCE_ DOWNLOAD []
Set this bit to disable the function that forces chip into download mode- DIS_
ICACHE []
Set this bit to disable Icache- DIS_
PAD_ JTAG []
Set this bit to disable JTAG in the hard way. JTAG is disabled permanently- DIS_
TWAI [DIS_CAN]
Set this bit to disable TWAI function- DIS_
USB_ JTAG []
Set this bit to disable function of usb switch to jtag in module of usb device- DIS_
USB_ SERIAL_ JTAG [DIS_USB_DEVICE]
USB-Serial-JTAG {0: “Enable”; 1: “Disable”}- DIS_
USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE [DIS_USB_DOWNLOAD_MODE]
Disable UART download mode through USB-Serial-JTAG- DIS_
USB_ SERIAL_ JTAG_ ROM_ PRINT [UART_PRINT_CHANNEL]
USB printing {0: “Enable”; 1: “Disable”}- ENABLE_
SECURITY_ DOWNLOAD []
Set this bit to enable secure UART download mode- ERR_
RST_ ENABLE []
Use BLOCK0 to check error record registers {0: “without check”; 1: “with check”}- FLASH_
CAP []
Flash capacity {0: “None”; 1: “4M”; 2: “2M”; 3: “1M”; 4: “8M”}- FLASH_
TEMP []
Flash temperature {0: “None”; 1: “105C”; 2: “85C”}- FLASH_
TPUW []
Configures flash waiting time after power-up; in unit of ms. If the value is less than 15; the waiting time is the configurable value; Otherwise; the waiting time is twice the configurable value- FLASH_
VENDOR []
Flash vendor {0: “None”; 1: “XMC”; 2: “GD”; 3: “FM”; 4: “TT”; 5: “ZBIT”}- FORCE_
SEND_ RESUME []
Set this bit to force ROM code to send a resume command during SPI boot- JTAG_
SEL_ ENABLE []
Set this bit to enable selection between usb_to_jtag and pad_to_jtag through strapping gpio10 when both reg_dis_usb_jtag and reg_dis_pad_jtag are equal to 0- KEY0
[BLOCK_KEY0]
Key0 or user data- KEY1
[BLOCK_KEY1]
Key1 or user data- KEY2
[BLOCK_KEY2]
Key2 or user data- KEY3
[BLOCK_KEY3]
Key3 or user data- KEY4
[BLOCK_KEY4]
Key4 or user data- KEY5
[BLOCK_KEY5]
Key5 or user data- KEY_
PURPOSE_ 0 [KEY0_PURPOSE]
Purpose of Key0- KEY_
PURPOSE_ 1 [KEY1_PURPOSE]
Purpose of Key1- KEY_
PURPOSE_ 2 [KEY2_PURPOSE]
Purpose of Key2- KEY_
PURPOSE_ 3 [KEY3_PURPOSE]
Purpose of Key3- KEY_
PURPOSE_ 4 [KEY4_PURPOSE]
Purpose of Key4- KEY_
PURPOSE_ 5 [KEY5_PURPOSE]
Purpose of Key5- K_
DIG_ LDO []
BLOCK1 K_DIG_LDO- K_
RTC_ LDO []
BLOCK1 K_RTC_LDO- MAC
[MAC_FACTORY]
MAC address- OCODE
[]
ADC OCode- OPTIONAL_
UNIQUE_ ID []
Optional unique 128-bit ID- PKG_
VERSION []
Package version- RD_DIS
[]
Disable reading from BlOCK4-10- RD_
DIS_ BLOCK_ KEY0 [RD_DIS.KEY0]
rd_dis of BLOCK_KEY0- RD_
DIS_ BLOCK_ KEY1 [RD_DIS.KEY1]
rd_dis of BLOCK_KEY1- RD_
DIS_ BLOCK_ KEY2 [RD_DIS.KEY2]
rd_dis of BLOCK_KEY2- RD_
DIS_ BLOCK_ KEY3 [RD_DIS.KEY3]
rd_dis of BLOCK_KEY3- RD_
DIS_ BLOCK_ KEY4 [RD_DIS.KEY4]
rd_dis of BLOCK_KEY4- RD_
DIS_ BLOCK_ KEY5 [RD_DIS.KEY5]
rd_dis of BLOCK_KEY5- RD_
DIS_ BLOCK_ SYS_ DATA2 [RD_DIS.SYS_DATA_PART2]
rd_dis of BLOCK_SYS_DATA2- SECURE_
BOOT_ AGGRESSIVE_ REVOKE []
Set this bit to enable revoking aggressive secure boot- SECURE_
BOOT_ EN []
Set this bit to enable secure boot- 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 []
Secure version (used by ESP-IDF anti-rollback feature)- SOFT_
DIS_ JTAG []
Set these bits to disable JTAG in the soft way (odd number 1 means disable ). JTAG can be enabled in HMAC module- SPI_
BOOT_ CRYPT_ CNT []
Enables flash encryption when 1 or 3 bits are set and disables otherwise {0: “Disable”; 1: “Enable”; 3: “Disable”; 7: “Enable”}- SPI_
PAD_ CONFIG_ CLK []
SPI PAD CLK- SPI_
PAD_ CONFIG_ CS []
SPI PAD CS- SPI_
PAD_ CONFIG_ D []
SPI PAD D(D0)- SPI_
PAD_ CONFIG_ D4 []
SPI PAD D4- SPI_
PAD_ CONFIG_ D5 []
SPI PAD D5- SPI_
PAD_ CONFIG_ D6 []
SPI PAD D6- SPI_
PAD_ CONFIG_ D7 []
SPI PAD D7- SPI_
PAD_ CONFIG_ DQS []
SPI PAD DQS- SPI_
PAD_ CONFIG_ HD []
SPI PAD HD(D3)- SPI_
PAD_ CONFIG_ Q []
SPI PAD Q(D1)- SPI_
PAD_ CONFIG_ WP []
SPI PAD WP(D2)- SYS_
DATA_ PART2 [BLOCK_SYS_DATA2]
System data part 2 (reserved)- TEMP_
CALIB []
Temperature calibration data- THRES_
HVT []
BLOCK1 pvt threshold when hvt- UART_
PRINT_ CONTROL []
Set the default UARTboot message output mode {0: “Enable”; 1: “Enable when GPIO8 is low at reset”; 2: “Enable when GPIO8 is high at reset”; 3: “Disable”}- USB_
EXCHG_ PINS []
Set this bit to exchange USB D+ and D- pins- USER_
DATA [BLOCK_USR_DATA]
User data- USER_
DATA_ MAC_ CUSTOM [MAC_CUSTOM CUSTOM_MAC]
Custom MAC address- VDD_
SPI_ AS_ GPIO []
Set this bit to vdd spi pin function as gpio- V_
DIG_ DBIA S20 []
BLOCK1 voltage of digital dbias20- V_
RTC_ DBIA S20 []
BLOCK1 voltage of rtc dbias20- WAFER_
VERSION_ MAJOR []
WAFER_VERSION_MAJOR- WAFER_
VERSION_ MINOR_ HI []
WAFER_VERSION_MINOR most significant bit- WAFER_
VERSION_ MINOR_ LO []
WAFER_VERSION_MINOR least significant bits- WDT_
DELAY_ SEL []
RTC watchdog timeout threshold; in unit of slow clock cycle {0: “40000”; 1: “80000”; 2: “160000”; 3: “320000”}- WR_DIS
[]
Disable programming of individual eFuses- WR_
DIS_ ADC1_ CAL_ VOL_ ATTE N0 []
wr_dis of ADC1_CAL_VOL_ATTEN0- WR_
DIS_ ADC1_ CAL_ VOL_ ATTE N1 []
wr_dis of ADC1_CAL_VOL_ATTEN1- WR_
DIS_ ADC1_ CAL_ VOL_ ATTE N2 []
wr_dis of ADC1_CAL_VOL_ATTEN2- WR_
DIS_ ADC1_ CAL_ VOL_ ATTE N3 []
wr_dis of ADC1_CAL_VOL_ATTEN3- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0 []
wr_dis of ADC1_INIT_CODE_ATTEN0- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N1 []
wr_dis of ADC1_INIT_CODE_ATTEN1- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N2 []
wr_dis of ADC1_INIT_CODE_ATTEN2- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N3 []
wr_dis of ADC1_INIT_CODE_ATTEN3- WR_
DIS_ BLK1 []
wr_dis of BLOCK1- WR_
DIS_ BLK_ VERSION_ MAJOR []
wr_dis of BLK_VERSION_MAJOR- WR_
DIS_ BLK_ VERSION_ MINOR []
wr_dis of BLK_VERSION_MINOR- WR_
DIS_ BLOCK_ KEY0 [WR_DIS.KEY0]
wr_dis of BLOCK_KEY0- WR_
DIS_ BLOCK_ KEY1 [WR_DIS.KEY1]
wr_dis of BLOCK_KEY1- WR_
DIS_ BLOCK_ KEY2 [WR_DIS.KEY2]
wr_dis of BLOCK_KEY2- WR_
DIS_ BLOCK_ KEY3 [WR_DIS.KEY3]
wr_dis of BLOCK_KEY3- WR_
DIS_ BLOCK_ KEY4 [WR_DIS.KEY4]
wr_dis of BLOCK_KEY4- WR_
DIS_ BLOCK_ KEY5 [WR_DIS.KEY5]
wr_dis of BLOCK_KEY5- WR_
DIS_ BLOCK_ SYS_ DATA2 [WR_DIS.SYS_DATA_PART2]
wr_dis of BLOCK_SYS_DATA2- WR_
DIS_ BLOCK_ USR_ DATA [WR_DIS.USER_DATA]
wr_dis of BLOCK_USR_DATA- WR_
DIS_ CUSTOM_ MAC [WR_DIS.MAC_CUSTOM WR_DIS.USER_DATA_MAC_CUSTOM]
wr_dis of CUSTOM_MAC- WR_
DIS_ DIG_ DBIAS_ HVT []
wr_dis of DIG_DBIAS_HVT- WR_
DIS_ DISABLE_ BLK_ VERSION_ MAJOR []
wr_dis of DISABLE_BLK_VERSION_MAJOR- WR_
DIS_ DISABLE_ WAFER_ VERSION_ MAJOR []
wr_dis of DISABLE_WAFER_VERSION_MAJOR- WR_
DIS_ DIS_ DIRECT_ BOOT [WR_DIS.DIS_LEGACY_SPI_BOOT]
wr_dis of DIS_DIRECT_BOOT- WR_
DIS_ DIS_ DOWNLOAD_ ICACHE []
wr_dis of DIS_DOWNLOAD_ICACHE- WR_
DIS_ DIS_ DOWNLOAD_ MANUAL_ ENCRYPT []
wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT- WR_
DIS_ DIS_ DOWNLOAD_ MODE []
wr_dis of DIS_DOWNLOAD_MODE- WR_
DIS_ DIS_ FORCE_ DOWNLOAD []
wr_dis of DIS_FORCE_DOWNLOAD- WR_
DIS_ DIS_ ICACHE []
wr_dis of DIS_ICACHE- WR_
DIS_ DIS_ PAD_ JTAG []
wr_dis of DIS_PAD_JTAG- WR_
DIS_ DIS_ TWAI [WR_DIS.DIS_CAN]
wr_dis of DIS_TWAI- WR_
DIS_ DIS_ USB_ JTAG []
wr_dis of DIS_USB_JTAG- WR_
DIS_ DIS_ USB_ SERIAL_ JTAG [WR_DIS.DIS_USB_DEVICE]
wr_dis of DIS_USB_SERIAL_JTAG- WR_
DIS_ DIS_ USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE [WR_DIS.DIS_USB_DOWNLOAD_MODE]
wr_dis of DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE- WR_
DIS_ DIS_ USB_ SERIAL_ JTAG_ ROM_ PRINT [WR_DIS.UART_PRINT_CHANNEL]
wr_dis of DIS_USB_SERIAL_JTAG_ROM_PRINT- WR_
DIS_ ENABLE_ SECURITY_ DOWNLOAD []
wr_dis of ENABLE_SECURITY_DOWNLOAD- WR_
DIS_ ERR_ RST_ ENABLE []
wr_dis of ERR_RST_ENABLE- WR_
DIS_ FLASH_ CAP []
wr_dis of FLASH_CAP- WR_
DIS_ FLASH_ TEMP []
wr_dis of FLASH_TEMP- WR_
DIS_ FLASH_ TPUW []
wr_dis of FLASH_TPUW- WR_
DIS_ FLASH_ VENDOR []
wr_dis of FLASH_VENDOR- WR_
DIS_ FORCE_ SEND_ RESUME []
wr_dis of FORCE_SEND_RESUME- WR_
DIS_ JTAG_ SEL_ ENABLE []
wr_dis of JTAG_SEL_ENABLE- WR_
DIS_ KEY_ PURPOSE_ 0 [WR_DIS.KEY0_PURPOSE]
wr_dis of KEY_PURPOSE_0- WR_
DIS_ KEY_ PURPOSE_ 1 [WR_DIS.KEY1_PURPOSE]
wr_dis of KEY_PURPOSE_1- WR_
DIS_ KEY_ PURPOSE_ 2 [WR_DIS.KEY2_PURPOSE]
wr_dis of KEY_PURPOSE_2- WR_
DIS_ KEY_ PURPOSE_ 3 [WR_DIS.KEY3_PURPOSE]
wr_dis of KEY_PURPOSE_3- WR_
DIS_ KEY_ PURPOSE_ 4 [WR_DIS.KEY4_PURPOSE]
wr_dis of KEY_PURPOSE_4- WR_
DIS_ KEY_ PURPOSE_ 5 [WR_DIS.KEY5_PURPOSE]
wr_dis of KEY_PURPOSE_5- WR_
DIS_ K_ DIG_ LDO []
wr_dis of K_DIG_LDO- WR_
DIS_ K_ RTC_ LDO []
wr_dis of K_RTC_LDO- WR_
DIS_ MAC [WR_DIS.MAC_FACTORY]
wr_dis of MAC- WR_
DIS_ OCODE []
wr_dis of OCODE- WR_
DIS_ OPTIONAL_ UNIQUE_ ID []
wr_dis of OPTIONAL_UNIQUE_ID- WR_
DIS_ PKG_ VERSION []
wr_dis of PKG_VERSION- WR_
DIS_ RD_ DIS []
wr_dis of RD_DIS- WR_
DIS_ SECURE_ BOOT_ AGGRESSIVE_ REVOKE []
wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE- WR_
DIS_ SECURE_ BOOT_ EN []
wr_dis of SECURE_BOOT_EN- WR_
DIS_ SECURE_ BOOT_ KEY_ REVOK E0 []
wr_dis of SECURE_BOOT_KEY_REVOKE0- WR_
DIS_ SECURE_ BOOT_ KEY_ REVOK E1 []
wr_dis of SECURE_BOOT_KEY_REVOKE1- WR_
DIS_ SECURE_ BOOT_ KEY_ REVOK E2 []
wr_dis of SECURE_BOOT_KEY_REVOKE2- WR_
DIS_ SECURE_ VERSION []
wr_dis of SECURE_VERSION- WR_
DIS_ SOFT_ DIS_ JTAG []
wr_dis of SOFT_DIS_JTAG- WR_
DIS_ SPI_ BOOT_ CRYPT_ CNT []
wr_dis of SPI_BOOT_CRYPT_CNT- WR_
DIS_ SPI_ PAD_ CONFIG_ CLK []
wr_dis of SPI_PAD_CONFIG_CLK- WR_
DIS_ SPI_ PAD_ CONFIG_ CS []
wr_dis of SPI_PAD_CONFIG_CS- WR_
DIS_ SPI_ PAD_ CONFIG_ D []
wr_dis of SPI_PAD_CONFIG_D- WR_
DIS_ SPI_ PAD_ CONFIG_ D4 []
wr_dis of SPI_PAD_CONFIG_D4- WR_
DIS_ SPI_ PAD_ CONFIG_ D5 []
wr_dis of SPI_PAD_CONFIG_D5- WR_
DIS_ SPI_ PAD_ CONFIG_ D6 []
wr_dis of SPI_PAD_CONFIG_D6- WR_
DIS_ SPI_ PAD_ CONFIG_ D7 []
wr_dis of SPI_PAD_CONFIG_D7- WR_
DIS_ SPI_ PAD_ CONFIG_ DQS []
wr_dis of SPI_PAD_CONFIG_DQS- WR_
DIS_ SPI_ PAD_ CONFIG_ HD []
wr_dis of SPI_PAD_CONFIG_HD- WR_
DIS_ SPI_ PAD_ CONFIG_ Q []
wr_dis of SPI_PAD_CONFIG_Q- WR_
DIS_ SPI_ PAD_ CONFIG_ WP []
wr_dis of SPI_PAD_CONFIG_WP- WR_
DIS_ SYS_ DATA_ PART1 []
wr_dis of BLOCK2- WR_
DIS_ TEMP_ CALIB []
wr_dis of TEMP_CALIB- WR_
DIS_ THRES_ HVT []
wr_dis of THRES_HVT- WR_
DIS_ UART_ PRINT_ CONTROL []
wr_dis of UART_PRINT_CONTROL- WR_
DIS_ USB_ EXCHG_ PINS []
wr_dis of USB_EXCHG_PINS- WR_
DIS_ VDD_ SPI_ AS_ GPIO []
wr_dis of VDD_SPI_AS_GPIO- WR_
DIS_ V_ DIG_ DBIA S20 []
wr_dis of V_DIG_DBIAS20- WR_
DIS_ V_ RTC_ DBIA S20 []
wr_dis of V_RTC_DBIAS20- WR_
DIS_ WAFER_ VERSION_ MAJOR []
wr_dis of WAFER_VERSION_MAJOR- WR_
DIS_ WAFER_ VERSION_ MINOR_ HI []
wr_dis of WAFER_VERSION_MINOR_HI- WR_
DIS_ WAFER_ VERSION_ MINOR_ LO []
wr_dis of WAFER_VERSION_MINOR_LO- WR_
DIS_ WDT_ DELAY_ SEL []
wr_dis of WDT_DELAY_SEL