2 ******************************************************************************
\r
3 * @file Template/stm32f7xx_hal_conf.h
\r
4 * @author MCD Application Team
\r
6 * @date 21-October-2014
\r
7 * @brief HAL configuration template file.
\r
8 * This file should be copied to the application folder and renamed
\r
9 * to stm32f7xx_hal_conf.h.
\r
10 ******************************************************************************
\r
13 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
\r
15 * Redistribution and use in source and binary forms, with or without modification,
\r
16 * are permitted provided that the following conditions are met:
\r
17 * 1. Redistributions of source code must retain the above copyright notice,
\r
18 * this list of conditions and the following disclaimer.
\r
19 * 2. Redistributions in binary form must reproduce the above copyright notice,
\r
20 * this list of conditions and the following disclaimer in the documentation
\r
21 * and/or other materials provided with the distribution.
\r
22 * 3. Neither the name of STMicroelectronics nor the names of its contributors
\r
23 * may be used to endorse or promote products derived from this software
\r
24 * without specific prior written permission.
\r
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
\r
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
\r
29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
\r
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
\r
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
\r
33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
\r
34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
\r
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
37 ******************************************************************************
\r
41 /* Define to prevent recursive inclusion -------------------------------------*/
\r
42 #ifndef __STM32F7xx_HAL_CONF_H
\r
43 #define __STM32F7xx_HAL_CONF_H
\r
49 /* Exported types ------------------------------------------------------------*/
\r
50 /* Exported constants --------------------------------------------------------*/
\r
52 /* ########################## Module Selection ############################## */
\r
54 * @brief This is the list of modules to be used in the HAL driver
\r
56 #define HAL_MODULE_ENABLED
\r
57 #define HAL_ADC_MODULE_ENABLED
\r
58 #define HAL_CAN_MODULE_ENABLED
\r
59 #define HAL_CEC_MODULE_ENABLED
\r
60 #define HAL_CRC_MODULE_ENABLED
\r
61 #define HAL_CRYP_MODULE_ENABLED
\r
62 #define HAL_DAC_MODULE_ENABLED
\r
63 #define HAL_DCMI_MODULE_ENABLED
\r
64 #define HAL_DMA_MODULE_ENABLED
\r
65 #define HAL_DMA2D_MODULE_ENABLED
\r
66 //#define HAL_ETH_MODULE_ENABLED
\r
67 #define HAL_FLASH_MODULE_ENABLED
\r
68 //#define HAL_NAND_MODULE_ENABLED
\r
69 #define HAL_NOR_MODULE_ENABLED
\r
70 #define HAL_SRAM_MODULE_ENABLED
\r
71 #define HAL_SDRAM_MODULE_ENABLED
\r
72 #define HAL_HASH_MODULE_ENABLED
\r
73 #define HAL_GPIO_MODULE_ENABLED
\r
74 #define HAL_I2C_MODULE_ENABLED
\r
75 //#define HAL_I2S_MODULE_ENABLED
\r
76 //#define HAL_IWDG_MODULE_ENABLED
\r
77 #define HAL_LPTIM_MODULE_ENABLED
\r
78 #define HAL_LTDC_MODULE_ENABLED
\r
79 #define HAL_PWR_MODULE_ENABLED
\r
80 #define HAL_QSPI_MODULE_ENABLED
\r
81 #define HAL_RCC_MODULE_ENABLED
\r
82 #define HAL_RNG_MODULE_ENABLED
\r
83 #define HAL_RTC_MODULE_ENABLED
\r
84 //#define HAL_SAI_MODULE_ENABLED
\r
85 //#define HAL_SD_MODULE_ENABLED
\r
86 #define HAL_SPI_MODULE_ENABLED
\r
87 #define HAL_TIM_MODULE_ENABLED
\r
88 #define HAL_UART_MODULE_ENABLED
\r
89 #define HAL_USART_MODULE_ENABLED
\r
90 #define HAL_IRDA_MODULE_ENABLED
\r
91 #define HAL_SMARTCARD_MODULE_ENABLED
\r
92 //#define HAL_WWDG_MODULE_ENABLED
\r
93 #define HAL_CORTEX_MODULE_ENABLED
\r
94 //#define HAL_PCD_MODULE_ENABLED
\r
95 //#define HAL_HCD_MODULE_ENABLED
\r
97 /* ########################## HSE/HSI Values adaptation ##################### */
\r
99 * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
\r
100 * This value is used by the RCC HAL module to compute the system frequency
\r
101 * (when HSE is used as system clock source, directly or through the PLL).
\r
103 #if !defined (HSE_VALUE)
\r
104 #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
\r
105 #endif /* HSE_VALUE */
\r
107 #if !defined (HSE_STARTUP_TIMEOUT)
\r
108 #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */
\r
109 #endif /* HSE_STARTUP_TIMEOUT */
\r
112 * @brief Internal High Speed oscillator (HSI) value.
\r
113 * This value is used by the RCC HAL module to compute the system frequency
\r
114 * (when HSI is used as system clock source, directly or through the PLL).
\r
116 #if !defined (HSI_VALUE)
\r
117 #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
\r
118 #endif /* HSI_VALUE */
\r
121 * @brief Internal Low Speed oscillator (LSI) value.
\r
123 #if !defined (LSI_VALUE)
\r
124 #define LSI_VALUE ((uint32_t)40000)
\r
125 #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
\r
126 The real value may vary depending on the variations
\r
127 in voltage and temperature. */
\r
129 * @brief External Low Speed oscillator (LSE) value.
\r
131 #if !defined (LSE_VALUE)
\r
132 #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */
\r
133 #endif /* LSE_VALUE */
\r
136 * @brief External clock source for I2S peripheral
\r
137 * This value is used by the I2S HAL module to compute the I2S clock source
\r
138 * frequency, this source is inserted directly through I2S_CKIN pad.
\r
140 #if !defined (EXTERNAL_CLOCK_VALUE)
\r
141 #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/
\r
142 #endif /* EXTERNAL_CLOCK_VALUE */
\r
144 /* Tip: To avoid modifying this file each time you need to use different HSE,
\r
145 === you can define the HSE value in your toolchain compiler preprocessor. */
\r
147 /* ########################### System Configuration ######################### */
\r
149 * @brief This is the HAL system configuration section
\r
151 #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
\r
152 #define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */
\r
154 #define ART_ACCLERATOR_ENABLE 1 /* To enable instruction cache and prefetch */
\r
156 /* ########################## Assert Selection ############################## */
\r
158 * @brief Uncomment the line below to expanse the "assert_param" macro in the
\r
161 /* #define USE_FULL_ASSERT 1 */
\r
163 /* ################## Ethernet peripheral configuration ##################### */
\r
165 /* Section 1 : Ethernet peripheral configuration */
\r
167 /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
\r
168 #define MAC_ADDR0 2
\r
169 #define MAC_ADDR1 0
\r
170 #define MAC_ADDR2 0
\r
171 #define MAC_ADDR3 0
\r
172 #define MAC_ADDR4 0
\r
173 #define MAC_ADDR5 0
\r
175 /* Definition of the Ethernet driver buffers size and count */
\r
176 #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
\r
177 #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
\r
178 #define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
\r
179 #define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
\r
181 /* Section 2: PHY configuration section */
\r
183 /* DP83848 PHY Address*/
\r
184 #define DP83848_PHY_ADDRESS 0x01
\r
185 /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
\r
186 #define PHY_RESET_DELAY ((uint32_t)0x000000FF)
\r
187 /* PHY Configuration delay */
\r
188 #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
\r
190 #define PHY_READ_TO ((uint32_t)0x0000FFFF)
\r
191 #define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
\r
193 /* Section 3: Common PHY Registers */
\r
195 #define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
\r
196 #define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
\r
198 #define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
\r
199 #define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
\r
200 #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
\r
201 #define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
\r
202 #define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
\r
203 #define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
\r
204 #define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
\r
205 #define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
\r
206 #define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
\r
207 #define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
\r
209 #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
\r
210 #define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
\r
211 #define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
\r
213 /* Section 4: Extended PHY Registers */
\r
215 #define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */
\r
216 #define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */
\r
217 #define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */
\r
219 #define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
\r
220 #define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
\r
221 #define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
\r
223 #define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
\r
224 #define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
\r
226 #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
\r
227 #define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
\r
229 /* Includes ------------------------------------------------------------------*/
\r
231 * @brief Include module's header file
\r
234 #ifdef HAL_RCC_MODULE_ENABLED
\r
235 #include "stm32f7xx_hal_rcc.h"
\r
236 #endif /* HAL_RCC_MODULE_ENABLED */
\r
238 #ifdef HAL_GPIO_MODULE_ENABLED
\r
239 #include "stm32f7xx_hal_gpio.h"
\r
240 #endif /* HAL_GPIO_MODULE_ENABLED */
\r
242 #ifdef HAL_DMA_MODULE_ENABLED
\r
243 #include "stm32f7xx_hal_dma.h"
\r
244 #endif /* HAL_DMA_MODULE_ENABLED */
\r
246 #ifdef HAL_CORTEX_MODULE_ENABLED
\r
247 #include "stm32f7xx_hal_cortex.h"
\r
248 #endif /* HAL_CORTEX_MODULE_ENABLED */
\r
250 #ifdef HAL_ADC_MODULE_ENABLED
\r
251 #include "stm32f7xx_hal_adc.h"
\r
252 #endif /* HAL_ADC_MODULE_ENABLED */
\r
254 #ifdef HAL_CAN_MODULE_ENABLED
\r
255 #include "stm32f7xx_hal_can.h"
\r
256 #endif /* HAL_CAN_MODULE_ENABLED */
\r
258 #ifdef HAL_CEC_MODULE_ENABLED
\r
259 #include "stm32f7xx_hal_cec.h"
\r
260 #endif /* HAL_CEC_MODULE_ENABLED */
\r
262 #ifdef HAL_CRC_MODULE_ENABLED
\r
263 #include "stm32f7xx_hal_crc.h"
\r
264 #endif /* HAL_CRC_MODULE_ENABLED */
\r
266 #ifdef HAL_CRYP_MODULE_ENABLED
\r
267 #include "stm32f7xx_hal_cryp.h"
\r
268 #endif /* HAL_CRYP_MODULE_ENABLED */
\r
270 #ifdef HAL_DMA2D_MODULE_ENABLED
\r
271 #include "stm32f7xx_hal_dma2d.h"
\r
272 #endif /* HAL_DMA2D_MODULE_ENABLED */
\r
274 #ifdef HAL_DAC_MODULE_ENABLED
\r
275 #include "stm32f7xx_hal_dac.h"
\r
276 #endif /* HAL_DAC_MODULE_ENABLED */
\r
278 #ifdef HAL_DCMI_MODULE_ENABLED
\r
279 #include "stm32f7xx_hal_dcmi.h"
\r
280 #endif /* HAL_DCMI_MODULE_ENABLED */
\r
282 #ifdef HAL_ETH_MODULE_ENABLED
\r
283 #include "stm32f7xx_hal_eth.h"
\r
284 #endif /* HAL_ETH_MODULE_ENABLED */
\r
286 #ifdef HAL_FLASH_MODULE_ENABLED
\r
287 #include "stm32f7xx_hal_flash.h"
\r
288 #endif /* HAL_FLASH_MODULE_ENABLED */
\r
290 #ifdef HAL_SRAM_MODULE_ENABLED
\r
291 #include "stm32f7xx_hal_sram.h"
\r
292 #endif /* HAL_SRAM_MODULE_ENABLED */
\r
294 #ifdef HAL_NOR_MODULE_ENABLED
\r
295 #include "stm32f7xx_hal_nor.h"
\r
296 #endif /* HAL_NOR_MODULE_ENABLED */
\r
298 #ifdef HAL_NAND_MODULE_ENABLED
\r
299 #include "stm32f7xx_hal_nand.h"
\r
300 #endif /* HAL_NAND_MODULE_ENABLED */
\r
302 #ifdef HAL_SDRAM_MODULE_ENABLED
\r
303 #include "stm32f7xx_hal_sdram.h"
\r
304 #endif /* HAL_SDRAM_MODULE_ENABLED */
\r
306 #ifdef HAL_HASH_MODULE_ENABLED
\r
307 #include "stm32f7xx_hal_hash.h"
\r
308 #endif /* HAL_HASH_MODULE_ENABLED */
\r
310 #ifdef HAL_I2C_MODULE_ENABLED
\r
311 #include "stm32f7xx_hal_i2c.h"
\r
312 #endif /* HAL_I2C_MODULE_ENABLED */
\r
314 #ifdef HAL_I2S_MODULE_ENABLED
\r
315 #include "stm32f7xx_hal_i2s.h"
\r
316 #endif /* HAL_I2S_MODULE_ENABLED */
\r
318 #ifdef HAL_IWDG_MODULE_ENABLED
\r
319 #include "stm32f7xx_hal_iwdg.h"
\r
320 #endif /* HAL_IWDG_MODULE_ENABLED */
\r
322 #ifdef HAL_LPTIM_MODULE_ENABLED
\r
323 #include "stm32f7xx_hal_lptim.h"
\r
324 #endif /* HAL_LPTIM_MODULE_ENABLED */
\r
326 #ifdef HAL_LTDC_MODULE_ENABLED
\r
327 #include "stm32f7xx_hal_ltdc.h"
\r
328 #endif /* HAL_LTDC_MODULE_ENABLED */
\r
330 #ifdef HAL_PWR_MODULE_ENABLED
\r
331 #include "stm32f7xx_hal_pwr.h"
\r
332 #endif /* HAL_PWR_MODULE_ENABLED */
\r
334 #ifdef HAL_QSPI_MODULE_ENABLED
\r
335 #include "stm32f7xx_hal_qspi.h"
\r
336 #endif /* HAL_QSPI_MODULE_ENABLED */
\r
338 #ifdef HAL_RNG_MODULE_ENABLED
\r
339 #include "stm32f7xx_hal_rng.h"
\r
340 #endif /* HAL_RNG_MODULE_ENABLED */
\r
342 #ifdef HAL_RTC_MODULE_ENABLED
\r
343 #include "stm32f7xx_hal_rtc.h"
\r
344 #endif /* HAL_RTC_MODULE_ENABLED */
\r
346 #ifdef HAL_SAI_MODULE_ENABLED
\r
347 #include "stm32f7xx_hal_sai.h"
\r
348 #endif /* HAL_SAI_MODULE_ENABLED */
\r
350 #ifdef HAL_SD_MODULE_ENABLED
\r
351 #include "stm32f7xx_hal_sd.h"
\r
352 #endif /* HAL_SD_MODULE_ENABLED */
\r
354 #ifdef HAL_SPI_MODULE_ENABLED
\r
355 #include "stm32f7xx_hal_spi.h"
\r
356 #endif /* HAL_SPI_MODULE_ENABLED */
\r
358 #ifdef HAL_TIM_MODULE_ENABLED
\r
359 #include "stm32f7xx_hal_tim.h"
\r
360 #endif /* HAL_TIM_MODULE_ENABLED */
\r
362 #ifdef HAL_UART_MODULE_ENABLED
\r
363 #include "stm32f7xx_hal_uart.h"
\r
364 #endif /* HAL_UART_MODULE_ENABLED */
\r
366 #ifdef HAL_USART_MODULE_ENABLED
\r
367 #include "stm32f7xx_hal_usart.h"
\r
368 #endif /* HAL_USART_MODULE_ENABLED */
\r
370 #ifdef HAL_IRDA_MODULE_ENABLED
\r
371 #include "stm32f7xx_hal_irda.h"
\r
372 #endif /* HAL_IRDA_MODULE_ENABLED */
\r
374 #ifdef HAL_SMARTCARD_MODULE_ENABLED
\r
375 #include "stm32f7xx_hal_smartcard.h"
\r
376 #endif /* HAL_SMARTCARD_MODULE_ENABLED */
\r
378 #ifdef HAL_WWDG_MODULE_ENABLED
\r
379 #include "stm32f7xx_hal_wwdg.h"
\r
380 #endif /* HAL_WWDG_MODULE_ENABLED */
\r
382 #ifdef HAL_PCD_MODULE_ENABLED
\r
383 #include "stm32f7xx_hal_pcd.h"
\r
384 #endif /* HAL_PCD_MODULE_ENABLED */
\r
386 #ifdef HAL_HCD_MODULE_ENABLED
\r
387 #include "stm32f7xx_hal_hcd.h"
\r
388 #endif /* HAL_HCD_MODULE_ENABLED */
\r
390 /* Exported macro ------------------------------------------------------------*/
\r
391 #ifdef USE_FULL_ASSERT
\r
393 * @brief The assert_param macro is used for function's parameters check.
\r
394 * @param expr: If expr is false, it calls assert_failed function
\r
395 * which reports the name of the source file and the source
\r
396 * line number of the call that failed.
\r
397 * If expr is true, it returns no value.
\r
400 #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
\r
401 /* Exported functions ------------------------------------------------------- */
\r
402 void assert_failed(uint8_t* file, uint32_t line);
\r
404 #define assert_param(expr) ((void)0)
\r
405 #endif /* USE_FULL_ASSERT */
\r
412 #endif /* __STM32F7xx_HAL_CONF_H */
\r
415 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r