logo

qmk_firmware

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

mcuconf.h (8188B)


  1. /*
  2. ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio
  3. ChibiOS - Copyright (C) 2023..2025 HorrorTroll
  4. ChibiOS - Copyright (C) 2023..2025 Zhaqian
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. */
  15. #ifndef MCUCONF_H
  16. #define MCUCONF_H
  17. /*
  18. * AT32F415 drivers configuration.
  19. * The following settings override the default settings present in
  20. * the various device driver implementation headers.
  21. * Note that the settings for each driver only have effect if the whole
  22. * driver is enabled in halconf.h.
  23. *
  24. * IRQ priorities:
  25. * 15...0 Lowest...Highest.
  26. *
  27. * DMA priorities:
  28. * 0...3 Lowest...Highest.
  29. */
  30. #define AT32F415_MCUCONF
  31. /*
  32. * General settings.
  33. */
  34. #define AT32_NO_INIT FALSE
  35. /*
  36. * HAL driver system settings.
  37. */
  38. #define AT32_HICK_ENABLED TRUE
  39. #define AT32_LICK_ENABLED FALSE
  40. #define AT32_HEXT_ENABLED TRUE
  41. #define AT32_LEXT_ENABLED FALSE
  42. #define AT32_SCLKSEL AT32_SCLKSEL_PLL
  43. #define AT32_PLLRCS AT32_PLLRCS_HEXT
  44. #define AT32_PLLHEXTDIV AT32_PLLHEXTDIV_DIV1
  45. #define AT32_PLLCFGEN AT32_PLLCFGEN_SOLID
  46. #define AT32_PLLMULT_VALUE 18
  47. #define AT32_PLL_FR_VALUE 4
  48. #define AT32_PLL_MS_VALUE 1
  49. #define AT32_PLL_NS_VALUE 72
  50. #define AT32_AHBDIV AT32_AHBDIV_DIV1
  51. #define AT32_APB1DIV AT32_APB1DIV_DIV2
  52. #define AT32_APB2DIV AT32_APB2DIV_DIV2
  53. #define AT32_ADCDIV AT32_ADCDIV_DIV4
  54. #define AT32_USB_CLOCK_REQUIRED TRUE
  55. #define AT32_USBDIV AT32_USBDIV_DIV3
  56. #define AT32_CLKOUT_SEL AT32_CLKOUT_SEL_NOCLOCK
  57. #define AT32_CLKOUTDIV AT32_CLKOUTDIV_DIV1
  58. #define AT32_ERTCSEL AT32_ERTCSEL_NOCLOCK
  59. #define AT32_PVM_ENABLE FALSE
  60. #define AT32_PVMSEL AT32_PVMSEL_LEV1
  61. /*
  62. * IRQ system settings.
  63. */
  64. #define AT32_IRQ_EXINT0_PRIORITY 6
  65. #define AT32_IRQ_EXINT1_PRIORITY 6
  66. #define AT32_IRQ_EXINT2_PRIORITY 6
  67. #define AT32_IRQ_EXINT3_PRIORITY 6
  68. #define AT32_IRQ_EXINT4_PRIORITY 6
  69. #define AT32_IRQ_EXINT5_9_PRIORITY 6
  70. #define AT32_IRQ_EXINT10_15_PRIORITY 6
  71. #define AT32_IRQ_EXINT16_PRIORITY 6
  72. #define AT32_IRQ_EXINT17_PRIORITY 15
  73. #define AT32_IRQ_EXINT18_PRIORITY 6
  74. #define AT32_IRQ_EXINT19_PRIORITY 6
  75. #define AT32_IRQ_EXINT20_PRIORITY 6
  76. #define AT32_IRQ_EXINT21_PRIORITY 15
  77. #define AT32_IRQ_EXINT22_PRIORITY 15
  78. #define AT32_IRQ_TMR1_BRK_TMR9_PRIORITY 7
  79. #define AT32_IRQ_TMR1_OVF_TMR10_PRIORITY 7
  80. #define AT32_IRQ_TMR1_HALL_TMR11_PRIORITY 7
  81. #define AT32_IRQ_TMR1_CH_PRIORITY 7
  82. #define AT32_IRQ_TMR2_PRIORITY 7
  83. #define AT32_IRQ_TMR3_PRIORITY 7
  84. #define AT32_IRQ_TMR4_PRIORITY 7
  85. #define AT32_IRQ_TMR5_PRIORITY 7
  86. #define AT32_IRQ_USART1_PRIORITY 12
  87. #define AT32_IRQ_USART2_PRIORITY 12
  88. #define AT32_IRQ_USART3_PRIORITY 12
  89. #define AT32_IRQ_UART4_PRIORITY 12
  90. #define AT32_IRQ_UART5_PRIORITY 12
  91. /*
  92. * ADC driver system settings.
  93. */
  94. #define AT32_ADC_USE_ADC1 FALSE
  95. #define AT32_ADC_ADC1_DMA_PRIORITY 2
  96. #define AT32_ADC_ADC1_IRQ_PRIORITY 6
  97. /*
  98. * CAN driver system settings.
  99. */
  100. #define AT32_CAN_USE_CAN1 FALSE
  101. #define AT32_CAN_CAN1_IRQ_PRIORITY 11
  102. /*
  103. * DMA driver system settings.
  104. */
  105. #define AT32_DMA_USE_DMAMUX TRUE
  106. /*
  107. * GPT driver system settings.
  108. */
  109. #define AT32_GPT_USE_TMR1 FALSE
  110. #define AT32_GPT_USE_TMR2 FALSE
  111. #define AT32_GPT_USE_TMR3 FALSE
  112. #define AT32_GPT_USE_TMR4 FALSE
  113. #define AT32_GPT_USE_TMR5 FALSE
  114. #define AT32_GPT_USE_TMR9 FALSE
  115. #define AT32_GPT_USE_TMR10 FALSE
  116. #define AT32_GPT_USE_TMR11 FALSE
  117. /*
  118. * I2C driver system settings.
  119. */
  120. #define AT32_I2C_USE_I2C1 FALSE
  121. #define AT32_I2C_USE_I2C2 FALSE
  122. #define AT32_I2C_BUSY_TIMEOUT 50
  123. #define AT32_I2C_I2C1_DMA_PRIORITY 3
  124. #define AT32_I2C_I2C2_DMA_PRIORITY 3
  125. #define AT32_I2C_I2C1_IRQ_PRIORITY 5
  126. #define AT32_I2C_I2C2_IRQ_PRIORITY 5
  127. #define AT32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
  128. /*
  129. * ICU driver system settings.
  130. */
  131. #define AT32_ICU_USE_TMR1 FALSE
  132. #define AT32_ICU_USE_TMR2 FALSE
  133. #define AT32_ICU_USE_TMR3 FALSE
  134. #define AT32_ICU_USE_TMR4 FALSE
  135. #define AT32_ICU_USE_TMR5 FALSE
  136. #define AT32_ICU_USE_TMR9 FALSE
  137. /*
  138. * PWM driver system settings.
  139. */
  140. #define AT32_PWM_USE_TMR1 FALSE
  141. #define AT32_PWM_USE_TMR2 FALSE
  142. #define AT32_PWM_USE_TMR3 FALSE
  143. #define AT32_PWM_USE_TMR4 FALSE
  144. #define AT32_PWM_USE_TMR5 FALSE
  145. #define AT32_PWM_USE_TMR9 FALSE
  146. #define AT32_PWM_USE_TMR10 FALSE
  147. #define AT32_PWM_USE_TMR11 FALSE
  148. /*
  149. * RTC driver system settings.
  150. */
  151. #define AT32_ERTC_DIVA_VALUE 32
  152. #define AT32_ERTC_DIVB_VALUE 1024
  153. #define AT32_ERTC_CTRL_INIT 0
  154. #define AT32_ERTC_TAMP_INIT 0
  155. /*
  156. * SDC driver system settings.
  157. */
  158. #define AT32_SDC_SDIO_DMA_PRIORITY 3
  159. #define AT32_SDC_SDIO_IRQ_PRIORITY 9
  160. #define AT32_SDC_WRITE_TIMEOUT_MS 1000
  161. #define AT32_SDC_READ_TIMEOUT_MS 1000
  162. #define AT32_SDC_CLOCK_ACTIVATION_DELAY 10
  163. #define AT32_SDC_SDIO_UNALIGNED_SUPPORT TRUE
  164. /*
  165. * SERIAL driver system settings.
  166. */
  167. #define AT32_SERIAL_USE_USART1 FALSE
  168. #define AT32_SERIAL_USE_USART2 FALSE
  169. #define AT32_SERIAL_USE_USART3 FALSE
  170. #define AT32_SERIAL_USE_UART4 FALSE
  171. #define AT32_SERIAL_USE_UART5 FALSE
  172. /*
  173. * SPI driver system settings.
  174. */
  175. #define AT32_SPI_USE_SPI1 FALSE
  176. #define AT32_SPI_USE_SPI2 FALSE
  177. #define AT32_SPI_SPI1_DMA_PRIORITY 1
  178. #define AT32_SPI_SPI2_DMA_PRIORITY 1
  179. #define AT32_SPI_SPI1_IRQ_PRIORITY 10
  180. #define AT32_SPI_SPI2_IRQ_PRIORITY 10
  181. #define AT32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
  182. /*
  183. * ST driver system settings.
  184. */
  185. #define AT32_ST_IRQ_PRIORITY 8
  186. #define AT32_ST_USE_TIMER 2
  187. /*
  188. * UART driver system settings.
  189. */
  190. #define AT32_UART_USE_USART1 FALSE
  191. #define AT32_UART_USE_USART2 FALSE
  192. #define AT32_UART_USE_USART3 FALSE
  193. #define AT32_UART_USE_UART4 FALSE
  194. #define AT32_UART_USE_UART5 FALSE
  195. #define AT32_UART_USART1_DMA_PRIORITY 0
  196. #define AT32_UART_USART2_DMA_PRIORITY 0
  197. #define AT32_UART_USART3_DMA_PRIORITY 0
  198. #define AT32_UART_UART4_DMA_PRIORITY 0
  199. #define AT32_UART_UART5_DMA_PRIORITY 0
  200. #define AT32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
  201. /*
  202. * USB driver system settings.
  203. */
  204. #define AT32_USB_USE_OTG1 TRUE
  205. #define AT32_USB_OTG1_IRQ_PRIORITY 14
  206. #define AT32_USB_OTG1_RX_FIFO_SIZE 512
  207. /*
  208. * WDG driver system settings.
  209. */
  210. #define AT32_WDG_USE_WDT FALSE
  211. #endif /* MCUCONF_H */