Statistics
| Branch: | Tag: | Revision:

amiro-os / modules / NUCLEO-F103RB / mcuconf.h @ 0f60c8ad

History | View | Annotate | Download (8.041 KB)

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

5 0f60c8ad Thomas Schöpping
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 f4da707a Thomas Schöpping

10 0f60c8ad Thomas Schöpping
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 f4da707a Thomas Schöpping

15 0f60c8ad Thomas Schöpping
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 f4da707a Thomas Schöpping
*/
18
19
#ifndef MCUCONF_H
20
#define MCUCONF_H
21
22
#define STM32F103_MCUCONF
23
24
/*
25
 * STM32F103 drivers configuration.
26
 * The following settings override the default settings present in
27
 * the various device driver implementation headers.
28
 * Note that the settings for each driver only have effect if the whole
29
 * driver is enabled in halconf.h.
30
 *
31
 * IRQ priorities:
32
 * 15...0       Lowest...Highest.
33
 *
34
 * DMA priorities:
35
 * 0...3        Lowest...Highest.
36
 */
37
38
/*
39
 * HAL driver system settings.
40
 */
41
#define STM32_NO_INIT                       FALSE
42
#define STM32_HSI_ENABLED                   TRUE
43
#define STM32_LSI_ENABLED                   TRUE
44
#define STM32_HSE_ENABLED                   FALSE
45
#define STM32_LSE_ENABLED                   FALSE
46
#define STM32_SW                            STM32_SW_PLL
47
#define STM32_PLLSRC                        STM32_PLLSRC_HSI
48
#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1
49
#define STM32_PLLMUL_VALUE                  12
50
#define STM32_HPRE                          STM32_HPRE_DIV1
51
#define STM32_PPRE1                         STM32_PPRE1_DIV2
52
#define STM32_PPRE2                         STM32_PPRE2_DIV2
53
#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
54
#define STM32_USB_CLOCK_REQUIRED            TRUE
55
#define STM32_USBPRE                        STM32_USBPRE_DIV1
56
#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
57
#define STM32_RTCSEL                        STM32_RTCSEL_LSI
58
#define STM32_PVD_ENABLE                    FALSE
59
#define STM32_PLS                           STM32_PLS_LEV0
60
61
/*
62
 * IRQ system settings.
63
 */
64
#define STM32_IRQ_EXTI0_PRIORITY            6
65
#define STM32_IRQ_EXTI1_PRIORITY            6
66
#define STM32_IRQ_EXTI2_PRIORITY            6
67
#define STM32_IRQ_EXTI3_PRIORITY            6
68
#define STM32_IRQ_EXTI4_PRIORITY            6
69
#define STM32_IRQ_EXTI5_9_PRIORITY          6
70
#define STM32_IRQ_EXTI10_15_PRIORITY        6
71
#define STM32_IRQ_EXTI16_PRIORITY           6
72
#define STM32_IRQ_EXTI17_PRIORITY           6
73
#define STM32_IRQ_EXTI18_PRIORITY           6
74
#define STM32_IRQ_EXTI19_PRIORITY           6
75
76
/*
77
 * ADC driver system settings.
78
 */
79
#define STM32_ADC_USE_ADC1                  FALSE
80
#define STM32_ADC_ADC1_DMA_PRIORITY         2
81
#define STM32_ADC_ADC1_IRQ_PRIORITY         6
82
83
/*
84
 * CAN driver system settings.
85
 */
86
#define STM32_CAN_USE_CAN1                  FALSE
87
#define STM32_CAN_CAN1_IRQ_PRIORITY         11
88
89
/*
90
 * GPT driver system settings.
91
 */
92
#define STM32_GPT_USE_TIM1                  FALSE
93
#define STM32_GPT_USE_TIM2                  FALSE
94
#define STM32_GPT_USE_TIM3                  FALSE
95
#define STM32_GPT_USE_TIM4                  FALSE
96
#define STM32_GPT_USE_TIM5                  FALSE
97
#define STM32_GPT_USE_TIM8                  FALSE
98
#define STM32_GPT_TIM1_IRQ_PRIORITY         7
99
#define STM32_GPT_TIM2_IRQ_PRIORITY         7
100
#define STM32_GPT_TIM3_IRQ_PRIORITY         7
101
#define STM32_GPT_TIM4_IRQ_PRIORITY         7
102
#define STM32_GPT_TIM5_IRQ_PRIORITY         7
103
#define STM32_GPT_TIM8_IRQ_PRIORITY         7
104
105
/*
106
 * I2C driver system settings.
107
 */
108
#define STM32_I2C_USE_I2C1                  FALSE
109
#define STM32_I2C_USE_I2C2                  FALSE
110
#define STM32_I2C_BUSY_TIMEOUT              50
111
#define STM32_I2C_I2C1_IRQ_PRIORITY         5
112
#define STM32_I2C_I2C2_IRQ_PRIORITY         5
113
#define STM32_I2C_I2C1_DMA_PRIORITY         3
114
#define STM32_I2C_I2C2_DMA_PRIORITY         3
115
#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
116
117
/*
118
 * ICU driver system settings.
119
 */
120
#define STM32_ICU_USE_TIM1                  FALSE
121
#define STM32_ICU_USE_TIM2                  FALSE
122
#define STM32_ICU_USE_TIM3                  FALSE
123
#define STM32_ICU_USE_TIM4                  FALSE
124
#define STM32_ICU_USE_TIM5                  FALSE
125
#define STM32_ICU_USE_TIM8                  FALSE
126
#define STM32_ICU_TIM1_IRQ_PRIORITY         7
127
#define STM32_ICU_TIM2_IRQ_PRIORITY         7
128
#define STM32_ICU_TIM3_IRQ_PRIORITY         7
129
#define STM32_ICU_TIM4_IRQ_PRIORITY         7
130
#define STM32_ICU_TIM5_IRQ_PRIORITY         7
131
#define STM32_ICU_TIM8_IRQ_PRIORITY         7
132
133
/*
134
 * PWM driver system settings.
135
 */
136
#define STM32_PWM_USE_ADVANCED              FALSE
137
#define STM32_PWM_USE_TIM1                  FALSE
138
#define STM32_PWM_USE_TIM2                  FALSE
139
#define STM32_PWM_USE_TIM3                  FALSE
140
#define STM32_PWM_USE_TIM4                  FALSE
141
#define STM32_PWM_USE_TIM5                  FALSE
142
#define STM32_PWM_USE_TIM8                  FALSE
143
#define STM32_PWM_TIM1_IRQ_PRIORITY         7
144
#define STM32_PWM_TIM2_IRQ_PRIORITY         7
145
#define STM32_PWM_TIM3_IRQ_PRIORITY         7
146
#define STM32_PWM_TIM4_IRQ_PRIORITY         7
147
#define STM32_PWM_TIM5_IRQ_PRIORITY         7
148
#define STM32_PWM_TIM8_IRQ_PRIORITY         7
149
150
/*
151
 * RTC driver system settings.
152
 */
153
#define STM32_RTC_IRQ_PRIORITY              15
154
155
/*
156
 * SERIAL driver system settings.
157
 */
158
#define STM32_SERIAL_USE_USART1             FALSE
159
#define STM32_SERIAL_USE_USART2             TRUE
160
#define STM32_SERIAL_USE_USART3             FALSE
161
#define STM32_SERIAL_USE_UART4              FALSE
162
#define STM32_SERIAL_USE_UART5              FALSE
163
#define STM32_SERIAL_USART1_PRIORITY        12
164
#define STM32_SERIAL_USART2_PRIORITY        12
165
#define STM32_SERIAL_USART3_PRIORITY        12
166
#define STM32_SERIAL_UART4_PRIORITY         12
167
#define STM32_SERIAL_UART5_PRIORITY         12
168
169
/*
170
 * SPI driver system settings.
171
 */
172
#define STM32_SPI_USE_SPI1                  FALSE
173 deaaa47e Cung Sang
#define STM32_SPI_USE_SPI2                  TRUE
174 f4da707a Thomas Schöpping
#define STM32_SPI_USE_SPI3                  FALSE
175
#define STM32_SPI_SPI1_DMA_PRIORITY         1
176
#define STM32_SPI_SPI2_DMA_PRIORITY         1
177
#define STM32_SPI_SPI3_DMA_PRIORITY         1
178
#define STM32_SPI_SPI1_IRQ_PRIORITY         10
179
#define STM32_SPI_SPI2_IRQ_PRIORITY         10
180
#define STM32_SPI_SPI3_IRQ_PRIORITY         10
181
#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
182
183
/*
184
 * ST driver system settings.
185
 */
186
#define STM32_ST_IRQ_PRIORITY               8
187
#define STM32_ST_USE_TIMER                  2
188
189
/*
190
 * UART driver system settings.
191
 */
192
#define STM32_UART_USE_USART1               FALSE
193
#define STM32_UART_USE_USART2               FALSE
194
#define STM32_UART_USE_USART3               FALSE
195
#define STM32_UART_USART1_IRQ_PRIORITY      12
196
#define STM32_UART_USART2_IRQ_PRIORITY      12
197
#define STM32_UART_USART3_IRQ_PRIORITY      12
198
#define STM32_UART_USART1_DMA_PRIORITY      0
199
#define STM32_UART_USART2_DMA_PRIORITY      0
200
#define STM32_UART_USART3_DMA_PRIORITY      0
201
#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
202
203
/*
204
 * USB driver system settings.
205
 */
206
#define STM32_USB_USE_USB1                  FALSE
207
#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
208
#define STM32_USB_USB1_HP_IRQ_PRIORITY      13
209
#define STM32_USB_USB1_LP_IRQ_PRIORITY      14
210
211
/*
212
 * WDG driver system settings.
213
 */
214
#define STM32_WDG_USE_IWDG                  FALSE
215
216 7da800ab Thomas Schöpping
/*
217
 * QEI driver system settings.
218
 */
219
#define STM32_QEI_USE_TIM1                  FALSE
220
#define STM32_QEI_USE_TIM2                  FALSE
221
#define STM32_QEI_USE_TIM3                  FALSE
222
#define STM32_QEI_USE_TIM4                  FALSE
223
#define STM32_QEI_USE_TIM5                  FALSE
224
#define STM32_QEI_USE_TIM8                  FALSE
225
226 f4da707a Thomas Schöpping
#endif /* MCUCONF_H */