mcuconf.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. * SPC564Axx 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 SPC564Axx_MCUCONF
  28. /*
  29. * HAL driver system settings.
  30. */
  31. #define SPC5_NO_INIT FALSE
  32. #define SPC5_CLK_BYPASS FALSE
  33. #define SPC5_ALLOW_OVERCLOCK FALSE
  34. #define SPC5_CLK_PREDIV_VALUE 2
  35. #define SPC5_CLK_MFD_VALUE 75
  36. #define SPC5_CLK_RFD SPC5_RFD_DIV2
  37. #define SPC5_FLASH_BIUCR (BIUCR_BANK1_TOO | \
  38. BIUCR_MASTER4_PREFETCH | \
  39. BIUCR_MASTER0_PREFETCH | \
  40. BIUCR_DPFEN | \
  41. BIUCR_IPFEN | \
  42. BIUCR_PFLIM_ON_MISS | \
  43. BIUCR_BFEN)
  44. #define SPC5_EMIOS_GPRE_VALUE 20
  45. /*
  46. * EDMA driver settings.
  47. */
  48. #define SPC5_EDMA_CR_SETTING (EDMA_CR_GRP3PRI(3) | \
  49. EDMA_CR_GRP2PRI(2) | \
  50. EDMA_CR_GRP1PRI(1) | \
  51. EDMA_CR_GRP0PRI(0) | \
  52. EDMA_CR_EMLM | \
  53. EDMA_CR_ERGA)
  54. #define SPC5_EDMA_GROUP0_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  55. #define SPC5_EDMA_GROUP1_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  56. #define SPC5_EDMA_GROUP2_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  57. #define SPC5_EDMA_GROUP3_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  58. #define SPC5_EDMA_ERROR_IRQ_PRIO 12
  59. #define SPC5_EDMA_ERROR_HANDLER() osalSysHalt("DMA failure")
  60. /*
  61. * ADC driver settings.
  62. */
  63. #define SPC5_ADC_USE_ADC0_Q0 FALSE
  64. #define SPC5_ADC_USE_ADC0_Q1 FALSE
  65. #define SPC5_ADC_USE_ADC0_Q2 FALSE
  66. #define SPC5_ADC_USE_ADC1_Q3 FALSE
  67. #define SPC5_ADC_USE_ADC1_Q4 FALSE
  68. #define SPC5_ADC_USE_ADC1_Q5 FALSE
  69. #define SPC5_ADC_FIFO0_DMA_IRQ_PRIO 12
  70. #define SPC5_ADC_FIFO1_DMA_IRQ_PRIO 12
  71. #define SPC5_ADC_FIFO2_DMA_IRQ_PRIO 12
  72. #define SPC5_ADC_FIFO3_DMA_IRQ_PRIO 12
  73. #define SPC5_ADC_FIFO4_DMA_IRQ_PRIO 12
  74. #define SPC5_ADC_FIFO5_DMA_IRQ_PRIO 12
  75. #define SPC5_ADC_CR_CLK_PS ADC_CR_CLK_PS(5)
  76. #define SPC5_ADC_PUDCR {ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE,ADC_PUDCR_NONE}
  77. /*
  78. * SERIAL driver system settings.
  79. */
  80. #define SPC5_USE_ESCIA TRUE
  81. #define SPC5_USE_ESCIB FALSE
  82. #define SPC5_USE_ESCIC FALSE
  83. #define SPC5_ESCIA_PRIORITY 8
  84. #define SPC5_ESCIB_PRIORITY 8
  85. #define SPC5_ESCIC_PRIORITY 8
  86. /*
  87. * SPI driver system settings.
  88. */
  89. #define SPC5_SPI_USE_DSPI1 FALSE
  90. #define SPC5_SPI_USE_DSPI2 FALSE
  91. #define SPC5_SPI_USE_DSPI3 FALSE
  92. #define SPC5_SPI_DMA_MODE SPC5_SPI_DMA_RX_ONLY
  93. #define SPC5_SPI_DSPI1_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5 | SPC5_MCR_PCSIS6 | SPC5_MCR_PCSIS7)
  94. #define SPC5_SPI_DSPI2_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5 | SPC5_MCR_PCSIS6 | SPC5_MCR_PCSIS7)
  95. #define SPC5_SPI_DSPI3_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5 | SPC5_MCR_PCSIS6 | SPC5_MCR_PCSIS7)
  96. #define SPC5_SPI_DSPI1_DMA_IRQ_PRIO 10
  97. #define SPC5_SPI_DSPI2_DMA_IRQ_PRIO 10
  98. #define SPC5_SPI_DSPI3_DMA_IRQ_PRIO 10
  99. #define SPC5_SPI_DSPI1_IRQ_PRIO 10
  100. #define SPC5_SPI_DSPI2_IRQ_PRIO 10
  101. #define SPC5_SPI_DSPI3_IRQ_PRIO 10
  102. #define SPC5_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DSPI DMA failure")
  103. /*
  104. * ICU driver system settings.
  105. */
  106. #define SPC5_ICU_USE_EMIOS_CH1 FALSE
  107. #define SPC5_ICU_USE_EMIOS_CH2 FALSE
  108. #define SPC5_ICU_USE_EMIOS_CH3 FALSE
  109. #define SPC5_ICU_USE_EMIOS_CH4 FALSE
  110. #define SPC5_ICU_USE_EMIOS_CH5 FALSE
  111. #define SPC5_ICU_USE_EMIOS_CH6 FALSE
  112. #define SPC5_ICU_USE_EMIOS_CH11 FALSE
  113. #define SPC5_ICU_USE_EMIOS_CH13 FALSE
  114. #define SPC5_ICU_USE_EMIOS_CH7 FALSE
  115. #define SPC5_ICU_USE_EMIOS_CH16 FALSE
  116. #define SPC5_ICU_USE_EMIOS_CH17 FALSE
  117. #define SPC5_ICU_USE_EMIOS_CH18 FALSE
  118. #define SPC5_EMIOS_FLAG_F1_PRIORITY 8
  119. #define SPC5_EMIOS_FLAG_F2_PRIORITY 8
  120. #define SPC5_EMIOS_FLAG_F3_PRIORITY 8
  121. #define SPC5_EMIOS_FLAG_F4_PRIORITY 8
  122. #define SPC5_EMIOS_FLAG_F5_PRIORITY 8
  123. #define SPC5_EMIOS_FLAG_F6_PRIORITY 8
  124. #define SPC5_EMIOS_FLAG_F11_PRIORITY 8
  125. #define SPC5_EMIOS_FLAG_F13_PRIORITY 8
  126. #define SPC5_EMIOS_FLAG_F7_PRIORITY 8
  127. #define SPC5_EMIOS_FLAG_F16_PRIORITY 8
  128. #define SPC5_EMIOS_FLAG_F17_PRIORITY 8
  129. #define SPC5_EMIOS_FLAG_F18_PRIORITY 8
  130. /*
  131. * PWM driver system settings.
  132. */
  133. #define SPC5_PWM_USE_EMIOS_CH0 FALSE
  134. #define SPC5_PWM_USE_EMIOS_CH8 FALSE
  135. #define SPC5_PWM_USE_EMIOS_CH9 FALSE
  136. #define SPC5_PWM_USE_EMIOS_CH10 FALSE
  137. #define SPC5_PWM_USE_EMIOS_CH12 FALSE
  138. #define SPC5_PWM_USE_EMIOS_CH14 FALSE
  139. #define SPC5_PWM_USE_EMIOS_CH15 FALSE
  140. #define SPC5_PWM_USE_EMIOS_CH23 FALSE
  141. #define SPC5_PWM_USE_EMIOS_CH19 FALSE
  142. #define SPC5_PWM_USE_EMIOS_CH20 FALSE
  143. #define SPC5_PWM_USE_EMIOS_CH21 FALSE
  144. #define SPC5_PWM_USE_EMIOS_CH22 FALSE
  145. #define SPC5_EMIOS_FLAG_F0_PRIORITY 8
  146. #define SPC5_EMIOS_FLAG_F8_PRIORITY 8
  147. #define SPC5_EMIOS_FLAG_F9_PRIORITY 8
  148. #define SPC5_EMIOS_FLAG_F10_PRIORITY 8
  149. #define SPC5_EMIOS_FLAG_F12_PRIORITY 8
  150. #define SPC5_EMIOS_FLAG_F14_PRIORITY 8
  151. #define SPC5_EMIOS_FLAG_F15_PRIORITY 8
  152. #define SPC5_EMIOS_FLAG_F23_PRIORITY 8
  153. #define SPC5_EMIOS_FLAG_F19_PRIORITY 8
  154. #define SPC5_EMIOS_FLAG_F20_PRIORITY 8
  155. #define SPC5_EMIOS_FLAG_F21_PRIORITY 8
  156. #define SPC5_EMIOS_FLAG_F22_PRIORITY 8
  157. /*
  158. * CAN driver system settings.
  159. */
  160. #define SPC5_CAN_USE_FILTERS FALSE
  161. #define SPC5_CAN_USE_FLEXCAN0 FALSE
  162. #define SPC5_CAN_FLEXCAN0_USE_EXT_CLK FALSE
  163. #define SPC5_CAN_FLEXCAN0_IRQ_PRIORITY 11
  164. #define SPC5_CAN_USE_FLEXCAN1 FALSE
  165. #define SPC5_CAN_FLEXCAN1_USE_EXT_CLK FALSE
  166. #define SPC5_CAN_FLEXCAN1_IRQ_PRIORITY 11
  167. #define SPC5_CAN_USE_FLEXCAN2 FALSE
  168. #define SPC5_CAN_FLEXCAN2_USE_EXT_CLK FALSE
  169. #define SPC5_CAN_FLEXCAN2_IRQ_PRIORITY 11
  170. #endif /* MCUCONF_H */