mcuconf.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. * SPC563Mxx 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 SPC563Mxx_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 80
  36. #define SPC5_CLK_RFD SPC5_RFD_DIV4
  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_GRP1PRI(1) | \
  49. EDMA_CR_GRP0PRI(0) | \
  50. EDMA_CR_EMLM | \
  51. EDMA_CR_ERGA)
  52. #define SPC5_EDMA_GROUP0_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  53. #define SPC5_EDMA_GROUP1_PRIORITIES 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  54. #define SPC5_EDMA_ERROR_IRQ_PRIO 12
  55. #define SPC5_EDMA_ERROR_HANDLER() osalSysHalt("DMA failure")
  56. /*
  57. * ADC driver settings.
  58. */
  59. #define SPC5_ADC_USE_ADC0_Q0 FALSE
  60. #define SPC5_ADC_USE_ADC0_Q1 FALSE
  61. #define SPC5_ADC_USE_ADC0_Q2 FALSE
  62. #define SPC5_ADC_USE_ADC1_Q3 FALSE
  63. #define SPC5_ADC_USE_ADC1_Q4 FALSE
  64. #define SPC5_ADC_USE_ADC1_Q5 FALSE
  65. #define SPC5_ADC_FIFO0_DMA_IRQ_PRIO 12
  66. #define SPC5_ADC_FIFO1_DMA_IRQ_PRIO 12
  67. #define SPC5_ADC_FIFO2_DMA_IRQ_PRIO 12
  68. #define SPC5_ADC_FIFO3_DMA_IRQ_PRIO 12
  69. #define SPC5_ADC_FIFO4_DMA_IRQ_PRIO 12
  70. #define SPC5_ADC_FIFO5_DMA_IRQ_PRIO 12
  71. #define SPC5_ADC_CR_CLK_PS ADC_CR_CLK_PS(5)
  72. #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}
  73. /*
  74. * SERIAL driver system settings.
  75. */
  76. #define SPC5_USE_ESCIA TRUE
  77. #define SPC5_USE_ESCIB FALSE
  78. #define SPC5_ESCIA_PRIORITY 8
  79. #define SPC5_ESCIB_PRIORITY 8
  80. /*
  81. * SPI driver system settings.
  82. */
  83. #define SPC5_SPI_USE_DSPI1 FALSE
  84. #define SPC5_SPI_USE_DSPI2 FALSE
  85. #define SPC5_SPI_DMA_MODE SPC5_SPI_DMA_RX_ONLY
  86. #define SPC5_SPI_DSPI1_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5)
  87. #define SPC5_SPI_DSPI2_MCR (0 | SPC5_MCR_PCSIS0 | SPC5_MCR_PCSIS1 | SPC5_MCR_PCSIS2 | SPC5_MCR_PCSIS3 | SPC5_MCR_PCSIS4 | SPC5_MCR_PCSIS5)
  88. #define SPC5_SPI_DSPI1_DMA_IRQ_PRIO 10
  89. #define SPC5_SPI_DSPI2_DMA_IRQ_PRIO 10
  90. #define SPC5_SPI_DSPI1_IRQ_PRIO 10
  91. #define SPC5_SPI_DSPI2_IRQ_PRIO 10
  92. #define SPC5_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DSPI DMA failure")
  93. /*
  94. * ICU driver system settings.
  95. */
  96. #define SPC5_ICU_USE_EMIOS_CH1 FALSE
  97. #define SPC5_ICU_USE_EMIOS_CH2 FALSE
  98. #define SPC5_ICU_USE_EMIOS_CH3 FALSE
  99. #define SPC5_ICU_USE_EMIOS_CH4 FALSE
  100. #define SPC5_ICU_USE_EMIOS_CH5 FALSE
  101. #define SPC5_ICU_USE_EMIOS_CH6 FALSE
  102. #define SPC5_ICU_USE_EMIOS_CH11 FALSE
  103. #define SPC5_ICU_USE_EMIOS_CH13 FALSE
  104. #define SPC5_EMIOS_FLAG_F1_PRIORITY 8
  105. #define SPC5_EMIOS_FLAG_F2_PRIORITY 8
  106. #define SPC5_EMIOS_FLAG_F3_PRIORITY 8
  107. #define SPC5_EMIOS_FLAG_F4_PRIORITY 8
  108. #define SPC5_EMIOS_FLAG_F5_PRIORITY 8
  109. #define SPC5_EMIOS_FLAG_F6_PRIORITY 8
  110. #define SPC5_EMIOS_FLAG_F11_PRIORITY 8
  111. #define SPC5_EMIOS_FLAG_F13_PRIORITY 8
  112. /*
  113. * PWM driver system settings.
  114. */
  115. #define SPC5_PWM_USE_EMIOS_CH0 FALSE
  116. #define SPC5_PWM_USE_EMIOS_CH8 FALSE
  117. #define SPC5_PWM_USE_EMIOS_CH9 FALSE
  118. #define SPC5_PWM_USE_EMIOS_CH10 FALSE
  119. #define SPC5_PWM_USE_EMIOS_CH12 FALSE
  120. #define SPC5_PWM_USE_EMIOS_CH14 FALSE
  121. #define SPC5_PWM_USE_EMIOS_CH15 FALSE
  122. #define SPC5_PWM_USE_EMIOS_CH23 FALSE
  123. #define SPC5_EMIOS_FLAG_F0_PRIORITY 8
  124. #define SPC5_EMIOS_FLAG_F8_PRIORITY 8
  125. #define SPC5_EMIOS_FLAG_F9_PRIORITY 8
  126. #define SPC5_EMIOS_FLAG_F10_PRIORITY 8
  127. #define SPC5_EMIOS_FLAG_F12_PRIORITY 8
  128. #define SPC5_EMIOS_FLAG_F14_PRIORITY 8
  129. #define SPC5_EMIOS_FLAG_F15_PRIORITY 8
  130. #define SPC5_EMIOS_FLAG_F23_PRIORITY 8
  131. /*
  132. * CAN driver system settings.
  133. */
  134. #define SPC5_CAN_USE_FILTERS FALSE
  135. #define SPC5_CAN_USE_FLEXCAN0 FALSE
  136. #define SPC5_CAN_FLEXCAN0_USE_EXT_CLK FALSE
  137. #define SPC5_CAN_FLEXCAN0_IRQ_PRIORITY 11
  138. #define SPC5_CAN_USE_FLEXCAN1 FALSE
  139. #define SPC5_CAN_FLEXCAN1_USE_EXT_CLK FALSE
  140. #define SPC5_CAN_FLEXCAN1_IRQ_PRIORITY 11
  141. #endif /* MCUCONF_H */