Statistics
| Branch: | Tag: | Revision:

amiro-os / os / modules / PowerManagement_1-1 / mcuconf.h @ 801d8775

History | View | Annotate | Download (14.469 KB)

1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2018  Thomas Schöpping et al.
4

5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

    
19
#ifndef _MCUCONF_H_
20
#define _MCUCONF_H_
21

    
22
#define STM32F4xx_MCUCONF
23

    
24
/*
25
 * Some old revisions of F4x MCU randomly chrashes with certain compiler options enabled.
26
 * This flag makes the kernel dynamically detect the MCUs ID code and CPU ID and react accordingly.
27
 * (see ChibiOS kernel: os/hal/ports/STM32/STM32F4xx/hal_lld.c)
28
 */
29
#define STM32_USE_REVISION_A_FIX
30

    
31
/*
32
 * STM32F4xx drivers configuration.
33
 * The following settings override the default settings present in
34
 * the various device driver implementation headers.
35
 * Note that the settings for each driver only have effect if the whole
36
 * driver is enabled in halconf.h.
37
 *
38
 * IRQ priorities:
39
 * 15...0       Lowest...Highest.
40
 *
41
 * DMA priorities:
42
 * 0...3        Lowest...Highest.
43
 */
44

    
45
/*
46
 * HAL driver system settings.
47
 */
48
#define STM32_NO_INIT                       FALSE
49
#define STM32_HSI_ENABLED                   TRUE
50
#define STM32_LSI_ENABLED                   TRUE
51
#define STM32_HSE_ENABLED                   TRUE
52
#define STM32_LSE_ENABLED                   FALSE
53
#define STM32_CLOCK48_REQUIRED              TRUE
54
#define STM32_SW                            STM32_SW_PLL
55
#define STM32_PLLSRC                        STM32_PLLSRC_HSE
56
#define STM32_PLLM_VALUE                    8
57
#define STM32_PLLN_VALUE                    336
58
#define STM32_PLLP_VALUE                    2
59
#define STM32_PLLQ_VALUE                    7
60
#define STM32_HPRE                          STM32_HPRE_DIV1
61
#define STM32_PPRE1                         STM32_PPRE1_DIV4
62
#define STM32_PPRE2                         STM32_PPRE2_DIV2
63
#define STM32_RTCSEL                        STM32_RTCSEL_LSI
64
#define STM32_RTCPRE_VALUE                  8
65
#define STM32_MCO1SEL                       STM32_MCO1SEL_HSI
66
#define STM32_MCO1PRE                       STM32_MCO1PRE_DIV1
67
#define STM32_MCO2SEL                       STM32_MCO2SEL_SYSCLK
68
#define STM32_MCO2PRE                       STM32_MCO2PRE_DIV5
69
#define STM32_I2SSRC                        STM32_I2SSRC_CKIN
70
#define STM32_PLLI2SN_VALUE                 192
71
#define STM32_PLLI2SR_VALUE                 5
72
#define STM32_PVD_ENABLE                    FALSE
73
#define STM32_PLS                           STM32_PLS_LEV0
74
#define STM32_BKPRAM_ENABLE                 FALSE
75

    
76
/*
77
 * ADC driver system settings.
78
 */
79
#define STM32_ADC_ADCPRE                    ADC_CCR_ADCPRE_DIV4
80
#define STM32_ADC_USE_ADC1                  TRUE
81
#define STM32_ADC_USE_ADC2                  FALSE
82
#define STM32_ADC_USE_ADC3                  FALSE
83
#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(2, 4)
84
#define STM32_ADC_ADC2_DMA_STREAM           STM32_DMA_STREAM_ID(2, 2)
85
#define STM32_ADC_ADC3_DMA_STREAM           STM32_DMA_STREAM_ID(2, 1)
86
#define STM32_ADC_ADC1_DMA_PRIORITY         2
87
#define STM32_ADC_ADC2_DMA_PRIORITY         2
88
#define STM32_ADC_ADC3_DMA_PRIORITY         2
89
#define STM32_ADC_IRQ_PRIORITY              6
90
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     6
91
#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY     6
92
#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY     6
93

    
94
/*
95
 * CAN driver system settings.
96
 */
97
#define STM32_CAN_USE_CAN1                  TRUE
98
#define STM32_CAN_USE_CAN2                  FALSE
99
#define STM32_CAN_CAN1_IRQ_PRIORITY         11
100
#define STM32_CAN_CAN2_IRQ_PRIORITY         11
101

    
102
/*
103
 * DAC driver system settings.
104
 */
105
#define STM32_DAC_DUAL_MODE                 FALSE
106
#define STM32_DAC_USE_DAC1_CH1              FALSE
107
#define STM32_DAC_USE_DAC1_CH2              FALSE
108
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10
109
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10
110
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2
111
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2
112
#define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5)
113
#define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6)
114

    
115
/*
116
 * EXT driver system settings.
117
 */
118
#define STM32_EXT_EXTI0_IRQ_PRIORITY        6
119
#define STM32_EXT_EXTI1_IRQ_PRIORITY        6
120
#define STM32_EXT_EXTI2_IRQ_PRIORITY        6
121
#define STM32_EXT_EXTI3_IRQ_PRIORITY        6
122
#define STM32_EXT_EXTI4_IRQ_PRIORITY        6
123
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
124
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
125
#define STM32_EXT_EXTI16_IRQ_PRIORITY       6
126
#define STM32_EXT_EXTI17_IRQ_PRIORITY       15
127
#define STM32_EXT_EXTI18_IRQ_PRIORITY       6
128
#define STM32_EXT_EXTI19_IRQ_PRIORITY       6
129
#define STM32_EXT_EXTI20_IRQ_PRIORITY       6
130
#define STM32_EXT_EXTI21_IRQ_PRIORITY       15
131
#define STM32_EXT_EXTI22_IRQ_PRIORITY       15
132

    
133
/*
134
 * GPT driver system settings.
135
 */
136
#define STM32_GPT_USE_TIM1                  FALSE
137
#define STM32_GPT_USE_TIM2                  FALSE
138
#define STM32_GPT_USE_TIM3                  FALSE
139
#define STM32_GPT_USE_TIM4                  FALSE
140
#define STM32_GPT_USE_TIM5                  FALSE
141
#define STM32_GPT_USE_TIM6                  FALSE
142
#define STM32_GPT_USE_TIM7                  FALSE
143
#define STM32_GPT_USE_TIM8                  FALSE
144
#define STM32_GPT_USE_TIM9                  FALSE
145
#define STM32_GPT_USE_TIM11                 FALSE
146
#define STM32_GPT_USE_TIM12                 FALSE
147
#define STM32_GPT_USE_TIM14                 FALSE
148
#define STM32_GPT_TIM1_IRQ_PRIORITY         7
149
#define STM32_GPT_TIM2_IRQ_PRIORITY         7
150
#define STM32_GPT_TIM3_IRQ_PRIORITY         7
151
#define STM32_GPT_TIM4_IRQ_PRIORITY         7
152
#define STM32_GPT_TIM5_IRQ_PRIORITY         7
153
#define STM32_GPT_TIM6_IRQ_PRIORITY         7
154
#define STM32_GPT_TIM7_IRQ_PRIORITY         7
155
#define STM32_GPT_TIM8_IRQ_PRIORITY         7
156
#define STM32_GPT_TIM9_IRQ_PRIORITY         7
157
#define STM32_GPT_TIM11_IRQ_PRIORITY        7
158
#define STM32_GPT_TIM12_IRQ_PRIORITY        7
159
#define STM32_GPT_TIM14_IRQ_PRIORITY        7
160

    
161
/*
162
 * I2C driver system settings.
163
 */
164
#define STM32_I2C_USE_I2C1                  TRUE
165
#define STM32_I2C_USE_I2C2                  TRUE
166
#define STM32_I2C_USE_I2C3                  FALSE
167
#define STM32_I2C_BUSY_TIMEOUT              50
168
#define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
169
#define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 6)
170
#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
171
#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
172
#define STM32_I2C_I2C3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
173
#define STM32_I2C_I2C3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
174
#define STM32_I2C_I2C1_IRQ_PRIORITY         5
175
#define STM32_I2C_I2C2_IRQ_PRIORITY         5
176
#define STM32_I2C_I2C3_IRQ_PRIORITY         5
177
#define STM32_I2C_I2C1_DMA_PRIORITY         3
178
#define STM32_I2C_I2C2_DMA_PRIORITY         3
179
#define STM32_I2C_I2C3_DMA_PRIORITY         3
180
#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
181
#define STM32_I2C_USE_DMA                   TRUE
182

    
183
/*
184
 * I2S driver system settings.
185
 */
186
#define STM32_I2S_USE_SPI2                  FALSE
187
#define STM32_I2S_USE_SPI3                  FALSE
188
#define STM32_I2S_SPI2_IRQ_PRIORITY         10
189
#define STM32_I2S_SPI3_IRQ_PRIORITY         10
190
#define STM32_I2S_SPI2_DMA_PRIORITY         1
191
#define STM32_I2S_SPI3_DMA_PRIORITY         1
192
#define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
193
#define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
194
#define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
195
#define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
196
#define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
197

    
198
/*
199
 * ICU driver system settings.
200
 */
201
#define STM32_ICU_USE_TIM1                  FALSE
202
#define STM32_ICU_USE_TIM2                  FALSE
203
#define STM32_ICU_USE_TIM3                  FALSE
204
#define STM32_ICU_USE_TIM4                  FALSE
205
#define STM32_ICU_USE_TIM5                  FALSE
206
#define STM32_ICU_USE_TIM8                  FALSE
207
#define STM32_ICU_USE_TIM9                  FALSE
208
#define STM32_ICU_TIM1_IRQ_PRIORITY         7
209
#define STM32_ICU_TIM2_IRQ_PRIORITY         7
210
#define STM32_ICU_TIM3_IRQ_PRIORITY         7
211
#define STM32_ICU_TIM4_IRQ_PRIORITY         7
212
#define STM32_ICU_TIM5_IRQ_PRIORITY         7
213
#define STM32_ICU_TIM8_IRQ_PRIORITY         7
214
#define STM32_ICU_TIM9_IRQ_PRIORITY         7
215

    
216
/*
217
 * MAC driver system settings.
218
 */
219
#define STM32_MAC_TRANSMIT_BUFFERS          2
220
#define STM32_MAC_RECEIVE_BUFFERS           4
221
#define STM32_MAC_BUFFERS_SIZE              1522
222
#define STM32_MAC_PHY_TIMEOUT               100
223
#define STM32_MAC_ETH1_CHANGE_PHY_STATE     TRUE
224
#define STM32_MAC_ETH1_IRQ_PRIORITY         13
225
#define STM32_MAC_IP_CHECKSUM_OFFLOAD       0
226

    
227
/*
228
 * PWM driver system settings.
229
 */
230
#define STM32_PWM_USE_ADVANCED              FALSE
231
#define STM32_PWM_USE_TIM1                  FALSE
232
#define STM32_PWM_USE_TIM2                  FALSE
233
#define STM32_PWM_USE_TIM3                  TRUE
234
#define STM32_PWM_USE_TIM4                  FALSE
235
#define STM32_PWM_USE_TIM5                  FALSE
236
#define STM32_PWM_USE_TIM8                  FALSE
237
#define STM32_PWM_USE_TIM9                  FALSE
238
#define STM32_PWM_TIM1_IRQ_PRIORITY         7
239
#define STM32_PWM_TIM2_IRQ_PRIORITY         7
240
#define STM32_PWM_TIM3_IRQ_PRIORITY         7
241
#define STM32_PWM_TIM4_IRQ_PRIORITY         7
242
#define STM32_PWM_TIM5_IRQ_PRIORITY         7
243
#define STM32_PWM_TIM8_IRQ_PRIORITY         7
244
#define STM32_PWM_TIM9_IRQ_PRIORITY         7
245

    
246
/*
247
 * SDC driver system settings.
248
 */
249
#define STM32_SDC_SDIO_DMA_PRIORITY         3
250
#define STM32_SDC_SDIO_IRQ_PRIORITY         9
251
#define STM32_SDC_WRITE_TIMEOUT_MS          250
252
#define STM32_SDC_READ_TIMEOUT_MS           25
253
#define STM32_SDC_CLOCK_ACTIVATION_DELAY    10
254
#define STM32_SDC_SDIO_UNALIGNED_SUPPORT    TRUE
255
#define STM32_SDC_SDIO_DMA_STREAM           STM32_DMA_STREAM_ID(2, 3)
256

    
257
/*
258
 * SERIAL driver system settings.
259
 */
260
#define STM32_SERIAL_USE_USART1             TRUE
261
#define STM32_SERIAL_USE_USART2             FALSE
262
#define STM32_SERIAL_USE_USART3             FALSE
263
#define STM32_SERIAL_USE_UART4              FALSE
264
#define STM32_SERIAL_USE_UART5              FALSE
265
#define STM32_SERIAL_USE_USART6             FALSE
266
#define STM32_SERIAL_USART1_PRIORITY        12
267
#define STM32_SERIAL_USART2_PRIORITY        12
268
#define STM32_SERIAL_USART3_PRIORITY        12
269
#define STM32_SERIAL_UART4_PRIORITY         12
270
#define STM32_SERIAL_UART5_PRIORITY         12
271
#define STM32_SERIAL_USART6_PRIORITY        12
272

    
273
/*
274
 * SPI driver system settings.
275
 */
276
#define STM32_SPI_USE_SPI1                  TRUE
277
#define STM32_SPI_USE_SPI2                  FALSE
278
#define STM32_SPI_USE_SPI3                  FALSE
279
#define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 0)
280
#define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 3)
281
#define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
282
#define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
283
#define STM32_SPI_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
284
#define STM32_SPI_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
285
#define STM32_SPI_SPI1_DMA_PRIORITY         1
286
#define STM32_SPI_SPI2_DMA_PRIORITY         1
287
#define STM32_SPI_SPI3_DMA_PRIORITY         1
288
#define STM32_SPI_SPI1_IRQ_PRIORITY         10
289
#define STM32_SPI_SPI2_IRQ_PRIORITY         10
290
#define STM32_SPI_SPI3_IRQ_PRIORITY         10
291
#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
292

    
293
/*
294
 * ST driver system settings.
295
 */
296
#define STM32_ST_IRQ_PRIORITY               8
297
#define STM32_ST_USE_TIMER                  2
298

    
299
/*
300
 * UART driver system settings.
301
 */
302
#define STM32_UART_USE_USART1               FALSE
303
#define STM32_UART_USE_USART2               TRUE
304
#define STM32_UART_USE_USART3               TRUE
305
#define STM32_UART_USE_UART4                FALSE
306
#define STM32_UART_USE_UART5                FALSE
307
#define STM32_UART_USE_USART6               FALSE
308
#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 5)
309
#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
310
#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
311
#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 6)
312
#define STM32_UART_USART3_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 1)
313
#define STM32_UART_USART3_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
314
#define STM32_UART_UART4_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 2)
315
#define STM32_UART_UART4_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 4)
316
#define STM32_UART_UART5_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 0)
317
#define STM32_UART_UART5_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 7)
318
#define STM32_UART_USART6_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 2)
319
#define STM32_UART_USART6_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
320
#define STM32_UART_USART1_IRQ_PRIORITY      12
321
#define STM32_UART_USART2_IRQ_PRIORITY      12
322
#define STM32_UART_USART3_IRQ_PRIORITY      12
323
#define STM32_UART_UART4_IRQ_PRIORITY       12
324
#define STM32_UART_UART5_IRQ_PRIORITY       12
325
#define STM32_UART_USART6_IRQ_PRIORITY      12
326
#define STM32_UART_USART1_DMA_PRIORITY      0
327
#define STM32_UART_USART2_DMA_PRIORITY      0
328
#define STM32_UART_USART3_DMA_PRIORITY      0
329
#define STM32_UART_UART4_DMA_PRIORITY       0
330
#define STM32_UART_UART5_DMA_PRIORITY       0
331
#define STM32_UART_USART6_DMA_PRIORITY      0
332
#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
333

    
334
/*
335
 * USB driver system settings.
336
 */
337
#define STM32_USB_USE_OTG1                  FALSE
338
#define STM32_USB_USE_OTG2                  FALSE
339
#define STM32_USB_OTG1_IRQ_PRIORITY         14
340
#define STM32_USB_OTG2_IRQ_PRIORITY         14
341
#define STM32_USB_OTG1_RX_FIFO_SIZE         512
342
#define STM32_USB_OTG2_RX_FIFO_SIZE         1024
343
#define STM32_USB_OTG_THREAD_PRIO           LOWPRIO
344
#define STM32_USB_OTG_THREAD_STACK_SIZE     128
345
#define STM32_USB_OTGFIFO_FILL_BASEPRI      0
346

    
347
/*
348
 * WDG driver system settings.
349
 */
350
#define STM32_WDG_USE_IWDG                  FALSE
351

    
352
/*
353
 * QEI driver system settings.
354
 */
355
#define STM32_QEI_USE_TIM1                  FALSE
356
#define STM32_QEI_USE_TIM2                  FALSE
357
#define STM32_QEI_USE_TIM3                  FALSE
358
#define STM32_QEI_USE_TIM4                  FALSE
359
#define STM32_QEI_USE_TIM5                  FALSE
360
#define STM32_QEI_USE_TIM8                  FALSE
361

    
362
#endif /* _MCUCONF_H_ */