cmem7_efuse.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. *****************************************************************************
  3. * @file cmem7_efuse.h
  4. *
  5. * @brief CMEM7 EFUSE header file
  6. *
  7. *
  8. * @version V1.0
  9. * @date 3. September 2013
  10. *
  11. * @note
  12. *
  13. *****************************************************************************
  14. * @attention
  15. *
  16. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  17. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  18. * TIME. AS A RESULT, CAPITAL-MICRO SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  19. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  20. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  21. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  22. *
  23. * <h2><center>&copy; COPYRIGHT 2013 Capital-micro </center></h2>
  24. *****************************************************************************
  25. */
  26. #ifndef __CMEM7_EFUSE_H
  27. #define __CMEM7_EFUSE_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include "cmem7.h"
  32. #include "cmem7_conf.h"
  33. /** @defgroup EFUSE_TMRF_R
  34. * @{
  35. */
  36. #define EFUSE_TMRF_R_3000 0
  37. #define EFUSE_TMRF_R_1200 1
  38. #define EFUSE_TMRF_R_750 2
  39. #define IS_EFUSE_TMRF(R) (((R) == EFUSE_TMRF_R_3000) || \
  40. ((R) == EFUSE_TMRF_R_1200) || \
  41. ((R) == EFUSE_TMRF_R_750))
  42. /**
  43. * @}
  44. */
  45. /**
  46. * @brief EFUSE timing structure
  47. */
  48. typedef struct
  49. {
  50. uint32_t EFUSE_Tpwph; /*!< Nano second */
  51. uint32_t EFUSE_Trac; /*!< Nano second */
  52. uint32_t EFUSE_Trah; /*!< Nano second */
  53. uint32_t EFUSE_Trpw; /*!< Nano second */
  54. uint32_t EFUSE_Trc; /*!< Nano second */
  55. uint32_t EFUSE_Tesr; /*!< Nano second */
  56. uint32_t EFUSE_Tprs; /*!< Nano second */
  57. uint32_t EFUSE_Tpi; /*!< Nano second */
  58. uint32_t EFUSE_Tpp; /*!< Nano second */
  59. uint32_t EFUSE_Teps; /*!< Nano second */
  60. uint32_t EFUSE_Tpwps; /*!< Nano second */
  61. } EFUSE_Timing;
  62. /**
  63. * @brief EFUSE initialization structure
  64. */
  65. typedef struct
  66. {
  67. uint8_t EFUSE_ClockDividor; /*!< EFUSE clock dividor, 2 in n times */
  68. uint8_t EFUSE_TMRF; /*!< EFUSE reference resistor select, @ref EFUSE_TMRF_R */
  69. EFUSE_Timing* timing; /*!< Timing configuration, null if default */
  70. } EFUSE_InitTypeDef;
  71. /**
  72. * @brief EFUSE key structure
  73. */
  74. typedef struct
  75. {
  76. uint32_t key0; /*!< EFUSE AES key [31:0] */
  77. uint32_t key1; /*!< EFUSE AES key [63:32] */
  78. uint32_t key2; /*!< EFUSE AES key [95:64] */
  79. uint32_t key3; /*!< EFUSE AES key [127:96] */
  80. uint32_t key4; /*!< EFUSE AES key [159:128] */
  81. uint32_t key5; /*!< EFUSE AES key [191:160] */
  82. uint32_t key6; /*!< EFUSE AES key [223:192] */
  83. uint32_t key7; /*!< EFUSE AES key [255:224] */
  84. } EFUSE_AesKey;
  85. /**
  86. * @brief EFUSE initialization
  87. * @note This function should be called at first before any other interfaces.
  88. * @param[in] init A pointer to structure EFUSE_InitTypeDef
  89. * @retval None
  90. */
  91. void EFUSE_Init(EFUSE_InitTypeDef* init);
  92. /**
  93. * @brief EFUSE initialization
  94. * @param[in] key A pointer to EFUSE_AesKey to be compared
  95. * @retval BOOL True if equal, or false if different
  96. */
  97. BOOL EFUSE_Compare(EFUSE_AesKey* key);
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif /* __CMEM7_EFUSE_H */