2014-08-30 00:19:16 +08:00
|
|
|
/**
|
2023-04-05 11:26:18 +08:00
|
|
|
*****************************************************************************
|
|
|
|
* @file cmem7_efuse.h
|
|
|
|
*
|
|
|
|
* @brief CMEM7 EFUSE header file
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @version V1.0
|
|
|
|
* @date 3. September 2013
|
|
|
|
*
|
|
|
|
* @note
|
|
|
|
*
|
|
|
|
*****************************************************************************
|
|
|
|
* @attention
|
|
|
|
*
|
|
|
|
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
|
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
|
|
|
* TIME. AS A RESULT, CAPITAL-MICRO SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
|
|
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
|
|
|
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
|
|
|
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
|
|
|
*
|
|
|
|
* <h2><center>© COPYRIGHT 2013 Capital-micro </center></h2>
|
|
|
|
*****************************************************************************
|
|
|
|
*/
|
|
|
|
|
2014-08-30 00:19:16 +08:00
|
|
|
#ifndef __CMEM7_EFUSE_H
|
|
|
|
#define __CMEM7_EFUSE_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "cmem7.h"
|
|
|
|
#include "cmem7_conf.h"
|
|
|
|
|
|
|
|
/** @defgroup EFUSE_TMRF_R
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define EFUSE_TMRF_R_3000 0
|
|
|
|
#define EFUSE_TMRF_R_1200 1
|
|
|
|
#define EFUSE_TMRF_R_750 2
|
|
|
|
|
|
|
|
#define IS_EFUSE_TMRF(R) (((R) == EFUSE_TMRF_R_3000) || \
|
|
|
|
((R) == EFUSE_TMRF_R_1200) || \
|
|
|
|
((R) == EFUSE_TMRF_R_750))
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief EFUSE timing structure
|
2023-04-05 11:26:18 +08:00
|
|
|
*/
|
2014-08-30 00:19:16 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2023-04-05 11:26:18 +08:00
|
|
|
uint32_t EFUSE_Tpwph; /*!< Nano second */
|
2014-08-30 00:19:16 +08:00
|
|
|
uint32_t EFUSE_Trac; /*!< Nano second */
|
2023-04-05 11:26:18 +08:00
|
|
|
uint32_t EFUSE_Trah; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Trpw; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Trc; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Tesr; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Tprs; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Tpi; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Tpp; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Teps; /*!< Nano second */
|
|
|
|
uint32_t EFUSE_Tpwps; /*!< Nano second */
|
2014-08-30 00:19:16 +08:00
|
|
|
} EFUSE_Timing;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief EFUSE initialization structure
|
2023-04-05 11:26:18 +08:00
|
|
|
*/
|
2014-08-30 00:19:16 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2023-04-05 11:26:18 +08:00
|
|
|
uint8_t EFUSE_ClockDividor; /*!< EFUSE clock dividor, 2 in n times */
|
|
|
|
uint8_t EFUSE_TMRF; /*!< EFUSE reference resistor select, @ref EFUSE_TMRF_R */
|
2014-08-30 00:19:16 +08:00
|
|
|
EFUSE_Timing* timing; /*!< Timing configuration, null if default */
|
|
|
|
} EFUSE_InitTypeDef;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief EFUSE key structure
|
2023-04-05 11:26:18 +08:00
|
|
|
*/
|
2014-08-30 00:19:16 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2023-04-05 11:26:18 +08:00
|
|
|
uint32_t key0; /*!< EFUSE AES key [31:0] */
|
2014-08-30 00:19:16 +08:00
|
|
|
uint32_t key1; /*!< EFUSE AES key [63:32] */
|
2023-04-05 11:26:18 +08:00
|
|
|
uint32_t key2; /*!< EFUSE AES key [95:64] */
|
|
|
|
uint32_t key3; /*!< EFUSE AES key [127:96] */
|
|
|
|
uint32_t key4; /*!< EFUSE AES key [159:128] */
|
2014-08-30 00:19:16 +08:00
|
|
|
uint32_t key5; /*!< EFUSE AES key [191:160] */
|
2023-04-05 11:26:18 +08:00
|
|
|
uint32_t key6; /*!< EFUSE AES key [223:192] */
|
|
|
|
uint32_t key7; /*!< EFUSE AES key [255:224] */
|
2014-08-30 00:19:16 +08:00
|
|
|
} EFUSE_AesKey;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief EFUSE initialization
|
|
|
|
* @note This function should be called at first before any other interfaces.
|
2023-04-05 11:26:18 +08:00
|
|
|
* @param[in] init A pointer to structure EFUSE_InitTypeDef
|
2014-08-30 00:19:16 +08:00
|
|
|
* @retval None
|
2023-04-05 11:26:18 +08:00
|
|
|
*/
|
2014-08-30 00:19:16 +08:00
|
|
|
void EFUSE_Init(EFUSE_InitTypeDef* init);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief EFUSE initialization
|
|
|
|
* @param[in] key A pointer to EFUSE_AesKey to be compared
|
|
|
|
* @retval BOOL True if equal, or false if different
|
2023-04-05 11:26:18 +08:00
|
|
|
*/
|
2014-08-30 00:19:16 +08:00
|
|
|
BOOL EFUSE_Compare(EFUSE_AesKey* key);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __CMEM7_EFUSE_H */
|
|
|
|
|