#pragma once
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** @brief Configure clocks for early boot
*
* Called by bootloader, or by the app if the bootloader version is old (pre v2.1).
*/
void bootloader_clock_configure(void);
+
+#ifdef __cplusplus
+}
+#endif
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/// Type of hold a GPIO in low state
typedef enum {
GPIO_LONG_HOLD = 1, /*!< The long hold GPIO */
* @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode.
*/
void bootloader_common_vddsdio_configure();
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @brief Enable early entropy source for RNG
*
* @param length This many bytes of random data will be copied to buffer
*/
void bootloader_fill_random(void *buffer, size_t length);
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @brief Check if half-open intervals overlap
*
assert(end2>start2);
return (end1 > start2 && end2 > start1);
}
+
+#ifdef __cplusplus
+}
+#endif
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef __ESP32_FLASH_ENCRYPT_H
-#define __ESP32_FLASH_ENCRYPT_H
+#pragma once
#include <stdbool.h>
#include "esp_attr.h"
#endif
#include "soc/efuse_periph.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* @brief Flash encryption mode based on efuse values
*/
typedef enum {
ESP_FLASH_ENC_MODE_DISABLED, // flash encryption is not enabled (flash crypt cnt=0)
ESP_FLASH_ENC_MODE_DEVELOPMENT, // flash encryption is enabled but for Development (reflash over UART allowed)
ESP_FLASH_ENC_MODE_RELEASE // flash encryption is enabled for Release (reflash over UART disabled)
-}esp_flash_enc_mode_t;
+} esp_flash_enc_mode_t;
/**
* @file esp_partition.h
* is enabled but secure boot is not used. This should protect against
* serial re-flashing of an unauthorised code in absence of secure boot.
*
- * @return
*/
void esp_flash_write_protect_crypt_cnt();
*/
esp_flash_enc_mode_t esp_get_flash_encryption_mode();
+#ifdef __cplusplus
+}
#endif
#include "esp_flash_partitions.h"
#include "esp_app_format.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define ESP_ERR_IMAGE_BASE 0x2000
#define ESP_ERR_IMAGE_FLASH_FAIL (ESP_ERR_IMAGE_BASE + 1)
#define ESP_ERR_IMAGE_INVALID (ESP_ERR_IMAGE_BASE + 2)
uint32_t irom_load_addr;
uint32_t irom_size;
} esp_image_flash_mapping_t;
+
+#ifdef __cplusplus
+}
+#endif
uint8_t digest[64];
} esp_secure_boot_iv_digest_t;
-
#ifdef __cplusplus
}
#endif