ConOpSys V2970  P004.07
ANVILEX control operating system
CPU_STM32F410CBU6.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file CPU_STM32F410CBU6.h
3 //! @brief STM32F410CBU6 CPU class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Targets/STM32F410CBU6/CPU_STM32F410CBU6.h $
7 //! $Revision: 2269 $
8 //! $Date: 2020-12-06 19:46:20 +0500 (So, 06 Dez 2020) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include standard libraries header files
44 //------------------------------------------------------------------------------
45 
46 //------------------------------------------------------------------------------
47 // Include thrid party header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include ConOpSys header files
52 //------------------------------------------------------------------------------
53 
54 #include "CPU_Base.h"
55 
56 //------------------------------------------------------------------------------
57 // Include ConOpSys application header files
58 //------------------------------------------------------------------------------
59 
60 #include "Application_Task_Base.h"
61 
62 //------------------------------------------------------------------------------
63 // Class definitions
64 //------------------------------------------------------------------------------
65 
66 //! @brief STM32F410CBU6 CPU hardware class
68 {
69 
70  //----------------------------------------------------------------------------
71  // Public defines, methods and variables
72  //----------------------------------------------------------------------------
73 
74  public:
75 
76  //--------------------------------------------------------------------------
77  // Public methods
78  //--------------------------------------------------------------------------
79 
80  //!-------------------------------------------------------------------------
81  //! @brief STM32F410CBU6 CPU class constructor method.
82  //! @note None
83  //! \par Override
84  //! Not allowed
85  //! @attention Don't call this method directly.
86  //--------------------------------------------------------------------------
87 
89 
90  //!-------------------------------------------------------------------------
91  //! @brief STM32F410CBU6 CPU class destructor method.
92  //! @note None
93  //! \par Override
94  //! Not allowed
95  //! @attention Don't call this method directly.
96  //--------------------------------------------------------------------------
97 
98  virtual ~TCPU_STM32F410CBU6();
99 
100  //!-------------------------------------------------------------------------
101  //! @brief CPU object initialisation method.
102  //! @note None
103  //! @return None
104  //! \par Override
105  //! Not allowed
106  //! @attention None
107  //--------------------------------------------------------------------------
108 
109  virtual VOID Init();
110 
111  //!-------------------------------------------------------------------------
112  //! @brief CPU object finalisation method.
113  //! @note None
114  //! @return None
115  //! \par Override
116  //! Not allowed
117  //! @attention None
118  //--------------------------------------------------------------------------
119 
120  virtual VOID Done();
121 
122  //!-------------------------------------------------------------------------
123  //! @brief Return reset source of CPU method.
124  //! @note None
125  //! @return TReset_Source - Type og the CPU reset
126  //! \par Override
127  //! Not allowed
128  //! @attention None
129  //--------------------------------------------------------------------------
130 
132 
133  //!-------------------------------------------------------------------------
134  //! @brief Return CPU reset source register method.
135  //! @note None
136  //! @return U32 - Reset source register
137  //! \par Override
138  //! Not allowed
139  //! @attention None
140  //--------------------------------------------------------------------------
141 
143 
144  //!-------------------------------------------------------------------------
145  //! @brief Return CPU device ID method.
146  //! @note None
147  //! @return U32 - CPU device ID
148  //! \par Override
149  //! Not allowed
150  //! @attention None
151  //--------------------------------------------------------------------------
152 
154 
155  //!-------------------------------------------------------------------------
156  //! @brief Return CPU revision ID method.
157  //! @note None
158  //! @return U32 - CPU revision ID
159  //! \par Override
160  //! Not allowed
161  //! @attention None
162  //--------------------------------------------------------------------------
163 
165 
166  //!-------------------------------------------------------------------------
167  //! @brief Return unique CPU ID method.
168  //! @note None
169  //! @return U32 - Unique CPU ID
170  //! \par Override
171  //! Not allowed
172  //! @attention None
173  //--------------------------------------------------------------------------
174 
175  U32 Get_CPU_Unique_Device_ID( U32 u32_Index );
176 
177  //!-------------------------------------------------------------------------
178  //! @brief Return CPU FLASH memory size method.
179  //! @note None
180  //! @return U32 - CPU FLASH memory size in bytes
181  //! \par Override
182  //! Not allowed
183  //! @attention None
184  //--------------------------------------------------------------------------
185 
187 
188  //!-------------------------------------------------------------------------
189  //! @brief Return CPU RAM size method.
190  //! @note None
191  //! @return U32 - CPU RAM size in bytes
192  //! \par Override
193  //! Not allowed
194  //! @attention None
195  //--------------------------------------------------------------------------
196 
198 
199  //!-------------------------------------------------------------------------
200  //! @brief Return executable image base address method.
201  //! @note None
202  //! @return U32 - Executable image base address
203  //! \par Override
204  //! Not allowed
205  //! @attention None
206  //--------------------------------------------------------------------------
207 
209 
210  //!-------------------------------------------------------------------------
211  //! @brief Return executable image end address method.
212  //! @note None
213  //! @return U32 - Executable image end address
214  //! \par Override
215  //! Not allowed
216  //! @attention None
217  //--------------------------------------------------------------------------
218 
219  U32 Get_Image_End();
220 
221  //!-------------------------------------------------------------------------
222  //! @brief Return executable image size method.
223  //! @note None
224  //! @return U32 - Executable image size in byts
225  //! \par Override
226  //! Not allowed
227  //! @attention None
228  //--------------------------------------------------------------------------
229 
231 
232  //!-------------------------------------------------------------------------
233  //! @brief Return executable image hash method.
234  //! @note None
235  //! @return U32 - Executable image hash in byts
236  //! \par Override
237  //! Not allowed
238  //! @attention None
239  //--------------------------------------------------------------------------
240 
242 
243  //!-------------------------------------------------------------------------
244  //! @brief Calculate executable image hash method.
245  //! @note None
246  //! @return U32 - Executable image hash value
247  //! \par Override
248  //! Not allowed
249  //! @attention None
250  //--------------------------------------------------------------------------
251 
253 
254  //!-------------------------------------------------------------------------
255  //! @brief Return CPU stack base address method.
256  //! @note None
257  //! @return U32 - CPU stack base address
258  //! \par Override
259  //! Not allowed
260  //! @attention None
261  //--------------------------------------------------------------------------
262 
264 
265  //!-------------------------------------------------------------------------
266  //! @brief Return CPU stack size method.
267  //! @note None
268  //! @return U32 - CPU stack size in byts
269  //! \par Override
270  //! Not allowed
271  //! @attention None
272  //--------------------------------------------------------------------------
273 
275 
276  //!-------------------------------------------------------------------------
277  //! @brief Return CPU heap base address method.
278  //! @note None
279  //! @return U32 - CPU heap base address
280  //! \par Override
281  //! Not allowed
282  //! @attention None
283  //--------------------------------------------------------------------------
284 
286 
287  //!-------------------------------------------------------------------------
288  //! @brief Return CPU heap size method.
289  //! @note None
290  //! @return U32 - CPU heap size in bytes
291  //! \par Override
292  //! Not allowed
293  //! @attention None
294  //--------------------------------------------------------------------------
295 
297 
298  //!-------------------------------------------------------------------------
299  //! @brief Update core clock value method.
300  //! @note None
301  //! @return U32 - CPU heap size
302  //! \par Override
303  //! Not allowed
304  //! @attention None
305  //--------------------------------------------------------------------------
306 
308 
309  //!-------------------------------------------------------------------------
310  //! @brief Return SYSCLK frequency method.
311  //! @note None
312  //! @return U32 - SYSCLK frequency
313  //! \par Override
314  //! Not allowed
315  //! @attention None
316  //--------------------------------------------------------------------------
317 
319 
320  //!-------------------------------------------------------------------------
321  //! @brief Return HCLK frequency method.
322  //! @note Each time HCLK changes, this function must be called to update the
323  // right HCLK value. Otherwise, any configuration based on this function will be incorrect.
324  //! @return U32 - HCLK frequency
325  //! \par Override
326  //! Not allowed
327  //! @attention None
328  //--------------------------------------------------------------------------
329 
331 
332  //!-------------------------------------------------------------------------
333  //! @brief Return PCLK1 frequency method.
334  //! @note Each time PCLK1 changes, this function must be called to update the
335  //! right PCLK1 value. Otherwise, any configuration based on this function will be incorrect.
336  //! @return U32 - PCLK1 frequency
337  //! \par Override
338  //! Not allowed
339  //! @attention None
340  //--------------------------------------------------------------------------
341 
343 
344  //!-------------------------------------------------------------------------
345  //! @brief Return PCLK2 frequency method.
346  //! @note Each time PCLK2 changes, this function must be called to update the
347  //! right PCLK2 value. Otherwise, any configuration based on this function will be incorrect.
348  //! @return U32 - PCLK2 frequency
349  //! \par Override
350  //! Not allowed
351  //! @attention None
352  //--------------------------------------------------------------------------
353 
355 
356  //!-------------------------------------------------------------------------
357  //! @brief Return TCLK1 frequency method.
358  //! @note Each time PCLK1 changes, this function must be called to update the
359  //! right TCLK1 value. Otherwise, any configuration based on this function will be incorrect.
360  //! @return U32 - TCLK1 frequency
361  //! \par Override
362  //! Not allowed
363  //! @attention None
364  //--------------------------------------------------------------------------
365 
367 
368  //!-------------------------------------------------------------------------
369  //! @brief Return TCLK2 frequency method.
370  //! @note None
371  //! @return U32 - TCLK2 frequency
372  //! \par Override
373  //! Not allowed
374  //! @attention None
375  //--------------------------------------------------------------------------
376 
378 
379  //!-------------------------------------------------------------------------
380  //! @brief Return IWDG frequency method.
381  //! @note Each time PCLK2 changes, this function must be called to update the
382  //! right TCLK2 value. Otherwise, any configuration based on this function will be incorrect.
383  //! @return U32 - IWDG frequency
384  //! \par Override
385  //! Not allowed
386  //! @attention None
387  //--------------------------------------------------------------------------
388 
390 
391  //----------------------------------------------------------------------------
392  // Protected defines, methods and variables
393  //----------------------------------------------------------------------------
394 
395  protected:
396 
397  //----------------------------------------------------------------------------
398  // Private defines, methods and variables
399  //----------------------------------------------------------------------------
400 
401  private:
402 
403  //--------------------------------------------------------------------------
404  // Private variables
405  //--------------------------------------------------------------------------
406 
407  //! @brief System CPU core clock frequency in Hz
409 
410  //! @brief System HCLK bus clock frequency in Hz
412 
413  //! @brief System PCLK1 bus clock frequency in Hz
415 
416  //! @brief System PCLK2 bus clock frequency in Hz
418 
419  //! @brief System TCLK1 bus clock frequency in Hz
421 
422  //! @brief System TCLK2 bus clock frequency in Hz
424 
425  //! @brief System IWDG bus clock frequency in Hz
427 
428  //! @brief Application executable image hash value
430 
431 };
432 
433 //------------------------------------------------------------------------------
434 // End of file
435 //------------------------------------------------------------------------------
ConOpSys application task base class header file.
CPU base class header file.
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
CPU base class.
Definition: CPU_Base.h:74
TReset_Source
CPU reset sources enumeration.
Definition: CPU_Base.h:88
STM32F410CBU6 CPU hardware class.
Definition: CPU_STM32F410CBU6.h:68
U32 Get_CPU_Stack_Size()
Return CPU stack size method.
Definition: CPU_STM32F410CBU6.cpp:612
U32 Get_CPU_RAM_Size()
Return CPU RAM size method.
Definition: CPU_STM32F410CBU6.cpp:487
TCPU_STM32F410CBU6()
STM32F410CBU6 CPU class constructor method.
Definition: CPU_STM32F410CBU6.cpp:82
TReset_Source Get_Reset_Source()
Return reset source of CPU method.
Definition: CPU_STM32F410CBU6.cpp:404
virtual ~TCPU_STM32F410CBU6()
STM32F410CBU6 CPU class destructor method.
Definition: CPU_STM32F410CBU6.cpp:97
U32 Get_CPU_Flash_Size()
Return CPU FLASH memory size method.
Definition: CPU_STM32F410CBU6.cpp:470
U32 Get_TCLK1_Frequency()
Return TCLK1 frequency method.
Definition: CPU_STM32F410CBU6.cpp:353
U32 Get_IWDG_Frequency()
Return IWDG frequency method.
Definition: CPU_STM32F410CBU6.cpp:377
virtual VOID Done()
CPU object finalisation method.
Definition: CPU_STM32F410CBU6.cpp:120
U32 Get_CPU_Device_ID()
Return CPU device ID method.
Definition: CPU_STM32F410CBU6.cpp:418
U32 u32_TCLK1
System TCLK1 bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:420
U32 Get_CPU_Stack_Base()
Return CPU stack base address method.
Definition: CPU_STM32F410CBU6.cpp:596
U32 Calculate_Image_Hash()
Calculate executable image hash method.
Definition: CPU_STM32F410CBU6.cpp:569
virtual VOID Init()
CPU object initialisation method.
Definition: CPU_STM32F410CBU6.cpp:105
U32 Get_Image_Base()
Return executable image base address method.
Definition: CPU_STM32F410CBU6.cpp:502
U32 Get_CPU_Reset_Source()
Return CPU reset source register method.
Definition: CPU_STM32F410CBU6.cpp:389
U32 u32_PCLK2
System PCLK2 bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:417
U32 Get_CPU_Heap_Base()
Return CPU heap base address method.
Definition: CPU_STM32F410CBU6.cpp:635
VOID System_Core_Clock_Update()
Update core clock value method.
Definition: CPU_STM32F410CBU6.cpp:128
U32 Get_PCLK2_Frequency()
Return PCLK2 frequency method.
Definition: CPU_STM32F410CBU6.cpp:341
U32 Get_CPU_Heap_Size()
Return CPU heap size method.
Definition: CPU_STM32F410CBU6.cpp:651
U32 u32_PCLK1
System PCLK1 bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:414
U32 u32_TCLK2
System TCLK2 bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:423
U32 u32_SYSCLK
System CPU core clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:408
U32 u32_Application_Image_Hash
Application executable image hash value.
Definition: CPU_STM32F410CBU6.h:429
U32 u32_HCLK
System HCLK bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:411
U32 Get_HCLK_Frequency()
Return HCLK frequency method.
Definition: CPU_STM32F410CBU6.cpp:317
U32 Get_CPU_Revision()
Return CPU revision ID method.
Definition: CPU_STM32F410CBU6.cpp:433
U32 u32_IWDG
System IWDG bus clock frequency in Hz.
Definition: CPU_STM32F410CBU6.h:426
U32 Get_SYSCLK_Frequency()
Return SYSCLK frequency method.
Definition: CPU_STM32F410CBU6.cpp:305
U32 Get_Image_End()
Return executable image end address method.
Definition: CPU_STM32F410CBU6.cpp:518
U32 Get_CPU_Unique_Device_ID(U32 u32_Index)
Return unique CPU ID method.
Definition: CPU_STM32F410CBU6.cpp:448
U32 Get_PCLK1_Frequency()
Return PCLK1 frequency method.
Definition: CPU_STM32F410CBU6.cpp:329
U32 Get_Image_Size()
Return executable image size method.
Definition: CPU_STM32F410CBU6.cpp:534
U32 Get_Image_Hash()
Return executable image hash method.
Definition: CPU_STM32F410CBU6.cpp:557
U32 Get_TCLK2_Frequency()
Return TCLK2 frequency method.
Definition: CPU_STM32F410CBU6.cpp:365