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-C6)
§Overview
The efuse
module provides functionality for reading eFuse data
from the ESP32-C6
chip, allowing access to various chip-specific
information such as:
- MAC address
- ADC calibration data
- Chip version
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 active hp dbias- ACTIVE_
LP_ DBIAS []
Stores the active lp dbias- 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 N0_ CH0 []
ADC1 init code at atten0 ch0- ADC1_
INIT_ CODE_ ATTE N0_ CH1 []
ADC1 init code at atten0 ch1- ADC1_
INIT_ CODE_ ATTE N0_ CH2 []
ADC1 init code at atten0 ch2- ADC1_
INIT_ CODE_ ATTE N0_ CH3 []
ADC1 init code at atten0 ch3- ADC1_
INIT_ CODE_ ATTE N0_ CH4 []
ADC1 init code at atten0 ch4- ADC1_
INIT_ CODE_ ATTE N0_ CH5 []
ADC1 init code at atten0 ch5- ADC1_
INIT_ CODE_ ATTE N0_ CH6 []
ADC1 init code at atten0 ch6- 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- BLK_
VERSION_ MINOR []
BLK_VERSION_MINOR of BLOCK2- CRYPT_
DPA_ ENABLE []
Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled- DBIAS_
VOL_ GAP []
Stores the hp and lp 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_ ICACHE []
Represents whether icache is disabled or enabled in Download mode. 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 [DIS_CAN]
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 [DIS_USB_PRINT]
Represents whether print from USB-Serial-JTAG is disabled or enabled. 1: disabled. 0: enabled- DSLP_
LP_ DBG []
Stores the dslp lp dbg- DSLP_
LP_ DBIAS []
Stores the dslp lp dbias- ENABLE_
SECURITY_ DOWNLOAD []
Represents whether security download is enabled or disabled. 1: enabled. 0: disabled- FLASH_
CAP []
- 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 []
- FORCE_
SEND_ RESUME []
Represents whether ROM code is forced to send a resume command during SPI boot. 1: forced. 0:not forced- JTAG_
SEL_ ENABLE []
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- 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]
Represents the purpose of Key0- KEY_
PURPOSE_ 1 [KEY1_PURPOSE]
Represents the purpose of Key1- KEY_
PURPOSE_ 2 [KEY2_PURPOSE]
Represents the purpose of Key2- KEY_
PURPOSE_ 3 [KEY3_PURPOSE]
Represents the purpose of Key3- KEY_
PURPOSE_ 4 [KEY4_PURPOSE]
Represents the purpose of Key4- KEY_
PURPOSE_ 5 [KEY5_PURPOSE]
Represents the purpose of Key5- LSLP_
HP_ DBG []
Stores the lslp hp dbg- LSLP_
HP_ DBIAS []
Stores the lslp hp dbias- MAC
[MAC_FACTORY]
MAC address- MAC_EXT
[]
Stores the extended bits of 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 []
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 [DPA_SEC_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 {0: “Disable”; 1: “Enable”; 3: “Disable”; 7: “Enable”}- SPI_
DOWNLOAD_ MSPI_ DIS []
Represents whether SPI0 controller during boot_mode_download is disabled or enabled. 1: disabled. 0: enabled- SWAP_
UART_ SDIO_ EN []
Represents whether pad of uart and sdio is swapped or not. 1: swapped. 0: not swapped- SYS_
DATA_ PART2 [BLOCK_SYS_DATA2]
System data part 2 (reserved)- TEMP_
CALIB []
Temperature calibration data- 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 []
Represents whether the D+ and D- pins is exchanged. 1: exchanged. 0: not exchanged- USER_
DATA [BLOCK_USR_DATA]
User data- USER_
DATA_ MAC_ CUSTOM [MAC_CUSTOM CUSTOM_MAC]
Custom MAC- VDD_
SPI_ AS_ GPIO []
Represents whether vdd spi pin is functioned as gpio. 1: functioned. 0: not functioned- WAFER_
VERSION_ MAJOR []
- 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- WR_
DIS_ ACTIVE_ HP_ DBIAS []
wr_dis of ACTIVE_HP_DBIAS- WR_
DIS_ ACTIVE_ LP_ DBIAS []
wr_dis of ACTIVE_LP_DBIAS- 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 N0_ CH0 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH0- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH1 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH1- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH2 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH2- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH3 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH3- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH4 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH4- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH5 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH5- WR_
DIS_ ADC1_ INIT_ CODE_ ATTE N0_ CH6 []
wr_dis of ADC1_INIT_CODE_ATTEN0_CH6- 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_ CRYPT_ DPA_ ENABLE []
wr_dis of CRYPT_DPA_ENABLE- WR_
DIS_ CUSTOM_ MAC [WR_DIS.MAC_CUSTOM WR_DIS.USER_DATA_MAC_CUSTOM]
wr_dis of CUSTOM_MAC- WR_
DIS_ DBIAS_ VOL_ GAP []
wr_dis of DBIAS_VOL_GAP- 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 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 of DIS_USB_SERIAL_JTAG- WR_
DIS_ DIS_ USB_ SERIAL_ JTAG_ DOWNLOAD_ MODE []
wr_dis of DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE- WR_
DIS_ DIS_ USB_ SERIAL_ JTAG_ ROM_ PRINT [WR_DIS.DIS_USB_PRINT]
wr_dis of DIS_USB_SERIAL_JTAG_ROM_PRINT- WR_
DIS_ DSLP_ LP_ DBG []
wr_dis of DSLP_LP_DBG- WR_
DIS_ DSLP_ LP_ DBIAS []
wr_dis of DSLP_LP_DBIAS- WR_
DIS_ ENABLE_ SECURITY_ DOWNLOAD []
wr_dis of ENABLE_SECURITY_DOWNLOAD- 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_ LSLP_ HP_ DBG []
wr_dis of LSLP_HP_DBG- WR_
DIS_ LSLP_ HP_ DBIAS []
wr_dis of LSLP_HP_DBIAS- WR_
DIS_ MAC [WR_DIS.MAC_FACTORY]
wr_dis of MAC- WR_
DIS_ MAC_ EXT []
wr_dis of MAC_EXT- 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_ DISABLE_ FAST_ WAKE []
wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE- 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_ SEC_ DPA_ LEVEL [WR_DIS.DPA_SEC_LEVEL]
wr_dis of SEC_DPA_LEVEL- 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_ DOWNLOAD_ MSPI_ DIS []
wr_dis of SPI_DOWNLOAD_MSPI_DIS- WR_
DIS_ SWAP_ UART_ SDIO_ EN []
wr_dis of SWAP_UART_SDIO_EN- WR_
DIS_ SYS_ DATA_ PART1 []
wr_dis of BLOCK2- WR_
DIS_ TEMP_ CALIB []
wr_dis of TEMP_CALIB- 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_ WAFER_ VERSION_ MAJOR []
wr_dis of WAFER_VERSION_MAJOR- WR_
DIS_ WAFER_ VERSION_ MINOR []
wr_dis of WAFER_VERSION_MINOR- WR_
DIS_ WDT_ DELAY_ SEL []
wr_dis of WDT_DELAY_SEL