esp_efuse_chip.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <esp_types.h>
  8. #include <esp_err.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /**
  13. * @brief Type of eFuse blocks for ESP32
  14. */
  15. typedef enum {
  16. EFUSE_BLK0 = 0, /**< Number of eFuse block. Reserved. */
  17. 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. */
  18. 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. */
  19. 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. */
  20. 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. */
  21. 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. */
  22. 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. */
  23. EFUSE_BLK3 = 3, /**< Number of eFuse block. Uses for the purpose of the user. */
  24. EFUSE_BLK_KEY2 = 3, /**< Number of eFuse block. Uses for the purpose of the user. */
  25. EFUSE_BLK_KEY_MAX = 4,
  26. EFUSE_BLK_MAX = 4,
  27. } esp_efuse_block_t;
  28. /**
  29. * @brief Type of coding scheme
  30. */
  31. typedef enum {
  32. EFUSE_CODING_SCHEME_NONE = 0, /**< None */
  33. EFUSE_CODING_SCHEME_3_4 = 1, /**< 3/4 coding */
  34. EFUSE_CODING_SCHEME_REPEAT = 2, /**< Repeat coding */
  35. } esp_efuse_coding_scheme_t;
  36. /**
  37. * @brief Type of key purpose (virtual because ESP32 has only fixed purposes for blocks)
  38. */
  39. typedef enum {
  40. ESP_EFUSE_KEY_PURPOSE_USER = 0, /**< BLOCK3 */
  41. ESP_EFUSE_KEY_PURPOSE_SYSTEM = 1, /**< BLOCK0 */
  42. ESP_EFUSE_KEY_PURPOSE_FLASH_ENCRYPTION = 2, /**< BLOCK1 */
  43. ESP_EFUSE_KEY_PURPOSE_SECURE_BOOT_V2 = 3, /**< BLOCK2 */
  44. ESP_EFUSE_KEY_PURPOSE_MAX, /**< MAX PURPOSE*/
  45. } esp_efuse_purpose_t;
  46. #ifdef __cplusplus
  47. }
  48. #endif