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 
18 // Define to prevent recursive inclusion
19 #define _HAL_VER_C_
20 
21 // Files includes
22 #include "hal_ver.h"
23 
24 
25 // MM32 Library version is 0.90
26 
27 #define __MM32_LIB_VERSION_MAIN         (0x0U)                                  //!< [31:24] main version
28 #define __MM32_LIB_VERSION_SUB1         (0x9U)                                  //!< [23:16] sub1 version
29 #define __MM32_LIB_VERSION_SUB2         (0x0U)                                  //!< [15:8]  sub2 version
30 #define __MM32_LIB_VERSION_RC           (0x00U)                                 //!< [7:0]  release candidate
31 #define __MM32_LIB_VERSION              ((__MM32_LIB_VERSION_MAIN << 24U)\
32                                          |(__MM32_LIB_VERSION_SUB1 << 16U)\
33                                          |(__MM32_LIB_VERSION_SUB2 << 8U )\
34                                          |(__MM32_LIB_VERSION_RC))
35 
36 // MM32 Library release date is 2021-05-10 (YYYY-MM-DD)
37 #define __MM32_LIB_RELESE_YEARH         (0x20U)                                  //!< [31:24] release year high
38 #define __MM32_LIB_RELESE_YEARL         (0x21U)                                  //!< [23:16] release year low
39 #define __MM32_LIB_RELESE_MONTH         (0x05U)                                  //!< [15:8]  release month
40 #define __MM32_LIB_RELESE_DAY           (0x10U)                                //!< [7:0]   release day
41 #define __MM32_LIB_RELESE_DATE          ((__MM32_LIB_RELESE_YEARH << 24U)\
42                                          |(__MM32_LIB_RELESE_YEARL << 16U)\
43                                          |(__MM32_LIB_RELESE_MONTH << 8U )\
44                                          |(__MM32_LIB_RELESE_DAY))
45 ////////////////////////////////////////////////////////////////////////////////
46 /// @addtogroup MM32_Hardware_Abstract_Layer
47 /// @{
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 ///@addtogroup VER_HAL
51 ///@{
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// @addtogroup Lib and chipset_Exported_Functions
55 /// @{
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// @brief  This method returns the Lib revision.
59 /// @param  None.
60 /// @retval return the Lib version.
61 ////////////////////////////////////////////////////////////////////////////////
Get_MM32LibVersion(void)62 u32 Get_MM32LibVersion(void)
63 {
64     return __MM32_LIB_VERSION;
65 }
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// @brief  This method returns the Lib release date.
69 /// @param  None.
70 /// @retval return the Lib release date.
71 ////////////////////////////////////////////////////////////////////////////////
Get_MM32LibReleaseDate(void)72 u32 Get_MM32LibReleaseDate(void)
73 {
74     return __MM32_LIB_RELESE_DATE;
75 }
76 ////////////////////////////////////////////////////////////////////////////////
77 /// @brief  Returns the device revision identifier.
78 /// @param  None.
79 /// @retval return the device revision identifier.
80 ////////////////////////////////////////////////////////////////////////////////
Get_ChipsetREVID(void)81 u32 Get_ChipsetREVID(void)
82 {
83     return((DBGMCU->IDCODE) & 0xF );
84 }
85 ////////////////////////////////////////////////////////////////////////////////
86 /// @brief  Returns the device identifier..
87 /// @param  None.
88 /// @retval return the device Device identifier.
89 ////////////////////////////////////////////////////////////////////////////////
Get_ChipsetDEVID(void)90 u32 Get_ChipsetDEVID(void)
91 {
92     return((DBGMCU->IDCODE) );
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// @brief  Returns first word of the unique device identifier (UID based on 96 bits)
97 /// @param  None.
98 /// @retval Device identifier
99 ////////////////////////////////////////////////////////////////////////////////
Get_ChipsetUIDw0(void)100 u32 Get_ChipsetUIDw0(void)
101 {
102     return(READ_REG(*((vu32*)UID_BASE)));
103 }
104 ////////////////////////////////////////////////////////////////////////////////
105 /// @brief  Returns second word of the unique device identifier (UID based on 96 bits)
106 /// @param  None.
107 /// @retval Device identifier
108 ////////////////////////////////////////////////////////////////////////////////
Get_ChipsetUIDw1(void)109 u32 Get_ChipsetUIDw1(void)
110 {
111     return(READ_REG(*((vu32*)(UID_BASE + 4U))));
112 }
113 ////////////////////////////////////////////////////////////////////////////////
114 /// @brief  Returns third word of the unique device identifier (UID based on 96 bits)
115 /// @param  None.
116 /// @retval Device identifier
117 ////////////////////////////////////////////////////////////////////////////////
Get_ChipsetUIDw2(void)118 u32 Get_ChipsetUIDw2(void)
119 {
120     return(READ_REG(*((vu32*)(UID_BASE + 8U))));
121 }
122 
123 
124 
125 
126 
127 /// @}
128 
129 /// @}
130 
131 /// @}
132