Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / PowerManagement / mcuconf.h @ 58fe0e0b

History | View | Annotate | Download (11.302 KB)

1
/*
2
 * STM32F4xx drivers configuration.
3
 * The following settings override the default settings present in
4
 * the various device driver implementation headers.
5
 * Note that the settings for each driver only have effect if the whole
6
 * driver is enabled in halconf.h.
7
 *
8
 * IRQ priorities:
9
 * 15...0       Lowest...Highest.
10
 *
11
 * DMA priorities:
12
 * 0...3        Lowest...Highest.
13
 */
14

    
15
#define STM32F4xx_MCUCONF
16

    
17
/*
18
 * HAL driver system settings.
19
 */
20
#define STM32_NO_INIT                       FALSE
21
#define STM32_HSI_ENABLED                   TRUE
22
#define STM32_LSI_ENABLED                   TRUE
23
#define STM32_HSE_ENABLED                   TRUE
24
#define STM32_LSE_ENABLED                   FALSE
25
#define STM32_CLOCK48_REQUIRED              TRUE
26
#define STM32_SW                            STM32_SW_PLL
27
#define STM32_PLLSRC                        STM32_PLLSRC_HSE
28
#define STM32_PLLM_VALUE                    8
29
#define STM32_PLLN_VALUE                    336
30
#define STM32_PLLP_VALUE                    2
31
#define STM32_PLLQ_VALUE                    7
32
#define STM32_HPRE                          STM32_HPRE_DIV1
33
#define STM32_PPRE1                         STM32_PPRE1_DIV4
34
#define STM32_PPRE2                         STM32_PPRE2_DIV2
35
#define STM32_RTCSEL                        STM32_RTCSEL_LSI
36
#define STM32_RTCPRE_VALUE                  8
37
#define STM32_MCO1SEL                       STM32_MCO1SEL_HSI
38
#define STM32_MCO1PRE                       STM32_MCO1PRE_DIV1
39
#define STM32_MCO2SEL                       STM32_MCO2SEL_SYSCLK
40
#define STM32_MCO2PRE                       STM32_MCO2PRE_DIV5
41
#define STM32_I2SSRC                        STM32_I2SSRC_CKIN
42
#define STM32_PLLI2SN_VALUE                 192
43
#define STM32_PLLI2SR_VALUE                 5
44
#define STM32_PVD_ENABLE                    FALSE
45
#define STM32_PLS                           STM32_PLS_LEV0
46
#define STM32_BKPRAM_ENABLE                 FALSE
47

    
48
/*
49
 * ADC driver system settings.
50
 */
51
#define STM32_ADC_ADCPRE                    ADC_CCR_ADCPRE_DIV4
52
#define STM32_ADC_USE_ADC1                  TRUE
53
#define STM32_ADC_USE_ADC2                  FALSE
54
#define STM32_ADC_USE_ADC3                  FALSE
55
#define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(2, 4)
56
#define STM32_ADC_ADC2_DMA_STREAM           STM32_DMA_STREAM_ID(2, 2)
57
#define STM32_ADC_ADC3_DMA_STREAM           STM32_DMA_STREAM_ID(2, 1)
58
#define STM32_ADC_ADC1_DMA_PRIORITY         2
59
#define STM32_ADC_ADC2_DMA_PRIORITY         2
60
#define STM32_ADC_ADC3_DMA_PRIORITY         2
61
#define STM32_ADC_IRQ_PRIORITY              6
62
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     6
63
#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY     6
64
#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY     6
65

    
66
/*
67
 * CAN driver system settings.
68
 */
69
#define STM32_CAN_USE_CAN1                  TRUE
70
#define STM32_CAN_USE_CAN2                  FALSE
71
#define STM32_CAN_CAN1_IRQ_PRIORITY         11
72
#define STM32_CAN_CAN2_IRQ_PRIORITY         11
73

    
74
/*
75
 * EXT driver system settings.
76
 */
77
#define STM32_EXT_EXTI0_IRQ_PRIORITY        6
78
#define STM32_EXT_EXTI1_IRQ_PRIORITY        6
79
#define STM32_EXT_EXTI2_IRQ_PRIORITY        6
80
#define STM32_EXT_EXTI3_IRQ_PRIORITY        6
81
#define STM32_EXT_EXTI4_IRQ_PRIORITY        6
82
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
83
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
84
#define STM32_EXT_EXTI16_IRQ_PRIORITY       6
85
#define STM32_EXT_EXTI17_IRQ_PRIORITY       15
86
#define STM32_EXT_EXTI18_IRQ_PRIORITY       6
87
#define STM32_EXT_EXTI19_IRQ_PRIORITY       6
88
#define STM32_EXT_EXTI20_IRQ_PRIORITY       6
89
#define STM32_EXT_EXTI21_IRQ_PRIORITY       15
90
#define STM32_EXT_EXTI22_IRQ_PRIORITY       15
91

    
92
/*
93
 * GPT driver system settings.
94
 */
95
#define STM32_GPT_USE_TIM1                  FALSE
96
#define STM32_GPT_USE_TIM2                  FALSE
97
#define STM32_GPT_USE_TIM3                  FALSE
98
#define STM32_GPT_USE_TIM4                  FALSE
99
#define STM32_GPT_USE_TIM5                  FALSE
100
#define STM32_GPT_USE_TIM6                  FALSE
101
#define STM32_GPT_USE_TIM7                  FALSE
102
#define STM32_GPT_USE_TIM8                  FALSE
103
#define STM32_GPT_USE_TIM9                  FALSE
104
#define STM32_GPT_USE_TIM11                 FALSE
105
#define STM32_GPT_USE_TIM12                 FALSE
106
#define STM32_GPT_USE_TIM14                 FALSE
107
#define STM32_GPT_TIM1_IRQ_PRIORITY         7
108
#define STM32_GPT_TIM2_IRQ_PRIORITY         7
109
#define STM32_GPT_TIM3_IRQ_PRIORITY         7
110
#define STM32_GPT_TIM4_IRQ_PRIORITY         7
111
#define STM32_GPT_TIM5_IRQ_PRIORITY         7
112
#define STM32_GPT_TIM6_IRQ_PRIORITY         7
113
#define STM32_GPT_TIM7_IRQ_PRIORITY         7
114
#define STM32_GPT_TIM8_IRQ_PRIORITY         7
115
#define STM32_GPT_TIM9_IRQ_PRIORITY         7
116
#define STM32_GPT_TIM11_IRQ_PRIORITY        7
117
#define STM32_GPT_TIM12_IRQ_PRIORITY        7
118
#define STM32_GPT_TIM14_IRQ_PRIORITY        7
119

    
120
/*
121
 * I2C driver system settings.
122
 */
123
#define STM32_I2C_USE_I2C1                  TRUE
124
#define STM32_I2C_USE_I2C2                  TRUE
125
#define STM32_I2C_USE_I2C3                  FALSE
126
#define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
127
#define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 6)
128
#define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
129
#define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
130
#define STM32_I2C_I2C3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
131
#define STM32_I2C_I2C3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
132
#define STM32_I2C_I2C1_IRQ_PRIORITY         5
133
#define STM32_I2C_I2C2_IRQ_PRIORITY         5
134
#define STM32_I2C_I2C3_IRQ_PRIORITY         5
135
#define STM32_I2C_I2C1_DMA_PRIORITY         3
136
#define STM32_I2C_I2C2_DMA_PRIORITY         3
137
#define STM32_I2C_I2C3_DMA_PRIORITY         3
138
#define STM32_I2C_I2C1_DMA_ERROR_HOOK()     chSysHalt()
139
#define STM32_I2C_I2C2_DMA_ERROR_HOOK()     chSysHalt()
140
#define STM32_I2C_I2C3_DMA_ERROR_HOOK()     chSysHalt()
141
#define STM32_I2C_USE_DMA                   TRUE
142

    
143
/*
144
 * ICU driver system settings.
145
 */
146
#define STM32_ICU_USE_TIM1                  FALSE
147
#define STM32_ICU_USE_TIM2                  FALSE
148
#define STM32_ICU_USE_TIM3                  FALSE
149
#define STM32_ICU_USE_TIM4                  FALSE
150
#define STM32_ICU_USE_TIM5                  FALSE
151
#define STM32_ICU_USE_TIM8                  FALSE
152
#define STM32_ICU_USE_TIM9                  FALSE
153
#define STM32_ICU_TIM1_IRQ_PRIORITY         7
154
#define STM32_ICU_TIM2_IRQ_PRIORITY         7
155
#define STM32_ICU_TIM3_IRQ_PRIORITY         7
156
#define STM32_ICU_TIM4_IRQ_PRIORITY         7
157
#define STM32_ICU_TIM5_IRQ_PRIORITY         7
158
#define STM32_ICU_TIM8_IRQ_PRIORITY         7
159
#define STM32_ICU_TIM9_IRQ_PRIORITY         7
160

    
161
/*
162
 * MAC driver system settings.
163
 */
164
#define STM32_MAC_TRANSMIT_BUFFERS          2
165
#define STM32_MAC_RECEIVE_BUFFERS           4
166
#define STM32_MAC_BUFFERS_SIZE              1522
167
#define STM32_MAC_PHY_TIMEOUT               100
168
#define STM32_MAC_ETH1_CHANGE_PHY_STATE     TRUE
169
#define STM32_MAC_ETH1_IRQ_PRIORITY         13
170
#define STM32_MAC_IP_CHECKSUM_OFFLOAD       0
171

    
172
/*
173
 * PWM driver system settings.
174
 */
175
#define STM32_PWM_USE_ADVANCED              FALSE
176
#define STM32_PWM_USE_TIM1                  FALSE
177
#define STM32_PWM_USE_TIM2                  FALSE
178
#define STM32_PWM_USE_TIM3                  TRUE
179
#define STM32_PWM_USE_TIM4                  FALSE
180
#define STM32_PWM_USE_TIM5                  FALSE
181
#define STM32_PWM_USE_TIM8                  FALSE
182
#define STM32_PWM_USE_TIM9                  FALSE
183
#define STM32_PWM_TIM1_IRQ_PRIORITY         7
184
#define STM32_PWM_TIM2_IRQ_PRIORITY         7
185
#define STM32_PWM_TIM3_IRQ_PRIORITY         7
186
#define STM32_PWM_TIM4_IRQ_PRIORITY         7
187
#define STM32_PWM_TIM5_IRQ_PRIORITY         7
188
#define STM32_PWM_TIM8_IRQ_PRIORITY         7
189
#define STM32_PWM_TIM9_IRQ_PRIORITY         7
190

    
191
/*
192
 * SERIAL driver system settings.
193
 */
194
#define STM32_SERIAL_USE_USART1             TRUE
195
#define STM32_SERIAL_USE_USART2             FALSE
196
#define STM32_SERIAL_USE_USART3             FALSE
197
#define STM32_SERIAL_USE_UART4              FALSE
198
#define STM32_SERIAL_USE_UART5              FALSE
199
#define STM32_SERIAL_USE_USART6             FALSE
200
#define STM32_SERIAL_USART1_PRIORITY        12
201
#define STM32_SERIAL_USART2_PRIORITY        12
202
#define STM32_SERIAL_USART3_PRIORITY        12
203
#define STM32_SERIAL_UART4_PRIORITY         12
204
#define STM32_SERIAL_UART5_PRIORITY         12
205
#define STM32_SERIAL_USART6_PRIORITY        12
206

    
207
/*
208
 * SPI driver system settings.
209
 */
210
#define STM32_SPI_USE_SPI1                  TRUE
211
#define STM32_SPI_USE_SPI2                  FALSE
212
#define STM32_SPI_USE_SPI3                  FALSE
213
#define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 0)
214
#define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 3)
215
#define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
216
#define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
217
#define STM32_SPI_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
218
#define STM32_SPI_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
219
#define STM32_SPI_SPI1_DMA_PRIORITY         1
220
#define STM32_SPI_SPI2_DMA_PRIORITY         1
221
#define STM32_SPI_SPI3_DMA_PRIORITY         1
222
#define STM32_SPI_SPI1_IRQ_PRIORITY         10
223
#define STM32_SPI_SPI2_IRQ_PRIORITY         10
224
#define STM32_SPI_SPI3_IRQ_PRIORITY         10
225
#define STM32_SPI_DMA_ERROR_HOOK(spip)      chSysHalt()
226

    
227
/*
228
 * UART driver system settings.
229
 */
230
#define STM32_UART_USE_USART1               FALSE
231
#define STM32_UART_USE_USART2               TRUE
232
#define STM32_UART_USE_USART3               TRUE
233
#define STM32_UART_USE_UART4                FALSE
234
#define STM32_UART_USE_UART5                FALSE
235
#define STM32_UART_USE_USART6               FALSE
236
#define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 5)
237
#define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
238
#define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
239
#define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 6)
240
#define STM32_UART_USART3_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 1)
241
#define STM32_UART_USART3_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
242
#define STM32_UART_UART4_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 2)
243
#define STM32_UART_UART4_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 4)
244
#define STM32_UART_UART5_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 0)
245
#define STM32_UART_UART5_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 7)
246
#define STM32_UART_USART6_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 2)
247
#define STM32_UART_USART6_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
248
#define STM32_UART_USART1_IRQ_PRIORITY      12
249
#define STM32_UART_USART2_IRQ_PRIORITY      12
250
#define STM32_UART_USART3_IRQ_PRIORITY      12
251
#define STM32_UART_UART4_IRQ_PRIORITY       12
252
#define STM32_UART_UART5_IRQ_PRIORITY       12
253
#define STM32_UART_USART6_IRQ_PRIORITY      12
254
#define STM32_UART_USART1_DMA_PRIORITY      0
255
#define STM32_UART_USART2_DMA_PRIORITY      0
256
#define STM32_UART_USART3_DMA_PRIORITY      0
257
#define STM32_UART_UART4_DMA_PRIORITY       0
258
#define STM32_UART_UART5_DMA_PRIORITY       0
259
#define STM32_UART_USART6_DMA_PRIORITY      0
260
#define STM32_UART_DMA_ERROR_HOOK(uartp)    chSysHalt()
261

    
262
/*
263
 * USB driver system settings.
264
 */
265
#define STM32_USB_USE_OTG1                  FALSE
266
#define STM32_USB_USE_OTG2                  FALSE
267
#define STM32_USB_OTG1_IRQ_PRIORITY         14
268
#define STM32_USB_OTG2_IRQ_PRIORITY         14
269
#define STM32_USB_OTG1_RX_FIFO_SIZE         512
270
#define STM32_USB_OTG2_RX_FIFO_SIZE         1024
271
#define STM32_USB_OTG_THREAD_PRIO           LOWPRIO
272
#define STM32_USB_OTG_THREAD_STACK_SIZE     128
273
#define STM32_USB_OTGFIFO_FILL_BASEPRI      0