aboutsummaryrefslogtreecommitdiff
path: root/targets/stm32f429i_disc1_stm32cube/config/stm32f4xx_hal_conf.h
blob: f7d2c082f9b0a407f4307dc1a430a23d436974ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
// Copyright 2021 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

#pragma once

#include <stdint.h>

/* Clock setup */
#define HSI_VALUE 16000000U
#define LSI_VALUE 32000U

// The F429-disc has an 8Mhz external crystal
#define HSE_VALUE 8000000U
#define HSE_STARTUP_TIMEOUT 100U

// The F429-disc has no LSE
#define LSE_VALUE 0U
#define LSE_STARTUP_TIMEOUT 5000U

#define EXTERNAL_CLOCK_VALUE 0U

/* HAL Config */
#define TICK_INT_PRIORITY 0x0FU
#define USE_RTOS 0U
#define PREFETCH_ENABLE 1U
#define INSTRUCTION_CACHE_ENABLE 1U
#define DATA_CACHE_ENABLE 1U

#define assert_param(expr) ((void)0U)

/* Ethernet driver buffers size + count
 * (also used by FreeRTOS_Plus_TCP's stm32 driver) */
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE
#define ETH_RXBUFNB 4U
#define ETH_TXBUFNB 4U

/* Ethernet PHY Defines (unused by FreeRTOS_Plus_TCP's driver) */
#define PHY_RESET_DELAY 0x000000FFU
#define PHY_CONFIG_DELAY 0x00000FFFU

#define PHY_READ_TO 0x0000FFFFU
#define PHY_WRITE_TO 0x0000FFFFU

/* Common PHY Registers */
#define PHY_BCR ((uint16_t)0x0000)
#define PHY_BSR ((uint16_t)0x0001)

#define PHY_RESET ((uint16_t)0x8000)
#define PHY_LOOPBACK ((uint16_t)0x4000)
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100)
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000)
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100)
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000)
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000)
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200)
#define PHY_POWERDOWN ((uint16_t)0x0800)
#define PHY_ISOLATE ((uint16_t)0x0400)

#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020)
#define PHY_LINKED_STATUS ((uint16_t)0x0004)
#define PHY_JABBER_DETECTION ((uint16_t)0x0002)

/* Extended PHY Registers */
#define PHY_SR ((uint16_t)0x0010)
#define PHY_MICR ((uint16_t)0x0011)
#define PHY_MISR ((uint16_t)0x0012)

#define PHY_LINK_STATUS ((uint16_t)0x0001)
#define PHY_SPEED_STATUS ((uint16_t)0x0002)
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004)

#define PHY_MICR_INT_EN ((uint16_t)0x0002)
#define PHY_MICR_INT_OE ((uint16_t)0x0001)

#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020)
#define PHY_LINK_INTERRUPT ((uint16_t)0x2000)

// SPI config
#define USE_SPI_CRC 1U

/** HAL Headers: comment out defines + include to remove **/
/* primary HAL headers */
#define HAL_CORTEX_MODULE_ENABLED
#include "stm32f4xx_hal_cortex.h"

#define HAL_DMA_MODULE_ENABLED
#include "stm32f4xx_hal_dma.h"

#define HAL_EXTI_MODULE_ENABLED
#include "stm32f4xx_hal_exti.h"

#define HAL_GPIO_MODULE_ENABLED
#include "stm32f4xx_hal_gpio.h"

#define HAL_RCC_MODULE_ENABLED
#include "stm32f4xx_hal_rcc.h"

/* remaining headers (can be commented out if desired) */
#define HAL_ADC_MODULE_ENABLED
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_adc.h"

#define HAL_CAN_MODULE_ENABLED
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_can.h"

// #define HAL_CAN_LEGACY_MODULE_ENABLED
// #include "stm32f4xx_hal_can_legacy.h"

#define HAL_CEC_MODULE_ENABLED
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_cec.h"

#define HAL_CRC_MODULE_ENABLED
#include "stm32f4xx_hal_crc.h"

#define HAL_CRYP_MODULE_ENABLED
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_cryp.h"

#define HAL_DAC_MODULE_ENABLED
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_dac.h"

#define HAL_DCMI_MODULE_ENABLED
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_dcmi.h"

#define HAL_DMA2D_MODULE_ENABLED
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_dma2d.h"

#define HAL_DFSDM_MODULE_ENABLED
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_dfsdm.h"

#define HAL_DSI_MODULE_ENABLED
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_dsi.h"

#define HAL_ETH_MODULE_ENABLED
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_eth.h"

#define HAL_FLASH_MODULE_ENABLED
#include "stm32f4xx_hal_flash.h"

#define HAL_FMPI2C_MODULE_ENABLED
#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_fmpi2c.h"

#define HAL_FMPSMBUS_MODULE_ENABLED
#define USE_HAL_FMPSMBUS_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_fmpsmbus.h"

#define HAL_HASH_MODULE_ENABLED
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_hash.h"

#define HAL_HCD_MODULE_ENABLED
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_hcd.h"

#define HAL_I2C_MODULE_ENABLED
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_i2c.h"

#define HAL_I2S_MODULE_ENABLED
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_i2s.h"

#define HAL_IRDA_MODULE_ENABLED
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_irda.h"

#define HAL_IWDG_MODULE_ENABLED
#include "stm32f4xx_hal_iwdg.h"

#define HAL_LPTIM_MODULE_ENABLED
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_lptim.h"

#define HAL_LTDC_MODULE_ENABLED
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_ltdc.h"

#define HAL_MMC_MODULE_ENABLED
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_mmc.h"

#define HAL_NAND_MODULE_ENABLED
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_nand.h"

#define HAL_NOR_MODULE_ENABLED
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_nor.h"

#define HAL_PCCARD_MODULE_ENABLED
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_pccard.h"

#define HAL_PCD_MODULE_ENABLED
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_pcd.h"

#define HAL_PWR_MODULE_ENABLED
#include "stm32f4xx_hal_pwr.h"

#define HAL_QSPI_MODULE_ENABLED
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_qspi.h"

#define HAL_RNG_MODULE_ENABLED
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_rng.h"

#define HAL_RTC_MODULE_ENABLED
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_rtc.h"

#define HAL_SAI_MODULE_ENABLED
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_sai.h"

#define HAL_SD_MODULE_ENABLED
#define USE_HAL_SD_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_sd.h"

#define HAL_SDRAM_MODULE_ENABLED
#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_sdram.h"

#define HAL_SMARTCARD_MODULE_ENABLED
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_smartcard.h"

#define HAL_SMBUS_MODULE_ENABLED
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_smbus.h"

#define HAL_SPDIFRX_MODULE_ENABLED
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_spdifrx.h"

#define HAL_SPI_MODULE_ENABLED
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_spi.h"

#define HAL_SRAM_MODULE_ENABLED
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_sram.h"

#define HAL_TIM_MODULE_ENABLED
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_tim.h"

#define HAL_UART_MODULE_ENABLED
#define USE_HAL_UART_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_uart.h"

#define HAL_USART_MODULE_ENABLED
#define USE_HAL_USART_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_usart.h"

#define HAL_WWDG_MODULE_ENABLED
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U
#include "stm32f4xx_hal_wwdg.h"