Prusa MINI Firmware overview
stm32_def.h
Go to the documentation of this file.
1 #ifndef _STM32_DEF_
2 #define _STM32_DEF_
3 
4 /**
5  * @brief STM32 core version number
6  */
7 #define STM32_CORE_VERSION_MAJOR (0x01U) /*!< [31:24] major version */
8 #define STM32_CORE_VERSION_MINOR (0x05U) /*!< [23:16] minor version */
9 #define STM32_CORE_VERSION_PATCH (0x01U) /*!< [15:8] patch version */
10 /*
11  * Extra label for development:
12  * 0: official release
13  * [1-9]: release candidate
14  * F[0-9]: development
15  */
16 #define STM32_CORE_VERSION_EXTRA (0xF0U) /*!< [7:0] extra version */
17 #define STM32_CORE_VERSION ((STM32_CORE_VERSION_MAJOR << 24U) \
18  | (STM32_CORE_VERSION_MINOR << 16U) \
19  | (STM32_CORE_VERSION_PATCH << 8U) \
20  | (STM32_CORE_VERSION_EXTRA))
21 
22 #ifndef F_CPU
23  #define F_CPU SystemCoreClock
24 #endif //F_CPU
25 
26 #ifndef USE_HAL_DRIVER
27  #define USE_HAL_DRIVER
28 #endif //USE_HAL_DRIVER
29 
30 #ifdef STM32F0xx
31  #include "stm32f0xx.h"
32 #elif defined(STM32F1xx)
33  #include "stm32f1xx.h"
34 #elif defined(STM32F2xx)
35  #include "stm32f2xx.h"
36 #elif defined(STM32F3xx)
37  #include "stm32f3xx.h"
38 #elif defined(STM32F4xx)
39  #include "stm32f4xx.h"
40 #elif defined(STM32F7xx)
41  #include "stm32f7xx.h"
42 #elif defined(STM32G0xx)
43  #include "stm32g0xx.h"
44 #elif defined(STM32H7xx)
45  #include "stm32h7xx.h"
46 #elif defined(STM32L0xx)
47  #include "stm32l0xx.h"
48 #elif defined(STM32L1xx)
49  #include "stm32l1xx.h"
50 #elif defined(STM32L4xx)
51  #include "stm32l4xx.h"
52 #elif defined(STM32WBxx)
53  #include "stm32wbxx.h"
54 #else
55  #error "STM32YYxx chip series is not defined in boards.txt."
56 #endif
57 
58 // Here define some compatibility
59 #ifndef CAN1
60  #define CAN1 CAN
61 #endif
62 
63 /**
64  * Libc porting layers
65  */
66 #if defined(__GNUC__) /* GCC CS3 */
67  #define WEAK __attribute__((weak))
68 #endif
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif // __cplusplus
73 
74 // weaked functions declaration
75 void SystemClock_Config(void);
76 
77 //void _Error_Handler(const char *, int);
78 
79 //#define Error_Handler() _Error_Handler(__FILE__, __LINE__)
80 
81 #ifdef __cplusplus
82 } // extern "C"
83 #endif // __cplusplus
84 
85 #endif //_STM32_DEF_
SystemClock_Config
void SystemClock_Config(void)
System Clock Configuration.
Definition: main.c:295