mcuconf.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 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. #ifndef MCUCONF_H
  14. #define MCUCONF_H
  15. /*
  16. * SPC56ECxx drivers configuration.
  17. * The following settings override the default settings present in
  18. * the various device driver implementation headers.
  19. * Note that the settings for each driver only have effect if the whole
  20. * driver is enabled in halconf.h.
  21. *
  22. * IRQ priorities:
  23. * 1...15 Lowest...Highest.
  24. * DMA priorities:
  25. * 0...15 Highest...Lowest.
  26. */
  27. #define SPC56ECxx_MCUCONF
  28. /*
  29. * HAL driver system settings.
  30. */
  31. #define SPC5_NO_INIT FALSE
  32. #define SPC5_ALLOW_OVERCLOCK FALSE
  33. #define SPC5_DISABLE_WATCHDOG TRUE
  34. #define SPC5_FMPLL0_IDF_VALUE 5
  35. #define SPC5_FMPLL0_NDIV_VALUE 60
  36. #define SPC5_FMPLL0_ODF SPC5_FMPLL_ODF_DIV4
  37. #define SPC5_XOSCDIV_VALUE 1
  38. #define SPC5_IRCDIV_VALUE 1
  39. #define SPC5_PERIPHERAL1_CLK_DIV_VALUE 4
  40. #define SPC5_PERIPHERAL2_CLK_DIV_VALUE 2
  41. #define SPC5_PERIPHERAL3_CLK_DIV_VALUE 2
  42. #define SPC5_Z0_CLK_DIV_VALUE 2
  43. #define SPC5_FEC_CLK_DIV_VALUE 2
  44. #define SPC5_FLASH_CLK_DIV_VALUE 2
  45. #define SPC5_CLOCK_FAILURE_HOOK() osalSysHalt("clock failure")
  46. #define SPC5_EMIOS0_GPRE_VALUE 20
  47. #define SPC5_EMIOS1_GPRE_VALUE 20
  48. /*
  49. * EDMA driver settings.
  50. */
  51. #define SPC5_EDMA_CR_SETTING (EDMA_CR_GRP1PRI(1) | \
  52. EDMA_CR_GRP0PRI(0) | \
  53. EDMA_CR_EMLM | \
  54. EDMA_CR_ERGA)
  55. #define SPC5_EDMA_GROUP0_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  56. #define SPC5_EDMA_GROUP1_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  57. #define SPC5_EDMA_ERROR_IRQ_PRIO 12
  58. #define SPC5_EDMA_ERROR_HANDLER() osalSysHalt("DMA failure")
  59. /*
  60. * SERIAL driver system settings.
  61. */
  62. #define SPC5_SERIAL_USE_LINFLEX0 TRUE
  63. #define SPC5_SERIAL_USE_LINFLEX1 FALSE
  64. #define SPC5_SERIAL_USE_LINFLEX2 FALSE
  65. #define SPC5_SERIAL_USE_LINFLEX3 FALSE
  66. #define SPC5_SERIAL_USE_LINFLEX4 FALSE
  67. #define SPC5_SERIAL_USE_LINFLEX5 FALSE
  68. #define SPC5_SERIAL_USE_LINFLEX6 FALSE
  69. #define SPC5_SERIAL_USE_LINFLEX7 FALSE
  70. #define SPC5_SERIAL_USE_LINFLEX8 FALSE
  71. #define SPC5_SERIAL_USE_LINFLEX9 FALSE
  72. #define SPC5_SERIAL_LINFLEX0_PRIORITY 8
  73. #define SPC5_SERIAL_LINFLEX1_PRIORITY 8
  74. #define SPC5_SERIAL_LINFLEX2_PRIORITY 8
  75. #define SPC5_SERIAL_LINFLEX3_PRIORITY 8
  76. #define SPC5_SERIAL_LINFLEX4_PRIORITY 8
  77. #define SPC5_SERIAL_LINFLEX5_PRIORITY 8
  78. #define SPC5_SERIAL_LINFLEX6_PRIORITY 8
  79. #define SPC5_SERIAL_LINFLEX7_PRIORITY 8
  80. #define SPC5_SERIAL_LINFLEX8_PRIORITY 8
  81. #define SPC5_SERIAL_LINFLEX9_PRIORITY 8
  82. /*
  83. * SPI driver system settings.
  84. */
  85. #define SPC5_SPI_USE_DSPI0 FALSE
  86. #define SPC5_SPI_USE_DSPI1 FALSE
  87. #define SPC5_SPI_USE_DSPI2 FALSE
  88. #define SPC5_SPI_USE_DSPI3 FALSE
  89. #define SPC5_SPI_USE_DSPI4 FALSE
  90. #define SPC5_SPI_USE_DSPI5 FALSE
  91. #define SPC5_SPI_USE_DSPI6 FALSE
  92. #define SPC5_SPI_USE_DSPI7 FALSE
  93. #define SPC5_SPI_DMA_MODE SPC5_SPI_DMA_RX_ONLY
  94. #define SPC5_SPI_DSPI0_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5)
  95. #define SPC5_SPI_DSPI1_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4)
  96. #define SPC5_SPI_DSPI2_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3)
  97. #define SPC5_SPI_DSPI3_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1)
  98. #define SPC5_SPI_DSPI4_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1)
  99. #define SPC5_SPI_DSPI5_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2)
  100. #define SPC5_SPI_DSPI6_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3)
  101. #define SPC5_SPI_DSPI7_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3)
  102. #define SPC5_SPI_DSPI0_TX1_DMA_CH_ID 4
  103. #define SPC5_SPI_DSPI0_TX2_DMA_CH_ID 5
  104. #define SPC5_SPI_DSPI0_RX_DMA_CH_ID 6
  105. #define SPC5_SPI_DSPI1_TX1_DMA_CH_ID 7
  106. #define SPC5_SPI_DSPI1_TX2_DMA_CH_ID 8
  107. #define SPC5_SPI_DSPI1_RX_DMA_CH_ID 9
  108. #define SPC5_SPI_DSPI2_TX1_DMA_CH_ID 10
  109. #define SPC5_SPI_DSPI2_TX2_DMA_CH_ID 11
  110. #define SPC5_SPI_DSPI2_RX_DMA_CH_ID 12
  111. #define SPC5_SPI_DSPI3_TX1_DMA_CH_ID 13
  112. #define SPC5_SPI_DSPI3_TX2_DMA_CH_ID 14
  113. #define SPC5_SPI_DSPI3_RX_DMA_CH_ID 15
  114. #define SPC5_SPI_DSPI4_TX1_DMA_CH_ID 16
  115. #define SPC5_SPI_DSPI4_TX2_DMA_CH_ID 17
  116. #define SPC5_SPI_DSPI4_RX_DMA_CH_ID 18
  117. #define SPC5_SPI_DSPI5_TX1_DMA_CH_ID 19
  118. #define SPC5_SPI_DSPI5_TX2_DMA_CH_ID 20
  119. #define SPC5_SPI_DSPI5_RX_DMA_CH_ID 21
  120. #define SPC5_SPI_DSPI6_TX1_DMA_CH_ID 22
  121. #define SPC5_SPI_DSPI6_TX2_DMA_CH_ID 23
  122. #define SPC5_SPI_DSPI6_RX_DMA_CH_ID 24
  123. #define SPC5_SPI_DSPI7_TX1_DMA_CH_ID 25
  124. #define SPC5_SPI_DSPI7_TX2_DMA_CH_ID 26
  125. #define SPC5_SPI_DSPI7_RX_DMA_CH_ID 27
  126. #define SPC5_SPI_DSPI0_DMA_IRQ_PRIO 10
  127. #define SPC5_SPI_DSPI1_DMA_IRQ_PRIO 10
  128. #define SPC5_SPI_DSPI2_DMA_IRQ_PRIO 10
  129. #define SPC5_SPI_DSPI3_DMA_IRQ_PRIO 10
  130. #define SPC5_SPI_DSPI4_DMA_IRQ_PRIO 10
  131. #define SPC5_SPI_DSPI5_DMA_IRQ_PRIO 10
  132. #define SPC5_SPI_DSPI6_DMA_IRQ_PRIO 10
  133. #define SPC5_SPI_DSPI7_DMA_IRQ_PRIO 10
  134. #define SPC5_SPI_DSPI0_IRQ_PRIO 10
  135. #define SPC5_SPI_DSPI1_IRQ_PRIO 10
  136. #define SPC5_SPI_DSPI2_IRQ_PRIO 10
  137. #define SPC5_SPI_DSPI3_IRQ_PRIO 10
  138. #define SPC5_SPI_DSPI4_IRQ_PRIO 10
  139. #define SPC5_SPI_DSPI5_IRQ_PRIO 10
  140. #define SPC5_SPI_DSPI6_IRQ_PRIO 10
  141. #define SPC5_SPI_DSPI7_IRQ_PRIO 10
  142. #define SPC5_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DSPI DMA failure")
  143. /*
  144. * ICU-PWM driver system settings.
  145. */
  146. #define SPC5_ICU_USE_EMIOS0_CH0 FALSE
  147. #define SPC5_ICU_USE_EMIOS0_CH1 FALSE
  148. #define SPC5_ICU_USE_EMIOS0_CH2 FALSE
  149. #define SPC5_ICU_USE_EMIOS0_CH3 FALSE
  150. #define SPC5_ICU_USE_EMIOS0_CH4 FALSE
  151. #define SPC5_ICU_USE_EMIOS0_CH5 FALSE
  152. #define SPC5_ICU_USE_EMIOS0_CH6 FALSE
  153. #define SPC5_ICU_USE_EMIOS0_CH7 FALSE
  154. #define SPC5_ICU_USE_EMIOS0_CH24 FALSE
  155. #define SPC5_PWM_USE_EMIOS0_GROUP0 FALSE
  156. #define SPC5_PWM_USE_EMIOS0_GROUP1 FALSE
  157. #define SPC5_EMIOS0_GFR_F0F1_PRIORITY 8
  158. #define SPC5_EMIOS0_GFR_F2F3_PRIORITY 8
  159. #define SPC5_EMIOS0_GFR_F4F5_PRIORITY 8
  160. #define SPC5_EMIOS0_GFR_F6F7_PRIORITY 8
  161. #define SPC5_EMIOS0_GFR_F8F9_PRIORITY 8
  162. #define SPC5_EMIOS0_GFR_F10F11_PRIORITY 8
  163. #define SPC5_EMIOS0_GFR_F12F13_PRIORITY 8
  164. #define SPC5_EMIOS0_GFR_F14F15_PRIORITY 8
  165. #define SPC5_EMIOS0_GFR_F16F17_PRIORITY 8
  166. #define SPC5_EMIOS0_GFR_F18F19_PRIORITY 8
  167. #define SPC5_EMIOS0_GFR_F20F21_PRIORITY 8
  168. #define SPC5_EMIOS0_GFR_F22F23_PRIORITY 8
  169. #define SPC5_EMIOS0_GFR_F24F25_PRIORITY 8
  170. #define SPC5_EMIOS0_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  171. SPC5_ME_PCTL_LP(2))
  172. #define SPC5_EMIOS0_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  173. SPC5_ME_PCTL_LP(0))
  174. #define SPC5_ICU_USE_EMIOS1_CH24 FALSE
  175. #define SPC5_PWM_USE_EMIOS1_GROUP0 FALSE
  176. #define SPC5_PWM_USE_EMIOS1_GROUP1 FALSE
  177. #define SPC5_PWM_USE_EMIOS1_GROUP2 FALSE
  178. #define SPC5_EMIOS1_GFR_F0F1_PRIORITY 8
  179. #define SPC5_EMIOS1_GFR_F2F3_PRIORITY 8
  180. #define SPC5_EMIOS1_GFR_F4F5_PRIORITY 8
  181. #define SPC5_EMIOS1_GFR_F6F7_PRIORITY 8
  182. #define SPC5_EMIOS1_GFR_F8F9_PRIORITY 8
  183. #define SPC5_EMIOS1_GFR_F10F11_PRIORITY 8
  184. #define SPC5_EMIOS1_GFR_F12F13_PRIORITY 8
  185. #define SPC5_EMIOS1_GFR_F14F15_PRIORITY 8
  186. #define SPC5_EMIOS1_GFR_F16F17_PRIORITY 8
  187. #define SPC5_EMIOS1_GFR_F18F19_PRIORITY 8
  188. #define SPC5_EMIOS1_GFR_F20F21_PRIORITY 8
  189. #define SPC5_EMIOS1_GFR_F22F23_PRIORITY 8
  190. #define SPC5_EMIOS1_GFR_F24F25_PRIORITY 8
  191. #define SPC5_EMIOS1_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  192. SPC5_ME_PCTL_LP(2))
  193. #define SPC5_EMIOS1_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  194. SPC5_ME_PCTL_LP(0))
  195. /*
  196. * CAN driver system settings.
  197. */
  198. #define SPC5_CAN_USE_FILTERS FALSE
  199. #define SPC5_CAN_USE_FLEXCAN0 FALSE
  200. #define SPC5_CAN_FLEXCAN0_USE_EXT_CLK FALSE
  201. #define SPC5_CAN_FLEXCAN0_PRIORITY 11
  202. #define SPC5_CAN_FLEXCAN0_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  203. SPC5_ME_PCTL_LP(2))
  204. #define SPC5_CAN_FLEXCAN0_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  205. SPC5_ME_PCTL_LP(0))
  206. #define SPC5_CAN_USE_FLEXCAN1 FALSE
  207. #define SPC5_CAN_FLEXCAN1_USE_EXT_CLK FALSE
  208. #define SPC5_CAN_FLEXCAN1_PRIORITY 11
  209. #define SPC5_CAN_FLEXCAN1_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  210. SPC5_ME_PCTL_LP(2))
  211. #define SPC5_CAN_FLEXCAN1_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  212. SPC5_ME_PCTL_LP(0))
  213. #define SPC5_CAN_USE_FLEXCAN2 FALSE
  214. #define SPC5_CAN_FLEXCAN2_USE_EXT_CLK FALSE
  215. #define SPC5_CAN_FLEXCAN2_PRIORITY 11
  216. #define SPC5_CAN_FLEXCAN2_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  217. SPC5_ME_PCTL_LP(2))
  218. #define SPC5_CAN_FLEXCAN2_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  219. SPC5_ME_PCTL_LP(0))
  220. #define SPC5_CAN_USE_FLEXCAN3 FALSE
  221. #define SPC5_CAN_FLEXCAN3_USE_EXT_CLK FALSE
  222. #define SPC5_CAN_FLEXCAN3_PRIORITY 11
  223. #define SPC5_CAN_FLEXCAN3_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  224. SPC5_ME_PCTL_LP(2))
  225. #define SPC5_CAN_FLEXCAN3_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  226. SPC5_ME_PCTL_LP(0))
  227. #define SPC5_CAN_USE_FLEXCAN4 FALSE
  228. #define SPC5_CAN_FLEXCAN4_USE_EXT_CLK FALSE
  229. #define SPC5_CAN_FLEXCAN4_PRIORITY 11
  230. #define SPC5_CAN_FLEXCAN4_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  231. SPC5_ME_PCTL_LP(2))
  232. #define SPC5_CAN_FLEXCAN4_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  233. SPC5_ME_PCTL_LP(0))
  234. #define SPC5_CAN_USE_FLEXCAN5 FALSE
  235. #define SPC5_CAN_FLEXCAN5_USE_EXT_CLK FALSE
  236. #define SPC5_CAN_FLEXCAN5_PRIORITY 11
  237. #define SPC5_CAN_FLEXCAN5_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  238. SPC5_ME_PCTL_LP(2))
  239. #define SPC5_CAN_FLEXCAN5_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  240. SPC5_ME_PCTL_LP(0))
  241. /*
  242. * ADC driver system settings.
  243. */
  244. #define SPC5_ADC_USE_ADC0 FALSE
  245. #define SPC5_ADC_ADC0_CLK_FREQUENCY HALF_PERIPHERAL_SET_CLOCK_FREQUENCY
  246. #define SPC5_ADC_ADC0_AUTO_CLOCK_OFF FALSE
  247. #define SPC5_ADC_ADC0_WD_PRIORITY 12
  248. #define SPC5_ADC_ADC0_DMA_CH_ID 1
  249. #define SPC5_ADC_ADC0_DMA_IRQ_PRIO 12
  250. #define SPC5_ADC_ADC0_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  251. SPC5_ME_PCTL_LP(2))
  252. #define SPC5_ADC_ADC0_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  253. SPC5_ME_PCTL_LP(0))
  254. #define SPC5_ADC_USE_ADC1 FALSE
  255. #define SPC5_ADC_ADC1_CLK_FREQUENCY HALF_PERIPHERAL_SET_CLOCK_FREQUENCY
  256. #define SPC5_ADC_ADC1_AUTO_CLOCK_OFF FALSE
  257. #define SPC5_ADC_ADC1_WD_PRIORITY 12
  258. #define SPC5_ADC_ADC1_DMA_CH_ID 2
  259. #define SPC5_ADC_ADC1_DMA_IRQ_PRIO 12
  260. #define SPC5_ADC_ADC1_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  261. SPC5_ME_PCTL_LP(2))
  262. #define SPC5_ADC_ADC1_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  263. SPC5_ME_PCTL_LP(0))
  264. #endif /* MCUCONF_H */