MAV'RIC
/home/travis/build/lis-epfl/MAVRIC_Library/boards/sparky_chibi/mcuconf.h
00001 /*
00002     ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
00003 
00004     Licensed under the Apache License, Version 2.0 (the "License");
00005     you may not use this file except in compliance with the License.
00006     You may obtain a copy of the License at
00007 
00008         http://www.apache.org/licenses/LICENSE-2.0
00009 
00010     Unless required by applicable law or agreed to in writing, software
00011     distributed under the License is distributed on an "AS IS" BASIS,
00012     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013     See the License for the specific language governing permissions and
00014     limitations under the License.
00015 */
00016 
00017 #ifndef MCUCONF_H
00018 #define MCUCONF_H
00019 
00020 /*
00021  * STM32F4xx drivers configuration.
00022  * The following settings override the default settings present in
00023  * the various device driver implementation headers.
00024  * Note that the settings for each driver only have effect if the whole
00025  * driver is enabled in halconf.h.
00026  *
00027  * IRQ priorities:
00028  * 15...0       Lowest...Highest.
00029  *
00030  * DMA priorities:
00031  * 0...3        Lowest...Highest.
00032  */
00033 
00034 #define STM32F4xx_MCUCONF
00035 
00036 /*
00037  * HAL driver system settings.
00038  */
00039 #define STM32_NO_INIT                       FALSE
00040 #define STM32_HSI_ENABLED                   TRUE
00041 #define STM32_LSI_ENABLED                   TRUE
00042 #define STM32_HSE_ENABLED                   TRUE
00043 #define STM32_LSE_ENABLED                   FALSE
00044 #define STM32_CLOCK48_REQUIRED              TRUE
00045 #define STM32_SW                            STM32_SW_PLL
00046 #define STM32_PLLSRC                        STM32_PLLSRC_HSE
00047 #define STM32_PLLM_VALUE                    8
00048 #define STM32_PLLN_VALUE                    336
00049 #define STM32_PLLP_VALUE                    2
00050 #define STM32_PLLQ_VALUE                    7
00051 #define STM32_HPRE                          STM32_HPRE_DIV1
00052 #define STM32_PPRE1                         STM32_PPRE1_DIV4
00053 #define STM32_PPRE2                         STM32_PPRE2_DIV2
00054 #define STM32_RTCSEL                        STM32_RTCSEL_LSI
00055 #define STM32_RTCPRE_VALUE                  8
00056 #define STM32_MCO1SEL                       STM32_MCO1SEL_HSI
00057 #define STM32_MCO1PRE                       STM32_MCO1PRE_DIV1
00058 #define STM32_MCO2SEL                       STM32_MCO2SEL_SYSCLK
00059 #define STM32_MCO2PRE                       STM32_MCO2PRE_DIV5
00060 #define STM32_I2SSRC                        STM32_I2SSRC_CKIN
00061 #define STM32_PLLI2SN_VALUE                 192
00062 #define STM32_PLLI2SR_VALUE                 5
00063 #define STM32_PVD_ENABLE                    FALSE
00064 #define STM32_PLS                           STM32_PLS_LEV0
00065 #define STM32_BKPRAM_ENABLE                 FALSE
00066 
00067 /*
00068  * ADC driver system settings.
00069  */
00070 #define STM32_ADC_ADCPRE                    ADC_CCR_ADCPRE_DIV4
00071 #define STM32_ADC_USE_ADC1                  FALSE
00072 #define STM32_ADC_USE_ADC2                  FALSE
00073 #define STM32_ADC_USE_ADC3                  FALSE
00074 #define STM32_ADC_ADC1_DMA_STREAM           STM32_DMA_STREAM_ID(2, 4)
00075 #define STM32_ADC_ADC2_DMA_STREAM           STM32_DMA_STREAM_ID(2, 2)
00076 #define STM32_ADC_ADC3_DMA_STREAM           STM32_DMA_STREAM_ID(2, 1)
00077 #define STM32_ADC_ADC1_DMA_PRIORITY         2
00078 #define STM32_ADC_ADC2_DMA_PRIORITY         2
00079 #define STM32_ADC_ADC3_DMA_PRIORITY         2
00080 #define STM32_ADC_IRQ_PRIORITY              6
00081 #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     6
00082 #define STM32_ADC_ADC2_DMA_IRQ_PRIORITY     6
00083 #define STM32_ADC_ADC3_DMA_IRQ_PRIORITY     6
00084 
00085 /*
00086  * CAN driver system settings.
00087  */
00088 #define STM32_CAN_USE_CAN1                  FALSE
00089 #define STM32_CAN_USE_CAN2                  FALSE
00090 #define STM32_CAN_CAN1_IRQ_PRIORITY         11
00091 #define STM32_CAN_CAN2_IRQ_PRIORITY         11
00092 
00093 /*
00094  * DAC driver system settings.
00095  */
00096 #define STM32_DAC_DUAL_MODE                 FALSE
00097 #define STM32_DAC_USE_DAC1_CH1              FALSE
00098 #define STM32_DAC_USE_DAC1_CH2              FALSE
00099 #define STM32_DAC_DAC1_CH1_IRQ_PRIORITY     10
00100 #define STM32_DAC_DAC1_CH2_IRQ_PRIORITY     10
00101 #define STM32_DAC_DAC1_CH1_DMA_PRIORITY     2
00102 #define STM32_DAC_DAC1_CH2_DMA_PRIORITY     2
00103 #define STM32_DAC_DAC1_CH1_DMA_STREAM       STM32_DMA_STREAM_ID(1, 5)
00104 #define STM32_DAC_DAC1_CH2_DMA_STREAM       STM32_DMA_STREAM_ID(1, 6)
00105 
00106 /*
00107  * EXT driver system settings.
00108  */
00109 #define STM32_EXT_EXTI0_IRQ_PRIORITY        6
00110 #define STM32_EXT_EXTI1_IRQ_PRIORITY        6
00111 #define STM32_EXT_EXTI2_IRQ_PRIORITY        6
00112 #define STM32_EXT_EXTI3_IRQ_PRIORITY        6
00113 #define STM32_EXT_EXTI4_IRQ_PRIORITY        6
00114 #define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
00115 #define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
00116 #define STM32_EXT_EXTI16_IRQ_PRIORITY       6
00117 #define STM32_EXT_EXTI17_IRQ_PRIORITY       15
00118 #define STM32_EXT_EXTI18_IRQ_PRIORITY       6
00119 #define STM32_EXT_EXTI19_IRQ_PRIORITY       6
00120 #define STM32_EXT_EXTI20_IRQ_PRIORITY       6
00121 #define STM32_EXT_EXTI21_IRQ_PRIORITY       15
00122 #define STM32_EXT_EXTI22_IRQ_PRIORITY       15
00123 
00124 /*
00125  * GPT driver system settings.
00126  */
00127 #define STM32_GPT_USE_TIM1                  FALSE
00128 #define STM32_GPT_USE_TIM2                  FALSE
00129 #define STM32_GPT_USE_TIM3                  FALSE
00130 #define STM32_GPT_USE_TIM4                  FALSE
00131 #define STM32_GPT_USE_TIM5                  FALSE
00132 #define STM32_GPT_USE_TIM6                  FALSE
00133 #define STM32_GPT_USE_TIM7                  FALSE
00134 #define STM32_GPT_USE_TIM8                  FALSE
00135 #define STM32_GPT_USE_TIM9                  FALSE
00136 #define STM32_GPT_USE_TIM11                 FALSE
00137 #define STM32_GPT_USE_TIM12                 FALSE
00138 #define STM32_GPT_USE_TIM14                 FALSE
00139 #define STM32_GPT_TIM1_IRQ_PRIORITY         7
00140 #define STM32_GPT_TIM2_IRQ_PRIORITY         7
00141 #define STM32_GPT_TIM3_IRQ_PRIORITY         7
00142 #define STM32_GPT_TIM4_IRQ_PRIORITY         7
00143 #define STM32_GPT_TIM5_IRQ_PRIORITY         7
00144 #define STM32_GPT_TIM6_IRQ_PRIORITY         7
00145 #define STM32_GPT_TIM7_IRQ_PRIORITY         7
00146 #define STM32_GPT_TIM8_IRQ_PRIORITY         7
00147 #define STM32_GPT_TIM9_IRQ_PRIORITY         7
00148 #define STM32_GPT_TIM11_IRQ_PRIORITY        7
00149 #define STM32_GPT_TIM12_IRQ_PRIORITY        7
00150 #define STM32_GPT_TIM14_IRQ_PRIORITY        7
00151 
00152 /*
00153  * I2C driver system settings.
00154  */
00155 #define STM32_I2C_USE_I2C1                  TRUE
00156 #define STM32_I2C_USE_I2C2                  FALSE
00157 #define STM32_I2C_USE_I2C3                  FALSE
00158 #define STM32_I2C_BUSY_TIMEOUT              50
00159 #define STM32_I2C_I2C1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
00160 #define STM32_I2C_I2C1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 6)
00161 #define STM32_I2C_I2C2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
00162 #define STM32_I2C_I2C2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
00163 #define STM32_I2C_I2C3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 2)
00164 #define STM32_I2C_I2C3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
00165 #define STM32_I2C_I2C1_IRQ_PRIORITY         5
00166 #define STM32_I2C_I2C2_IRQ_PRIORITY         5
00167 #define STM32_I2C_I2C3_IRQ_PRIORITY         5
00168 #define STM32_I2C_I2C1_DMA_PRIORITY         3
00169 #define STM32_I2C_I2C2_DMA_PRIORITY         3
00170 #define STM32_I2C_I2C3_DMA_PRIORITY         3
00171 #define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
00172 
00173 /*
00174  * I2S driver system settings.
00175  */
00176 #define STM32_I2S_USE_SPI2                  FALSE
00177 #define STM32_I2S_USE_SPI3                  FALSE
00178 #define STM32_I2S_SPI2_IRQ_PRIORITY         10
00179 #define STM32_I2S_SPI3_IRQ_PRIORITY         10
00180 #define STM32_I2S_SPI2_DMA_PRIORITY         1
00181 #define STM32_I2S_SPI3_DMA_PRIORITY         1
00182 #define STM32_I2S_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
00183 #define STM32_I2S_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
00184 #define STM32_I2S_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
00185 #define STM32_I2S_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
00186 #define STM32_I2S_DMA_ERROR_HOOK(i2sp)      osalSysHalt("DMA failure")
00187 
00188 /*
00189  * ICU driver system settings.
00190  */
00191 #define STM32_ICU_USE_TIM1                  FALSE
00192 #define STM32_ICU_USE_TIM2                  FALSE
00193 #define STM32_ICU_USE_TIM3                  FALSE
00194 #define STM32_ICU_USE_TIM4                  FALSE
00195 #define STM32_ICU_USE_TIM5                  FALSE
00196 #define STM32_ICU_USE_TIM8                  FALSE
00197 #define STM32_ICU_USE_TIM9                  FALSE
00198 #define STM32_ICU_TIM1_IRQ_PRIORITY         7
00199 #define STM32_ICU_TIM2_IRQ_PRIORITY         7
00200 #define STM32_ICU_TIM3_IRQ_PRIORITY         7
00201 #define STM32_ICU_TIM4_IRQ_PRIORITY         7
00202 #define STM32_ICU_TIM5_IRQ_PRIORITY         7
00203 #define STM32_ICU_TIM8_IRQ_PRIORITY         7
00204 #define STM32_ICU_TIM9_IRQ_PRIORITY         7
00205 
00206 /*
00207  * MAC driver system settings.
00208  */
00209 #define STM32_MAC_TRANSMIT_BUFFERS          2
00210 #define STM32_MAC_RECEIVE_BUFFERS           4
00211 #define STM32_MAC_BUFFERS_SIZE              1522
00212 #define STM32_MAC_PHY_TIMEOUT               100
00213 #define STM32_MAC_ETH1_CHANGE_PHY_STATE     TRUE
00214 #define STM32_MAC_ETH1_IRQ_PRIORITY         13
00215 #define STM32_MAC_IP_CHECKSUM_OFFLOAD       0
00216 
00217 /*
00218  * PWM driver system settings.
00219  */
00220 #define STM32_PWM_USE_ADVANCED              FALSE
00221 #define STM32_PWM_USE_TIM1                  TRUE
00222 #define STM32_PWM_USE_TIM2                  FALSE
00223 #define STM32_PWM_USE_TIM3                  TRUE
00224 #define STM32_PWM_USE_TIM4                  TRUE
00225 #define STM32_PWM_USE_TIM5                  TRUE
00226 #define STM32_PWM_USE_TIM8                  TRUE
00227 #define STM32_PWM_USE_TIM9                  TRUE
00228 #define STM32_PWM_TIM1_IRQ_PRIORITY         7
00229 #define STM32_PWM_TIM2_IRQ_PRIORITY         7
00230 #define STM32_PWM_TIM3_IRQ_PRIORITY         7
00231 #define STM32_PWM_TIM4_IRQ_PRIORITY         7
00232 #define STM32_PWM_TIM5_IRQ_PRIORITY         7
00233 #define STM32_PWM_TIM8_IRQ_PRIORITY         7
00234 #define STM32_PWM_TIM9_IRQ_PRIORITY         7
00235 
00236 /*
00237  * SDC driver system settings.
00238  */
00239 #define STM32_SDC_SDIO_DMA_PRIORITY         3
00240 #define STM32_SDC_SDIO_IRQ_PRIORITY         9
00241 #define STM32_SDC_WRITE_TIMEOUT_MS          1000
00242 #define STM32_SDC_READ_TIMEOUT_MS           1000
00243 #define STM32_SDC_CLOCK_ACTIVATION_DELAY    10
00244 #define STM32_SDC_SDIO_UNALIGNED_SUPPORT    TRUE
00245 #define STM32_SDC_SDIO_DMA_STREAM           STM32_DMA_STREAM_ID(2, 3)
00246 
00247 /*
00248  * SERIAL driver system settings.
00249  */
00250 #define STM32_SERIAL_USE_USART1             FALSE
00251 #define STM32_SERIAL_USE_USART2             FALSE
00252 #define STM32_SERIAL_USE_USART3             FALSE
00253 #define STM32_SERIAL_USE_UART4              FALSE
00254 #define STM32_SERIAL_USE_UART5              FALSE
00255 #define STM32_SERIAL_USE_USART6             FALSE
00256 #define STM32_SERIAL_USART1_PRIORITY        12
00257 #define STM32_SERIAL_USART2_PRIORITY        12
00258 #define STM32_SERIAL_USART3_PRIORITY        12
00259 #define STM32_SERIAL_UART4_PRIORITY         12
00260 #define STM32_SERIAL_UART5_PRIORITY         12
00261 #define STM32_SERIAL_USART6_PRIORITY        12
00262 
00263 /*
00264  * SPI driver system settings.
00265  */
00266 #define STM32_SPI_USE_SPI1                  FALSE
00267 #define STM32_SPI_USE_SPI2                  FALSE
00268 #define STM32_SPI_USE_SPI3                  TRUE
00269 #define STM32_SPI_SPI1_RX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 0)
00270 #define STM32_SPI_SPI1_TX_DMA_STREAM        STM32_DMA_STREAM_ID(2, 3)
00271 #define STM32_SPI_SPI2_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 3)
00272 #define STM32_SPI_SPI2_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 4)
00273 #define STM32_SPI_SPI3_RX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 0)
00274 #define STM32_SPI_SPI3_TX_DMA_STREAM        STM32_DMA_STREAM_ID(1, 7)
00275 #define STM32_SPI_SPI1_DMA_PRIORITY         1
00276 #define STM32_SPI_SPI2_DMA_PRIORITY         1
00277 #define STM32_SPI_SPI3_DMA_PRIORITY         1
00278 #define STM32_SPI_SPI1_IRQ_PRIORITY         10
00279 #define STM32_SPI_SPI2_IRQ_PRIORITY         10
00280 #define STM32_SPI_SPI3_IRQ_PRIORITY         10
00281 #define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
00282 
00283 /*
00284  * ST driver system settings.
00285  */
00286 #define STM32_ST_IRQ_PRIORITY               8
00287 #define STM32_ST_USE_TIMER                  2
00288 
00289 /*
00290  * UART driver system settings.
00291  */
00292 #define STM32_UART_USE_USART1               TRUE
00293 #define STM32_UART_USE_USART2               TRUE
00294 #define STM32_UART_USE_USART3               FALSE
00295 #define STM32_UART_USE_UART4                FALSE
00296 #define STM32_UART_USE_UART5                FALSE
00297 #define STM32_UART_USE_USART6               FALSE
00298 #define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 5)
00299 #define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
00300 #define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
00301 #define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 6)
00302 #define STM32_UART_USART3_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 1)
00303 #define STM32_UART_USART3_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
00304 #define STM32_UART_UART4_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 2)
00305 #define STM32_UART_UART4_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 4)
00306 #define STM32_UART_UART5_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 0)
00307 #define STM32_UART_UART5_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 7)
00308 #define STM32_UART_USART6_RX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 2)
00309 #define STM32_UART_USART6_TX_DMA_STREAM     STM32_DMA_STREAM_ID(2, 7)
00310 #define STM32_UART_USART1_IRQ_PRIORITY      12
00311 #define STM32_UART_USART2_IRQ_PRIORITY      12
00312 #define STM32_UART_USART3_IRQ_PRIORITY      12
00313 #define STM32_UART_UART4_IRQ_PRIORITY       12
00314 #define STM32_UART_UART5_IRQ_PRIORITY       12
00315 #define STM32_UART_USART6_IRQ_PRIORITY      12
00316 #define STM32_UART_USART1_DMA_PRIORITY      0
00317 #define STM32_UART_USART2_DMA_PRIORITY      0
00318 #define STM32_UART_USART3_DMA_PRIORITY      0
00319 #define STM32_UART_UART4_DMA_PRIORITY       0
00320 #define STM32_UART_UART5_DMA_PRIORITY       0
00321 #define STM32_UART_USART6_DMA_PRIORITY      0
00322 #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
00323 
00324 /*
00325  * USB driver system settings.
00326  */
00327 #define STM32_USB_USE_OTG1                  TRUE
00328 #define STM32_USB_USE_OTG2                  TRUE
00329 #define STM32_USB_OTG1_IRQ_PRIORITY         14
00330 #define STM32_USB_OTG2_IRQ_PRIORITY         14
00331 #define STM32_USB_OTG1_RX_FIFO_SIZE         512
00332 #define STM32_USB_OTG2_RX_FIFO_SIZE         1024
00333 #define STM32_USB_OTG_THREAD_PRIO           LOWPRIO
00334 #define STM32_USB_OTG_THREAD_STACK_SIZE     128
00335 #define STM32_USB_OTGFIFO_FILL_BASEPRI      0
00336 
00337 /*
00338  * WDG driver system settings.
00339  */
00340 #define STM32_WDG_USE_IWDG                  FALSE
00341 
00342 #endif /* MCUCONF_H */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines