2021-12-22 09:18:43 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
2023-03-31 05:04:30 -04:00
|
|
|
#include "soc/soc_caps.h"
|
2021-12-22 09:18:43 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief get factory mac address
|
|
|
|
*/
|
|
|
|
void efuse_hal_get_mac(uint8_t *mac);
|
|
|
|
|
2022-05-25 15:16:15 -04:00
|
|
|
/**
|
|
|
|
* @brief Returns chip version
|
|
|
|
*
|
|
|
|
* @return Chip version in format: Major * 100 + Minor
|
|
|
|
*/
|
|
|
|
uint32_t efuse_hal_chip_revision(void);
|
|
|
|
|
2023-05-05 07:56:44 -04:00
|
|
|
/**
|
|
|
|
* @brief Return block version
|
|
|
|
*
|
|
|
|
* @return Block version in format: Major * 100 + Minor
|
|
|
|
*/
|
|
|
|
uint32_t efuse_hal_blk_version(void);
|
|
|
|
|
2023-03-16 04:47:53 -04:00
|
|
|
/**
|
|
|
|
* @brief Is flash encryption currently enabled in hardware?
|
|
|
|
*
|
|
|
|
* Flash encryption is enabled if the FLASH_CRYPT_CNT efuse has an odd number of bits set.
|
|
|
|
*
|
|
|
|
* @return true if flash encryption is enabled.
|
|
|
|
*/
|
|
|
|
bool efuse_hal_flash_encryption_enabled(void);
|
|
|
|
|
2023-04-14 11:03:37 -04:00
|
|
|
/**
|
|
|
|
* @brief Returns the status of whether the bootloader (and OTA)
|
|
|
|
* will check the maximum chip version or not.
|
|
|
|
*
|
|
|
|
* @return true - Skip the maximum chip version check.
|
|
|
|
*/
|
|
|
|
bool efuse_hal_get_disable_wafer_version_major(void);
|
|
|
|
|
2022-05-25 15:16:15 -04:00
|
|
|
/**
|
|
|
|
* @brief Returns major chip version
|
|
|
|
*/
|
|
|
|
uint32_t efuse_hal_get_major_chip_version(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Returns minor chip version
|
|
|
|
*/
|
|
|
|
uint32_t efuse_hal_get_minor_chip_version(void);
|
|
|
|
|
2023-03-31 05:04:30 -04:00
|
|
|
#if SOC_ECDSA_SUPPORTED
|
|
|
|
/**
|
|
|
|
* @brief Set the efuse block that should be used as ECDSA private key
|
|
|
|
*
|
|
|
|
* @note The efuse block must be burnt with key purpose ECDSA_KEY
|
|
|
|
*
|
|
|
|
* @param efuse_key_blk Efuse key block number (Must be in [EFUSE_BLK_KEY0...EFUSE_BLK_KEY_MAX - 1] range)
|
|
|
|
*/
|
|
|
|
void efuse_hal_set_ecdsa_key(int efuse_key_blk);
|
|
|
|
#endif
|
|
|
|
|
2021-12-22 09:18:43 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|