Rev 2 | Rev 4 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 3 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | * the "License"; You may not use this file except in compliance with the |
12 | * the "License"; You may not use this file except in compliance with the |
13 | * License. You may obtain a copy of the License at: |
13 | * License. You may obtain a copy of the License at: |
14 | * opensource.org/licenses/BSD-3-Clause |
14 | * opensource.org/licenses/BSD-3-Clause |
15 | * |
15 | * |
16 | ****************************************************************************** |
16 | ****************************************************************************** |
17 | */ |
17 | */ |
18 | 18 | ||
19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | #ifndef __STM32F0xx_HAL_CONF_H |
20 | #ifndef __STM32F0xx_HAL_CONF_H |
21 | #define __STM32F0xx_HAL_CONF_H |
21 | #define __STM32F0xx_HAL_CONF_H |
22 | 22 | ||
Line 27... | Line 27... | ||
27 | /* Exported types ------------------------------------------------------------*/ |
27 | /* Exported types ------------------------------------------------------------*/ |
28 | /* Exported constants --------------------------------------------------------*/ |
28 | /* Exported constants --------------------------------------------------------*/ |
29 | 29 | ||
30 | /* ########################## Module Selection ############################## */ |
30 | /* ########################## Module Selection ############################## */ |
31 | /** |
31 | /** |
32 | * @brief This is the list of modules to be used in the HAL driver |
32 | * @brief This is the list of modules to be used in the HAL driver |
33 | */ |
33 | */ |
34 | #define HAL_MODULE_ENABLED |
34 | #define HAL_MODULE_ENABLED |
35 | #define HAL_ADC_MODULE_ENABLED |
35 | #define HAL_ADC_MODULE_ENABLED |
36 | /*#define HAL_CRYP_MODULE_ENABLED */ |
36 | /*#define HAL_CRYP_MODULE_ENABLED */ |
37 | /*#define HAL_CAN_MODULE_ENABLED */ |
37 | /*#define HAL_CAN_MODULE_ENABLED */ |
38 | /*#define HAL_CEC_MODULE_ENABLED */ |
38 | /*#define HAL_CEC_MODULE_ENABLED */ |
39 | /*#define HAL_COMP_MODULE_ENABLED */ |
39 | /*#define HAL_COMP_MODULE_ENABLED */ |
Line 45... | Line 45... | ||
45 | /*#define HAL_IWDG_MODULE_ENABLED */ |
45 | /*#define HAL_IWDG_MODULE_ENABLED */ |
46 | /*#define HAL_LCD_MODULE_ENABLED */ |
46 | /*#define HAL_LCD_MODULE_ENABLED */ |
47 | /*#define HAL_LPTIM_MODULE_ENABLED */ |
47 | /*#define HAL_LPTIM_MODULE_ENABLED */ |
48 | /*#define HAL_RNG_MODULE_ENABLED */ |
48 | /*#define HAL_RNG_MODULE_ENABLED */ |
49 | /*#define HAL_RTC_MODULE_ENABLED */ |
49 | /*#define HAL_RTC_MODULE_ENABLED */ |
50 | /*#define HAL_SPI_MODULE_ENABLED */ |
50 | #define HAL_SPI_MODULE_ENABLED |
51 | #define HAL_TIM_MODULE_ENABLED |
51 | #define HAL_TIM_MODULE_ENABLED |
52 | #define HAL_UART_MODULE_ENABLED |
52 | #define HAL_UART_MODULE_ENABLED |
53 | /*#define HAL_USART_MODULE_ENABLED */ |
53 | /*#define HAL_USART_MODULE_ENABLED */ |
54 | /*#define HAL_IRDA_MODULE_ENABLED */ |
54 | /*#define HAL_IRDA_MODULE_ENABLED */ |
55 | /*#define HAL_SMARTCARD_MODULE_ENABLED */ |
55 | /*#define HAL_SMARTCARD_MODULE_ENABLED */ |
Line 67... | Line 67... | ||
67 | 67 | ||
68 | /* ########################## HSE/HSI Values adaptation ##################### */ |
68 | /* ########################## HSE/HSI Values adaptation ##################### */ |
69 | /** |
69 | /** |
70 | * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. |
70 | * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. |
71 | * This value is used by the RCC HAL module to compute the system frequency |
71 | * This value is used by the RCC HAL module to compute the system frequency |
72 | * (when HSE is used as system clock source, directly or through the PLL). |
72 | * (when HSE is used as system clock source, directly or through the PLL). |
73 | */ |
73 | */ |
74 | #if !defined (HSE_VALUE) |
74 | #if !defined (HSE_VALUE) |
75 | #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ |
75 | #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ |
76 | #endif /* HSE_VALUE */ |
76 | #endif /* HSE_VALUE */ |
77 | 77 | ||
78 | /** |
78 | /** |
79 | * @brief In the following line adjust the External High Speed oscillator (HSE) Startup |
79 | * @brief In the following line adjust the External High Speed oscillator (HSE) Startup |
80 | * Timeout value |
80 | * Timeout value |
81 | */ |
81 | */ |
82 | #if !defined (HSE_STARTUP_TIMEOUT) |
82 | #if !defined (HSE_STARTUP_TIMEOUT) |
83 | #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ |
83 | #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ |
84 | #endif /* HSE_STARTUP_TIMEOUT */ |
84 | #endif /* HSE_STARTUP_TIMEOUT */ |
85 | 85 | ||
86 | /** |
86 | /** |
87 | * @brief Internal High Speed oscillator (HSI) value. |
87 | * @brief Internal High Speed oscillator (HSI) value. |
88 | * This value is used by the RCC HAL module to compute the system frequency |
88 | * This value is used by the RCC HAL module to compute the system frequency |
89 | * (when HSI is used as system clock source, directly or through the PLL). |
89 | * (when HSI is used as system clock source, directly or through the PLL). |
90 | */ |
90 | */ |
91 | #if !defined (HSI_VALUE) |
91 | #if !defined (HSI_VALUE) |
92 | #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ |
92 | #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ |
93 | #endif /* HSI_VALUE */ |
93 | #endif /* HSI_VALUE */ |
94 | 94 | ||
95 | /** |
95 | /** |
96 | * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup |
96 | * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup |
97 | * Timeout value |
97 | * Timeout value |
98 | */ |
98 | */ |
99 | #if !defined (HSI_STARTUP_TIMEOUT) |
99 | #if !defined (HSI_STARTUP_TIMEOUT) |
100 | #define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ |
100 | #define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ |
101 | #endif /* HSI_STARTUP_TIMEOUT */ |
101 | #endif /* HSI_STARTUP_TIMEOUT */ |
102 | 102 | ||
103 | /** |
103 | /** |
104 | * @brief Internal High Speed oscillator for ADC (HSI14) value. |
104 | * @brief Internal High Speed oscillator for ADC (HSI14) value. |
105 | */ |
105 | */ |
106 | #if !defined (HSI14_VALUE) |
106 | #if !defined (HSI14_VALUE) |
107 | #define HSI14_VALUE ((uint32_t)14000000) /*!< Value of the Internal High Speed oscillator for ADC in Hz. |
107 | #define HSI14_VALUE ((uint32_t)14000000) /*!< Value of the Internal High Speed oscillator for ADC in Hz. |
108 | The real value may vary depending on the variations |
108 | The real value may vary depending on the variations |
109 | in voltage and temperature. */ |
109 | in voltage and temperature. */ |
110 | #endif /* HSI14_VALUE */ |
110 | #endif /* HSI14_VALUE */ |
111 | 111 | ||
112 | /** |
112 | /** |
113 | * @brief Internal High Speed oscillator for USB (HSI48) value. |
113 | * @brief Internal High Speed oscillator for USB (HSI48) value. |
114 | */ |
114 | */ |
115 | #if !defined (HSI48_VALUE) |
115 | #if !defined (HSI48_VALUE) |
116 | #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal High Speed oscillator for USB in Hz. |
116 | #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal High Speed oscillator for USB in Hz. |
117 | The real value may vary depending on the variations |
117 | The real value may vary depending on the variations |
118 | in voltage and temperature. */ |
118 | in voltage and temperature. */ |
119 | #endif /* HSI48_VALUE */ |
119 | #endif /* HSI48_VALUE */ |
120 | 120 | ||
121 | /** |
121 | /** |
122 | * @brief Internal Low Speed oscillator (LSI) value. |
122 | * @brief Internal Low Speed oscillator (LSI) value. |
123 | */ |
123 | */ |
124 | #if !defined (LSI_VALUE) |
124 | #if !defined (LSI_VALUE) |
125 | #define LSI_VALUE ((uint32_t)40000) |
125 | #define LSI_VALUE ((uint32_t)40000) |
126 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz |
126 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz |
127 | The real value may vary depending on the variations |
127 | The real value may vary depending on the variations |
128 | in voltage and temperature. */ |
128 | in voltage and temperature. */ |
129 | /** |
129 | /** |
130 | * @brief External Low Speed oscillator (LSI) value. |
130 | * @brief External Low Speed oscillator (LSI) value. |
131 | */ |
131 | */ |
132 | #if !defined (LSE_VALUE) |
132 | #if !defined (LSE_VALUE) |
133 | #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ |
133 | #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ |
134 | #endif /* LSE_VALUE */ |
134 | #endif /* LSE_VALUE */ |
135 | 135 | ||
136 | #if !defined (LSE_STARTUP_TIMEOUT) |
136 | #if !defined (LSE_STARTUP_TIMEOUT) |
137 | #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ |
137 | #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ |
138 | #endif /* LSE_STARTUP_TIMEOUT */ |
138 | #endif /* LSE_STARTUP_TIMEOUT */ |
139 | 139 | ||
Line 141... | Line 141... | ||
141 | === you can define the HSE value in your toolchain compiler preprocessor. */ |
141 | === you can define the HSE value in your toolchain compiler preprocessor. */ |
142 | 142 | ||
143 | /* ########################### System Configuration ######################### */ |
143 | /* ########################### System Configuration ######################### */ |
144 | /** |
144 | /** |
145 | * @brief This is the HAL system configuration section |
145 | * @brief This is the HAL system configuration section |
146 | */ |
146 | */ |
147 | #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ |
147 | #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ |
148 | #define TICK_INT_PRIORITY ((uint32_t)0) /*!< tick interrupt priority (lowest by default) */ |
148 | #define TICK_INT_PRIORITY ((uint32_t)0) /*!< tick interrupt priority (lowest by default) */ |
149 | /* Warning: Must be set to higher priority for HAL_Delay() */ |
149 | /* Warning: Must be set to higher priority for HAL_Delay() */ |
150 | /* and HAL_GetTick() usage under interrupt context */ |
150 | /* and HAL_GetTick() usage under interrupt context */ |
151 | #define USE_RTOS 0 |
151 | #define USE_RTOS 0 |
152 | #define PREFETCH_ENABLE 1 |
152 | #define PREFETCH_ENABLE 1 |
153 | #define INSTRUCTION_CACHE_ENABLE 0 |
153 | #define INSTRUCTION_CACHE_ENABLE 0 |
154 | #define DATA_CACHE_ENABLE 0 |
154 | #define DATA_CACHE_ENABLE 0 |
155 | #define USE_SPI_CRC 0U |
155 | #define USE_SPI_CRC 0U |
156 | 156 | ||
157 | #define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ |
157 | #define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ |
Line 173... | Line 173... | ||
173 | #define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ |
173 | #define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ |
174 | #define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ |
174 | #define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ |
175 | 175 | ||
176 | /* ########################## Assert Selection ############################## */ |
176 | /* ########################## Assert Selection ############################## */ |
177 | /** |
177 | /** |
178 | * @brief Uncomment the line below to expanse the "assert_param" macro in the |
178 | * @brief Uncomment the line below to expanse the "assert_param" macro in the |
179 | * HAL drivers code |
179 | * HAL drivers code |
180 | */ |
180 | */ |
181 | /* #define USE_FULL_ASSERT 1U */ |
181 | /* #define USE_FULL_ASSERT 1U */ |
182 | 182 | ||
183 | /* Includes ------------------------------------------------------------------*/ |
183 | /* Includes ------------------------------------------------------------------*/ |
184 | /** |
184 | /** |
185 | * @brief Include module's header file |
185 | * @brief Include module's header file |
186 | */ |
186 | */ |
187 | 187 | ||
188 | #ifdef HAL_RCC_MODULE_ENABLED |
188 | #ifdef HAL_RCC_MODULE_ENABLED |
189 | #include "stm32f0xx_hal_rcc.h" |
189 | #include "stm32f0xx_hal_rcc.h" |
190 | #endif /* HAL_RCC_MODULE_ENABLED */ |
190 | #endif /* HAL_RCC_MODULE_ENABLED */ |
Line 297... | Line 297... | ||
297 | #ifdef USE_FULL_ASSERT |
297 | #ifdef USE_FULL_ASSERT |
298 | /** |
298 | /** |
299 | * @brief The assert_param macro is used for function's parameters check. |
299 | * @brief The assert_param macro is used for function's parameters check. |
300 | * @param expr If expr is false, it calls assert_failed function |
300 | * @param expr If expr is false, it calls assert_failed function |
301 | * which reports the name of the source file and the source |
301 | * which reports the name of the source file and the source |
302 | * line number of the call that failed. |
302 | * line number of the call that failed. |
303 | * If expr is true, it returns no value. |
303 | * If expr is true, it returns no value. |
304 | * @retval None |
304 | * @retval None |
305 | */ |
305 | */ |
306 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) |
306 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) |
307 | /* Exported functions ------------------------------------------------------- */ |
307 | /* Exported functions ------------------------------------------------------- */ |
308 | void assert_failed(uint8_t* file, uint32_t line); |
308 | void assert_failed(uint8_t* file, uint32_t line); |
309 | #else |
309 | #else |
310 | #define assert_param(expr) ((void)0U) |
310 | #define assert_param(expr) ((void)0U) |
311 | #endif /* USE_FULL_ASSERT */ |
311 | #endif /* USE_FULL_ASSERT */ |
312 | 312 | ||
313 | #ifdef __cplusplus |
313 | #ifdef __cplusplus |
314 | } |
314 | } |
315 | #endif |
315 | #endif |
316 | 316 | ||
317 | #endif /* __STM32F0xx_HAL_CONF_H */ |
317 | #endif /* __STM32F0xx_HAL_CONF_H */ |