esp_efuse.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _ESP_EFUSE_H
  14. #define _ESP_EFUSE_H
  15. #include "soc/efuse_reg.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /* @brief Permanently update values written to the efuse write registers
  20. *
  21. * After updating EFUSE_BLKx_WDATAx_REG registers with new values to
  22. * write, call this function to permanently write them to efuse.
  23. *
  24. * @note Setting bits in efuse is permanent, they cannot be unset.
  25. *
  26. * @note Due to this restriction you don't need to copy values to
  27. * Efuse write registers from the matching read registers, bits which
  28. * are set in the read register but unset in the matching write
  29. * register will be unchanged when new values are burned.
  30. *
  31. * @note This function is not threadsafe, if calling code updates
  32. * efuse values from multiple tasks then this is caller's
  33. * responsibility to serialise.
  34. *
  35. * After burning new efuses, the read registers are updated to match
  36. * the new efuse values.
  37. */
  38. void esp_efuse_burn_new_values(void);
  39. /* @brief Reset efuse write registers
  40. *
  41. * Efuse write registers are written to zero, to negate
  42. * any changes that have been staged here.
  43. */
  44. void esp_efuse_reset(void);
  45. /* @brief Disable BASIC ROM Console via efuse
  46. *
  47. * By default, if booting from flash fails the ESP32 will boot a
  48. * BASIC console in ROM.
  49. *
  50. * Call this function (from bootloader or app) to permanently
  51. * disable the console on this chip.
  52. */
  53. void esp_efuse_disable_basic_rom_console(void);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* __ESP_EFUSE_H */