esp_efuse.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif /* __ESP_EFUSE_H */