Import bootloader from esp-idf v3
[apeos.git] / components / bootloader_support / include / esp_efuse.h
blob2f33b05a98b50d9e7c347003419c4fc84057a4d9
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
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef _ESP_EFUSE_H
15 #define _ESP_EFUSE_H
17 #include "soc/efuse_reg.h"
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 /* @brief Permanently update values written to the efuse write registers
25 * After updating EFUSE_BLKx_WDATAx_REG registers with new values to
26 * write, call this function to permanently write them to efuse.
28 * @note Setting bits in efuse is permanent, they cannot be unset.
30 * @note Due to this restriction you don't need to copy values to
31 * Efuse write registers from the matching read registers, bits which
32 * are set in the read register but unset in the matching write
33 * register will be unchanged when new values are burned.
35 * @note This function is not threadsafe, if calling code updates
36 * efuse values from multiple tasks then this is caller's
37 * responsibility to serialise.
39 * After burning new efuses, the read registers are updated to match
40 * the new efuse values.
42 void esp_efuse_burn_new_values(void);
44 /* @brief Reset efuse write registers
46 * Efuse write registers are written to zero, to negate
47 * any changes that have been staged here.
49 void esp_efuse_reset(void);
51 /* @brief Disable BASIC ROM Console via efuse
53 * By default, if booting from flash fails the ESP32 will boot a
54 * BASIC console in ROM.
56 * Call this function (from bootloader or app) to permanently
57 * disable the console on this chip.
59 void esp_efuse_disable_basic_rom_console(void);
61 #ifdef __cplusplus
63 #endif
65 #endif /* __ESP_EFUSE_H */