1 /*
2  * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include <esp_types.h>
10 #include <esp_err.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /**
17  * @brief Type of eFuse blocks for ESP32
18  */
19 typedef enum {
20     EFUSE_BLK0              = 0, /**< Number of eFuse block. Reserved. */
21 
22     EFUSE_BLK1              = 1, /**< Number of eFuse block. Used for Flash Encryption. If not using that Flash Encryption feature, they can be used for another purpose. */
23     EFUSE_BLK_KEY0          = 1, /**< Number of eFuse block. Used for Flash Encryption. If not using that Flash Encryption feature, they can be used for another purpose. */
24     EFUSE_BLK_ENCRYPT_FLASH = 1, /**< Number of eFuse block. Used for Flash Encryption. If not using that Flash Encryption feature, they can be used for another purpose. */
25 
26     EFUSE_BLK2              = 2, /**< Number of eFuse block. Used for Secure Boot. If not using that Secure Boot feature, they can be used for another purpose. */
27     EFUSE_BLK_KEY1          = 2, /**< Number of eFuse block. Used for Secure Boot. If not using that Secure Boot feature, they can be used for another purpose. */
28     EFUSE_BLK_SECURE_BOOT   = 2, /**< Number of eFuse block. Used for Secure Boot. If not using that Secure Boot feature, they can be used for another purpose. */
29 
30     EFUSE_BLK3              = 3, /**< Number of eFuse block. Uses for the purpose of the user. */
31     EFUSE_BLK_KEY2          = 3, /**< Number of eFuse block. Uses for the purpose of the user. */
32     EFUSE_BLK_KEY_MAX       = 4,
33 
34     EFUSE_BLK_MAX           = 4,
35 } esp_efuse_block_t;
36 
37 /**
38  * @brief Type of coding scheme
39  */
40 typedef enum {
41     EFUSE_CODING_SCHEME_NONE    = 0,    /**< None */
42     EFUSE_CODING_SCHEME_3_4     = 1,    /**< 3/4 coding */
43     EFUSE_CODING_SCHEME_REPEAT  = 2,    /**< Repeat coding */
44 } esp_efuse_coding_scheme_t;
45 
46 /**
47  * @brief Type of key purpose (virtual because ESP32 has only fixed purposes for blocks)
48  */
49 typedef enum {
50     ESP_EFUSE_KEY_PURPOSE_USER = 0,              /**< BLOCK3 */
51     ESP_EFUSE_KEY_PURPOSE_SYSTEM = 1,            /**< BLOCK0 */
52     ESP_EFUSE_KEY_PURPOSE_FLASH_ENCRYPTION = 2,  /**< BLOCK1 */
53     ESP_EFUSE_KEY_PURPOSE_SECURE_BOOT_V2 = 3,    /**< BLOCK2 */
54     ESP_EFUSE_KEY_PURPOSE_MAX,                   /**< MAX PURPOSE*/
55 } esp_efuse_purpose_t;
56 
57 #ifdef __cplusplus
58 }
59 #endif
60