logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

mcuconf.h (12507B)


  1. /*
  2. ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * STM32G0xx drivers configuration.
  15. * The following settings override the default settings present in
  16. * the various device driver implementation headers.
  17. * Note that the settings for each driver only have effect if the whole
  18. * driver is enabled in halconf.h.
  19. *
  20. * IRQ priorities:
  21. * 3...0 Lowest...Highest.
  22. *
  23. * DMA priorities:
  24. * 0...3 Lowest...Highest.
  25. */
  26. #ifndef MCUCONF_H
  27. #define MCUCONF_H
  28. #define STM32G0xx_MCUCONF
  29. #define STM32G0B1_MCUCONF
  30. #define STM32G0C1_MCUCONF
  31. /*
  32. * HAL driver system settings.
  33. */
  34. #define STM32_NO_INIT FALSE
  35. #define STM32_CLOCK_DYNAMIC TRUE
  36. #define STM32_VOS STM32_VOS_RANGE1
  37. #define STM32_PWR_CR2 (STM32_PVDRT_LEV0 | STM32_PVDFT_LEV0 | STM32_PVDE_DISABLED)
  38. #define STM32_PWR_CR3 (PWR_CR3_EIWUL)
  39. #define STM32_PWR_CR4 (0U)
  40. #define STM32_PWR_PUCRA (0U)
  41. #define STM32_PWR_PDCRA (0U)
  42. #define STM32_PWR_PUCRB (0U)
  43. #define STM32_PWR_PDCRB (0U)
  44. #define STM32_PWR_PUCRC (0U)
  45. #define STM32_PWR_PDCRC (0U)
  46. #define STM32_PWR_PUCRD (0U)
  47. #define STM32_PWR_PDCRD (0U)
  48. #define STM32_PWR_PUCRE (0U)
  49. #define STM32_PWR_PDCRE (0U)
  50. #define STM32_PWR_PUCRF (0U)
  51. #define STM32_PWR_PDCRF (0U)
  52. #define STM32_HSIDIV_VALUE 1
  53. #define STM32_HSI16_ENABLED TRUE
  54. #define STM32_HSI48_ENABLED TRUE
  55. #define STM32_HSE_ENABLED FALSE
  56. #define STM32_LSI_ENABLED FALSE
  57. #define STM32_LSE_ENABLED FALSE
  58. #define STM32_SW STM32_SW_PLLRCLK
  59. #define STM32_PLLSRC STM32_PLLSRC_HSI16
  60. #define STM32_PLLM_VALUE 2
  61. #define STM32_PLLN_VALUE 16
  62. #define STM32_PLLP_VALUE 2
  63. #define STM32_PLLQ_VALUE 4
  64. #define STM32_PLLR_VALUE 2
  65. #define STM32_HPRE STM32_HPRE_DIV1
  66. #define STM32_PPRE STM32_PPRE_DIV1
  67. #define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
  68. #define STM32_MCOPRE STM32_MCOPRE_DIV1
  69. #define STM32_LSCOSEL STM32_LSCOSEL_NOCLOCK
  70. /*
  71. * Peripherals clocks and sources.
  72. */
  73. #define STM32_FDCANSEL STM32_USBSEL_HSI48
  74. #define STM32_USBSEL STM32_USBSEL_HSI48
  75. #define STM32_USART1SEL STM32_USART1SEL_SYSCLK
  76. #define STM32_USART2SEL STM32_USART2SEL_SYSCLK
  77. #define STM32_USART3SEL STM32_USART3SEL_SYSCLK
  78. #define STM32_LPUART1SEL STM32_LPUART1SEL_SYSCLK
  79. #define STM32_LPUART2SEL STM32_LPUART2SEL_SYSCLK
  80. #define STM32_CECSEL STM32_CECSEL_HSI16DIV
  81. #define STM32_I2C1SEL STM32_I2C1SEL_PCLK
  82. #define STM32_I2C2SEL STM32_I2C1SEL_PCLK
  83. #define STM32_I2S1SEL STM32_I2S1SEL_SYSCLK
  84. #define STM32_I2S2SEL STM32_I2S2SEL_SYSCLK
  85. #define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK
  86. #define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK
  87. #define STM32_TIM1SEL STM32_TIM1SEL_TIMPCLK
  88. #define STM32_TIM15SEL STM32_TIM15SEL_TIMPCLK
  89. #define STM32_RNGSEL STM32_RNGSEL_HSI16
  90. #define STM32_RNGDIV_VALUE 1
  91. #define STM32_ADCSEL STM32_ADCSEL_PLLPCLK
  92. #define STM32_RTCSEL STM32_RTCSEL_NOCLOCK
  93. /*
  94. * Shared IRQ settings.
  95. */
  96. #define STM32_IRQ_EXTI0_1_PRIORITY 3
  97. #define STM32_IRQ_EXTI2_3_PRIORITY 3
  98. #define STM32_IRQ_EXTI4_15_PRIORITY 3
  99. #define STM32_IRQ_EXTI1921_PRIORITY 3
  100. #define STM32_IRQ_USART1_PRIORITY 2
  101. #define STM32_IRQ_USART2_LP2_PRIORITY 2
  102. #define STM32_IRQ_USART3_4_5_6_LP1_PRIORITY 2
  103. #define STM32_IRQ_TIM1_UP_PRIORITY 1
  104. #define STM32_IRQ_TIM1_CC_PRIORITY 1
  105. #define STM32_IRQ_TIM2_PRIORITY 1
  106. #define STM32_IRQ_TIM3_4_PRIORITY 1
  107. #define STM32_IRQ_TIM6_PRIORITY 1
  108. #define STM32_IRQ_TIM7_PRIORITY 1
  109. #define STM32_IRQ_TIM14_PRIORITY 1
  110. #define STM32_IRQ_TIM15_PRIORITY 1
  111. #define STM32_IRQ_TIM16_PRIORITY 1
  112. #define STM32_IRQ_TIM17_PRIORITY 1
  113. /*
  114. * ADC driver system settings.
  115. */
  116. #define STM32_ADC_USE_ADC1 FALSE
  117. #define STM32_ADC_ADC1_CFGR2 ADC_CFGR2_CKMODE_ADCCLK
  118. #define STM32_ADC_ADC1_DMA_PRIORITY 2
  119. #define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
  120. #define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  121. #define STM32_ADC_PRESCALER_VALUE 2
  122. /*
  123. * DAC driver system settings.
  124. */
  125. #define STM32_DAC_DUAL_MODE FALSE
  126. #define STM32_DAC_USE_DAC1_CH1 FALSE
  127. #define STM32_DAC_USE_DAC1_CH2 FALSE
  128. #define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 3
  129. #define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 3
  130. #define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
  131. #define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
  132. #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  133. #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  134. /*
  135. * GPT driver system settings.
  136. */
  137. #define STM32_GPT_USE_TIM1 FALSE
  138. #define STM32_GPT_USE_TIM2 FALSE
  139. #define STM32_GPT_USE_TIM3 FALSE
  140. #define STM32_GPT_USE_TIM4 FALSE
  141. #define STM32_GPT_USE_TIM6 FALSE
  142. #define STM32_GPT_USE_TIM7 FALSE
  143. #define STM32_GPT_USE_TIM14 FALSE
  144. #define STM32_GPT_USE_TIM15 FALSE
  145. #define STM32_GPT_USE_TIM16 FALSE
  146. #define STM32_GPT_USE_TIM17 FALSE
  147. /*
  148. * I2C driver system settings.
  149. */
  150. #define STM32_I2C_USE_I2C1 FALSE
  151. #define STM32_I2C_USE_I2C2 FALSE
  152. #define STM32_I2C_USE_I2C3 FALSE
  153. #define STM32_I2C_BUSY_TIMEOUT 50
  154. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  155. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  156. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  157. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  158. #define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  159. #define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  160. #define STM32_I2C_I2C1_IRQ_PRIORITY 3
  161. #define STM32_I2C_I2C2_IRQ_PRIORITY 3
  162. #define STM32_I2C_I2C1_DMA_PRIORITY 3
  163. #define STM32_I2C_I2C2_DMA_PRIORITY 3
  164. #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
  165. /*
  166. * ICU driver system settings.
  167. */
  168. #define STM32_ICU_USE_TIM1 FALSE
  169. #define STM32_ICU_USE_TIM2 FALSE
  170. #define STM32_ICU_USE_TIM3 FALSE
  171. #define STM32_ICU_USE_TIM4 FALSE
  172. #define STM32_ICU_USE_TIM15 FALSE
  173. /*
  174. * PWM driver system settings.
  175. */
  176. #define STM32_PWM_USE_TIM1 FALSE
  177. #define STM32_PWM_USE_TIM2 FALSE
  178. #define STM32_PWM_USE_TIM3 FALSE
  179. #define STM32_PWM_USE_TIM4 FALSE
  180. #define STM32_PWM_USE_TIM14 FALSE
  181. #define STM32_PWM_USE_TIM15 FALSE
  182. #define STM32_PWM_USE_TIM16 FALSE
  183. #define STM32_PWM_USE_TIM17 FALSE
  184. /*
  185. * RTC driver system settings.
  186. */
  187. #define STM32_RTC_PRESA_VALUE 32
  188. #define STM32_RTC_PRESS_VALUE 1024
  189. #define STM32_RTC_CR_INIT 0
  190. #define STM32_RTC_TAMPCR_INIT 0
  191. /*
  192. * SERIAL driver system settings.
  193. */
  194. #define STM32_SERIAL_USE_USART1 FALSE
  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_USE_LPUART1 FALSE
  201. #define STM32_SERIAL_USE_LPUART2 FALSE
  202. /*
  203. * SIO driver system settings.
  204. */
  205. #define STM32_SIO_USE_USART1 FALSE
  206. #define STM32_SIO_USE_USART2 FALSE
  207. #define STM32_SIO_USE_USART3 FALSE
  208. #define STM32_SIO_USE_UART4 FALSE
  209. #define STM32_SIO_USE_UART5 FALSE
  210. #define STM32_SIO_USE_USART6 FALSE
  211. #define STM32_SIO_USE_LPUART1 FALSE
  212. #define STM32_SIO_USE_LPUART2 FALSE
  213. /*
  214. * SPI driver system settings.
  215. */
  216. #define STM32_SPI_USE_SPI1 FALSE
  217. #define STM32_SPI_USE_SPI2 FALSE
  218. #define STM32_SPI_USE_SPI3 FALSE
  219. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  220. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  221. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  222. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  223. #define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  224. #define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  225. #define STM32_SPI_SPI1_DMA_PRIORITY 1
  226. #define STM32_SPI_SPI2_DMA_PRIORITY 1
  227. #define STM32_SPI_SPI3_DMA_PRIORITY 1
  228. #define STM32_SPI_SPI1_IRQ_PRIORITY 2
  229. #define STM32_SPI_SPI2_IRQ_PRIORITY 2
  230. #define STM32_SPI_SPI3_IRQ_PRIORITY 2
  231. #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
  232. /*
  233. * ST driver system settings.
  234. */
  235. #define STM32_ST_IRQ_PRIORITY 2
  236. #define STM32_ST_USE_TIMER 2
  237. /*
  238. * TRNG driver system settings.
  239. * NOTE: STM32G0C1 only.
  240. */
  241. #define STM32_TRNG_USE_RNG1 FALSE
  242. /*
  243. * UART driver system settings.
  244. */
  245. #define STM32_UART_USE_USART1 FALSE
  246. #define STM32_UART_USE_USART2 FALSE
  247. #define STM32_UART_USE_USART3 FALSE
  248. #define STM32_UART_USE_UART4 FALSE
  249. #define STM32_UART_USE_UART5 FALSE
  250. #define STM32_UART_USE_USART6 FALSE
  251. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  252. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  253. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  254. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  255. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  256. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  257. #define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  258. #define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  259. #define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  260. #define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  261. #define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  262. #define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
  263. #define STM32_UART_USART1_DMA_PRIORITY 0
  264. #define STM32_UART_USART2_DMA_PRIORITY 0
  265. #define STM32_UART_USART3_DMA_PRIORITY 0
  266. #define STM32_UART_UART4_DMA_PRIORITY 0
  267. #define STM32_UART_UART5_DMA_PRIORITY 0
  268. #define STM32_UART_USART6_DMA_PRIORITY 0
  269. #define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
  270. /*
  271. * USB driver system settings.
  272. */
  273. #define STM32_USB_USE_USB1 TRUE
  274. #define STM32_USB_USB1_LP_IRQ_PRIORITY 3
  275. #define STM32_USB_USE_ISOCHRONOUS FALSE
  276. #define STM32_USB_USE_FAST_COPY TRUE
  277. #define STM32_USB_HOST_WAKEUP_DURATION 2
  278. #define STM32_USB_48MHZ_DELTA 0
  279. /*
  280. * WDG driver system settings.
  281. */
  282. #define STM32_WDG_USE_IWDG FALSE
  283. #endif /* MCUCONF_H */