hal_ver.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /// @file hal_ver.c
  3. /// @author AE TEAM
  4. /// @brief THIS FILE PROVIDES ALL THE LIB AND THE CHIPSET INFORMATION.
  5. ////////////////////////////////////////////////////////////////////////////////
  6. /// @attention
  7. ///
  8. /// THE EXISTING FIRMWARE IS ONLY FOR REFERENCE, WHICH IS DESIGNED TO PROVIDE
  9. /// CUSTOMERS WITH CODING INFORMATION ABOUT THEIR PRODUCTS SO THEY CAN SAVE
  10. /// TIME. THEREFORE, MINDMOTION SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT OR
  11. /// CONSEQUENTIAL DAMAGES ABOUT ANY CLAIMS ARISING OUT OF THE CONTENT OF SUCH
  12. /// HARDWARE AND/OR THE USE OF THE CODING INFORMATION CONTAINED HEREIN IN
  13. /// CONNECTION WITH PRODUCTS MADE BY CUSTOMERS.
  14. ///
  15. /// <H2><CENTER>&COPY; COPYRIGHT MINDMOTION </CENTER></H2>
  16. ////////////////////////////////////////////////////////////////////////////////
  17. // Define to prevent recursive inclusion
  18. #define _HAL_VER_C_
  19. // Files includes
  20. #include "hal_ver.h"
  21. // MM32 Library version is 0.90
  22. #define __MM32_LIB_VERSION_MAIN (0x0U) //!< [31:24] main version
  23. #define __MM32_LIB_VERSION_SUB1 (0x9U) //!< [23:16] sub1 version
  24. #define __MM32_LIB_VERSION_SUB2 (0x0U) //!< [15:8] sub2 version
  25. #define __MM32_LIB_VERSION_RC (0x00U) //!< [7:0] release candidate
  26. #define __MM32_LIB_VERSION ((__MM32_LIB_VERSION_MAIN << 24U)\
  27. |(__MM32_LIB_VERSION_SUB1 << 16U)\
  28. |(__MM32_LIB_VERSION_SUB2 << 8U )\
  29. |(__MM32_LIB_VERSION_RC))
  30. // MM32 Library release date is 2021-05-10 (YYYY-MM-DD)
  31. #define __MM32_LIB_RELESE_YEARH (0x20U) //!< [31:24] release year high
  32. #define __MM32_LIB_RELESE_YEARL (0x21U) //!< [23:16] release year low
  33. #define __MM32_LIB_RELESE_MONTH (0x05U) //!< [15:8] release month
  34. #define __MM32_LIB_RELESE_DAY (0x10U) //!< [7:0] release day
  35. #define __MM32_LIB_RELESE_DATE ((__MM32_LIB_RELESE_YEARH << 24U)\
  36. |(__MM32_LIB_RELESE_YEARL << 16U)\
  37. |(__MM32_LIB_RELESE_MONTH << 8U )\
  38. |(__MM32_LIB_RELESE_DAY))
  39. ////////////////////////////////////////////////////////////////////////////////
  40. /// @addtogroup MM32_Hardware_Abstract_Layer
  41. /// @{
  42. ////////////////////////////////////////////////////////////////////////////////
  43. ///@addtogroup VER_HAL
  44. ///@{
  45. ////////////////////////////////////////////////////////////////////////////////
  46. /// @addtogroup Lib and chipset_Exported_Functions
  47. /// @{
  48. ////////////////////////////////////////////////////////////////////////////////
  49. /// @brief This method returns the Lib revision.
  50. /// @param None.
  51. /// @retval return the Lib version.
  52. ////////////////////////////////////////////////////////////////////////////////
  53. u32 Get_MM32LibVersion(void)
  54. {
  55. return __MM32_LIB_VERSION;
  56. }
  57. ////////////////////////////////////////////////////////////////////////////////
  58. /// @brief This method returns the Lib release date.
  59. /// @param None.
  60. /// @retval return the Lib release date.
  61. ////////////////////////////////////////////////////////////////////////////////
  62. u32 Get_MM32LibReleaseDate(void)
  63. {
  64. return __MM32_LIB_RELESE_DATE;
  65. }
  66. ////////////////////////////////////////////////////////////////////////////////
  67. /// @brief Returns the device revision identifier.
  68. /// @param None.
  69. /// @retval return the device revision identifier.
  70. ////////////////////////////////////////////////////////////////////////////////
  71. u32 Get_ChipsetREVID(void)
  72. {
  73. return((DBGMCU->IDCODE) & 0xF );
  74. }
  75. ////////////////////////////////////////////////////////////////////////////////
  76. /// @brief Returns the device identifier..
  77. /// @param None.
  78. /// @retval return the device Device identifier.
  79. ////////////////////////////////////////////////////////////////////////////////
  80. u32 Get_ChipsetDEVID(void)
  81. {
  82. return((DBGMCU->IDCODE) );
  83. }
  84. ////////////////////////////////////////////////////////////////////////////////
  85. /// @brief Returns first word of the unique device identifier (UID based on 96 bits)
  86. /// @param None.
  87. /// @retval Device identifier
  88. ////////////////////////////////////////////////////////////////////////////////
  89. u32 Get_ChipsetUIDw0(void)
  90. {
  91. return(READ_REG(*((vu32*)UID_BASE)));
  92. }
  93. ////////////////////////////////////////////////////////////////////////////////
  94. /// @brief Returns second word of the unique device identifier (UID based on 96 bits)
  95. /// @param None.
  96. /// @retval Device identifier
  97. ////////////////////////////////////////////////////////////////////////////////
  98. u32 Get_ChipsetUIDw1(void)
  99. {
  100. return(READ_REG(*((vu32*)(UID_BASE + 4U))));
  101. }
  102. ////////////////////////////////////////////////////////////////////////////////
  103. /// @brief Returns third word of the unique device identifier (UID based on 96 bits)
  104. /// @param None.
  105. /// @retval Device identifier
  106. ////////////////////////////////////////////////////////////////////////////////
  107. u32 Get_ChipsetUIDw2(void)
  108. {
  109. return(READ_REG(*((vu32*)(UID_BASE + 8U))));
  110. }
  111. /// @}
  112. /// @}
  113. /// @}