Browse code

Add source code of the firmware for the IO Board

Pawel Jablonski authored on 05/06/2023 17:01:27
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,374 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    stm32f0xx_hal_conf.h
4
+  * @author  MCD Application Team
5
+  * @brief   HAL configuration file.
6
+  *
7
+  * @note    modified by ARM
8
+  *          The modifications allow to use this file as User Code Template
9
+  *          within the Device Family Pack.
10
+  ******************************************************************************
11
+  * @attention
12
+  *
13
+  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
14
+  *
15
+  * Redistribution and use in source and binary forms, with or without modification,
16
+  * are permitted provided that the following conditions are met:
17
+  *   1. Redistributions of source code must retain the above copyright notice,
18
+  *      this list of conditions and the following disclaimer.
19
+  *   2. Redistributions in binary form must reproduce the above copyright notice,
20
+  *      this list of conditions and the following disclaimer in the documentation
21
+  *      and/or other materials provided with the distribution.
22
+  *   3. Neither the name of STMicroelectronics nor the names of its contributors
23
+  *      may be used to endorse or promote products derived from this software
24
+  *      without 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 ARE
29
+  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+  *
37
+  ******************************************************************************
38
+  */ 
39
+
40
+/* Define to prevent recursive inclusion -------------------------------------*/
41
+#ifndef __STM32F0xx_HAL_CONF_H
42
+#define __STM32F0xx_HAL_CONF_H
43
+
44
+#ifdef _RTE_
45
+#include "RTE_Components.h"             /* Component selection */
46
+#endif
47
+
48
+#ifdef __cplusplus
49
+ extern "C" {
50
+#endif
51
+
52
+/* Exported types ------------------------------------------------------------*/
53
+/* Exported constants --------------------------------------------------------*/
54
+
55
+/* ########################## Module Selection ############################## */
56
+/**
57
+  * @brief This is the list of modules to be used in the HAL driver 
58
+  */
59
+#ifdef RTE_DEVICE_HAL_COMMON
60
+#define HAL_MODULE_ENABLED
61
+#endif
62
+#ifdef RTE_DEVICE_HAL_ADC
63
+#define HAL_ADC_MODULE_ENABLED
64
+#endif
65
+#ifdef RTE_DEVICE_HAL_CAN
66
+#define HAL_CAN_MODULE_ENABLED
67
+#endif
68
+#ifdef RTE_DEVICE_HAL_CEC
69
+#define HAL_CEC_MODULE_ENABLED
70
+#endif
71
+#ifdef RTE_DEVICE_HAL_COMP
72
+#define HAL_COMP_MODULE_ENABLED
73
+#endif
74
+#ifdef RTE_DEVICE_HAL_CORTEX
75
+#define HAL_CORTEX_MODULE_ENABLED
76
+#endif
77
+#ifdef RTE_DEVICE_HAL_CRC
78
+#define HAL_CRC_MODULE_ENABLED
79
+#endif
80
+#ifdef RTE_DEVICE_HAL_DAC
81
+#define HAL_DAC_MODULE_ENABLED
82
+#endif
83
+#ifdef RTE_DEVICE_HAL_DMA
84
+#define HAL_DMA_MODULE_ENABLED
85
+#endif
86
+#ifdef RTE_DEVICE_HAL_FLASH
87
+#define HAL_FLASH_MODULE_ENABLED
88
+#endif
89
+#ifdef RTE_DEVICE_HAL_GPIO
90
+#define HAL_GPIO_MODULE_ENABLED
91
+#endif
92
+#ifdef RTE_DEVICE_HAL_I2C
93
+#define HAL_I2C_MODULE_ENABLED
94
+#endif
95
+#ifdef RTE_DEVICE_HAL_I2S
96
+#define HAL_I2S_MODULE_ENABLED
97
+#endif
98
+#ifdef RTE_DEVICE_HAL_IRDA
99
+#define HAL_IRDA_MODULE_ENABLED
100
+#endif
101
+#ifdef RTE_DEVICE_HAL_IWDG
102
+#define HAL_IWDG_MODULE_ENABLED
103
+#endif
104
+#ifdef RTE_DEVICE_HAL_PCD
105
+#define HAL_PCD_MODULE_ENABLED
106
+#endif
107
+#ifdef RTE_DEVICE_HAL_PWR
108
+#define HAL_PWR_MODULE_ENABLED
109
+#endif
110
+#ifdef RTE_DEVICE_HAL_RCC
111
+#define HAL_RCC_MODULE_ENABLED
112
+#endif
113
+#ifdef RTE_DEVICE_HAL_RTC
114
+#define HAL_RTC_MODULE_ENABLED
115
+#endif
116
+#ifdef RTE_DEVICE_HAL_SMARTCARD
117
+#define HAL_SMARTCARD_MODULE_ENABLED
118
+#endif
119
+#ifdef RTE_DEVICE_HAL_SMBUS
120
+#define HAL_SMBUS_MODULE_ENABLED
121
+#endif
122
+#ifdef RTE_DEVICE_HAL_SPI
123
+#define HAL_SPI_MODULE_ENABLED
124
+#endif
125
+#ifdef RTE_DEVICE_HAL_TIM
126
+#define HAL_TIM_MODULE_ENABLED
127
+#endif
128
+#ifdef RTE_DEVICE_HAL_TSC
129
+#define HAL_TSC_MODULE_ENABLED
130
+#endif
131
+#ifdef RTE_DEVICE_HAL_UART
132
+#define HAL_UART_MODULE_ENABLED
133
+#endif
134
+#ifdef RTE_DEVICE_HAL_USART
135
+#define HAL_USART_MODULE_ENABLED
136
+#endif
137
+#ifdef RTE_DEVICE_HAL_WWDG
138
+#define HAL_WWDG_MODULE_ENABLED
139
+#endif
140
+
141
+/* ######################### Oscillator Values adaptation ################### */
142
+/**
143
+  * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
144
+  *        This value is used by the RCC HAL module to compute the system frequency
145
+  *        (when HSE is used as system clock source, directly or through the PLL).  
146
+  */
147
+#if !defined  (HSE_VALUE) 
148
+  #define HSE_VALUE            8000000U  /*!< Value of the External oscillator in Hz */
149
+#endif /* HSE_VALUE */
150
+
151
+/**
152
+  * @brief In the following line adjust the External High Speed oscillator (HSE) Startup 
153
+  *        Timeout value 
154
+  */
155
+#if !defined  (HSE_STARTUP_TIMEOUT)
156
+  #define HSE_STARTUP_TIMEOUT  100U      /*!< Time out for HSE start up, in ms */
157
+#endif /* HSE_STARTUP_TIMEOUT */
158
+
159
+/**
160
+  * @brief Internal High Speed oscillator (HSI) value.
161
+  *        This value is used by the RCC HAL module to compute the system frequency
162
+  *        (when HSI is used as system clock source, directly or through the PLL). 
163
+  */
164
+#if !defined  (HSI_VALUE)
165
+  #define HSI_VALUE            8000000U  /*!< Value of the Internal oscillator in Hz*/
166
+#endif /* HSI_VALUE */
167
+
168
+/**
169
+  * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup 
170
+  *        Timeout value 
171
+  */
172
+#if !defined  (HSI_STARTUP_TIMEOUT) 
173
+  #define HSI_STARTUP_TIMEOUT  5000U     /*!< Time out for HSI start up */
174
+#endif /* HSI_STARTUP_TIMEOUT */  
175
+
176
+/**
177
+  * @brief Internal High Speed oscillator for ADC (HSI14) value.
178
+  */
179
+#if !defined  (HSI14_VALUE) 
180
+  #define HSI14_VALUE          14000000U /*!< Value of the Internal High Speed oscillator for ADC in Hz.
181
+                                             The real value may vary depending on the variations
182
+                                             in voltage and temperature.  */
183
+#endif /* HSI14_VALUE */
184
+
185
+/**
186
+  * @brief Internal High Speed oscillator for USB (HSI48) value.
187
+  */
188
+#if !defined  (HSI48_VALUE) 
189
+  #define HSI48_VALUE          48000000U /*!< Value of the Internal High Speed oscillator for USB in Hz.
190
+                                             The real value may vary depending on the variations
191
+                                             in voltage and temperature.  */
192
+#endif /* HSI48_VALUE */
193
+
194
+/**
195
+  * @brief Internal Low Speed oscillator (LSI) value.
196
+  */
197
+#if !defined  (LSI_VALUE) 
198
+  #define LSI_VALUE            40000U    
199
+#endif /* LSI_VALUE */                   /*!< Value of the Internal Low Speed oscillator in Hz
200
+                                             The real value may vary depending on the variations
201
+                                             in voltage and temperature.  */
202
+/**
203
+  * @brief External Low Speed oscillator (LSE) value.
204
+  */
205
+#if !defined  (LSE_VALUE)
206
+  #define LSE_VALUE            32768U    /*!< Value of the External Low Speed oscillator in Hz */
207
+#endif /* LSE_VALUE */
208
+
209
+/**
210
+  * @brief Time out for LSE start up value in ms.
211
+  */
212
+#if !defined  (LSE_STARTUP_TIMEOUT)
213
+  #define LSE_STARTUP_TIMEOUT  5000U     /*!< Time out for LSE start up, in ms */
214
+#endif /* LSE_STARTUP_TIMEOUT */     
215
+
216
+
217
+/* Tip: To avoid modifying this file each time you need to use different HSE,
218
+   ===  you can define the HSE value in your toolchain compiler preprocessor. */
219
+
220
+/* ########################### System Configuration ######################### */
221
+/**
222
+  * @brief This is the HAL system configuration section
223
+  */     
224
+#define  VDD_VALUE                    3300U  /*!< Value of VDD in mv */           
225
+#define  TICK_INT_PRIORITY            ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default)             */
226
+                                                                              /*  Warning: Must be set to higher priority for HAL_Delay()  */
227
+                                                                              /*  and HAL_GetTick() usage under interrupt context          */
228
+#define  USE_RTOS                     0U
229
+#define  PREFETCH_ENABLE              1U
230
+#define  INSTRUCTION_CACHE_ENABLE     0U
231
+#define  DATA_CACHE_ENABLE            0U
232
+#define  USE_SPI_CRC                  1U
233
+
234
+/* ########################## Assert Selection ############################## */
235
+/**
236
+  * @brief Uncomment the line below to expanse the "assert_param" macro in the 
237
+  *        HAL drivers code
238
+  */
239
+/*#define USE_FULL_ASSERT    1*/
240
+
241
+/* Includes ------------------------------------------------------------------*/
242
+/**
243
+  * @brief Include module's header file 
244
+  */
245
+
246
+#ifdef HAL_RCC_MODULE_ENABLED
247
+ #include "stm32f0xx_hal_rcc.h"
248
+#endif /* HAL_RCC_MODULE_ENABLED */
249
+
250
+#ifdef HAL_GPIO_MODULE_ENABLED
251
+ #include "stm32f0xx_hal_gpio.h"
252
+#endif /* HAL_GPIO_MODULE_ENABLED */
253
+
254
+#ifdef HAL_DMA_MODULE_ENABLED
255
+  #include "stm32f0xx_hal_dma.h"
256
+#endif /* HAL_DMA_MODULE_ENABLED */
257
+
258
+#ifdef HAL_CORTEX_MODULE_ENABLED
259
+ #include "stm32f0xx_hal_cortex.h"
260
+#endif /* HAL_CORTEX_MODULE_ENABLED */
261
+
262
+#ifdef HAL_ADC_MODULE_ENABLED
263
+ #include "stm32f0xx_hal_adc.h"
264
+#endif /* HAL_ADC_MODULE_ENABLED */
265
+
266
+#ifdef HAL_CAN_MODULE_ENABLED
267
+ #include "stm32f0xx_hal_can.h"
268
+#endif /* HAL_CAN_MODULE_ENABLED */
269
+
270
+#ifdef HAL_CEC_MODULE_ENABLED
271
+ #include "stm32f0xx_hal_cec.h"
272
+#endif /* HAL_CEC_MODULE_ENABLED */
273
+
274
+#ifdef HAL_COMP_MODULE_ENABLED
275
+ #include "stm32f0xx_hal_comp.h"
276
+#endif /* HAL_COMP_MODULE_ENABLED */
277
+
278
+#ifdef HAL_CRC_MODULE_ENABLED
279
+ #include "stm32f0xx_hal_crc.h"
280
+#endif /* HAL_CRC_MODULE_ENABLED */
281
+
282
+#ifdef HAL_DAC_MODULE_ENABLED
283
+ #include "stm32f0xx_hal_dac.h"
284
+#endif /* HAL_DAC_MODULE_ENABLED */
285
+
286
+#ifdef HAL_FLASH_MODULE_ENABLED
287
+ #include "stm32f0xx_hal_flash.h"
288
+#endif /* HAL_FLASH_MODULE_ENABLED */
289
+
290
+#ifdef HAL_I2C_MODULE_ENABLED
291
+ #include "stm32f0xx_hal_i2c.h"
292
+#endif /* HAL_I2C_MODULE_ENABLED */
293
+
294
+#ifdef HAL_I2S_MODULE_ENABLED
295
+ #include "stm32f0xx_hal_i2s.h"
296
+#endif /* HAL_I2S_MODULE_ENABLED */
297
+
298
+#ifdef HAL_IRDA_MODULE_ENABLED
299
+ #include "stm32f0xx_hal_irda.h"
300
+#endif /* HAL_IRDA_MODULE_ENABLED */
301
+
302
+#ifdef HAL_IWDG_MODULE_ENABLED
303
+ #include "stm32f0xx_hal_iwdg.h"
304
+#endif /* HAL_IWDG_MODULE_ENABLED */
305
+
306
+#ifdef HAL_PCD_MODULE_ENABLED
307
+ #include "stm32f0xx_hal_pcd.h"
308
+#endif /* HAL_PCD_MODULE_ENABLED */
309
+
310
+#ifdef HAL_PWR_MODULE_ENABLED
311
+ #include "stm32f0xx_hal_pwr.h"
312
+#endif /* HAL_PWR_MODULE_ENABLED */
313
+
314
+#ifdef HAL_RTC_MODULE_ENABLED
315
+ #include "stm32f0xx_hal_rtc.h"
316
+#endif /* HAL_RTC_MODULE_ENABLED */
317
+
318
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
319
+ #include "stm32f0xx_hal_smartcard.h"
320
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
321
+
322
+#ifdef HAL_SMBUS_MODULE_ENABLED
323
+ #include "stm32f0xx_hal_smbus.h"
324
+#endif /* HAL_SMBUS_MODULE_ENABLED */
325
+
326
+#ifdef HAL_SPI_MODULE_ENABLED
327
+ #include "stm32f0xx_hal_spi.h"
328
+#endif /* HAL_SPI_MODULE_ENABLED */
329
+
330
+#ifdef HAL_TIM_MODULE_ENABLED
331
+ #include "stm32f0xx_hal_tim.h"
332
+#endif /* HAL_TIM_MODULE_ENABLED */
333
+
334
+#ifdef HAL_TSC_MODULE_ENABLED
335
+ #include "stm32f0xx_hal_tsc.h"
336
+#endif /* HAL_TSC_MODULE_ENABLED */
337
+
338
+#ifdef HAL_UART_MODULE_ENABLED
339
+ #include "stm32f0xx_hal_uart.h"
340
+#endif /* HAL_UART_MODULE_ENABLED */
341
+
342
+#ifdef HAL_USART_MODULE_ENABLED
343
+ #include "stm32f0xx_hal_usart.h"
344
+#endif /* HAL_USART_MODULE_ENABLED */
345
+
346
+#ifdef HAL_WWDG_MODULE_ENABLED
347
+ #include "stm32f0xx_hal_wwdg.h"
348
+#endif /* HAL_WWDG_MODULE_ENABLED */
349
+
350
+/* Exported macro ------------------------------------------------------------*/
351
+#ifdef  USE_FULL_ASSERT
352
+/**
353
+  * @brief  The assert_param macro is used for function's parameters check.
354
+  * @param  expr: If expr is false, it calls assert_failed function
355
+  *         which reports the name of the source file and the source
356
+  *         line number of the call that failed. 
357
+  *         If expr is true, it returns no value.
358
+  * @retval None
359
+  */
360
+  #define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__))
361
+/* Exported functions ------------------------------------------------------- */
362
+  void assert_failed(char* file, uint32_t line);
363
+#else
364
+  #define assert_param(expr) ((void)0U)
365
+#endif /* USE_FULL_ASSERT */    
366
+    
367
+#ifdef __cplusplus
368
+}
369
+#endif
370
+
371
+#endif /* __STM32F0xx_HAL_CONF_H */
372
+
373
+
374
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/