mcuconf.h.ftl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. [#ftl]
  2. [@pp.dropOutputFile /]
  3. [@pp.changeOutputFile name="mcuconf.h" /]
  4. /*
  5. SPC5 HAL - Copyright (C) 2013 STMicroelectronics
  6. Licensed under the Apache License, Version 2.0 (the "License");
  7. you may not use this file except in compliance with the License.
  8. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. */
  16. #ifndef _MCUCONF_H_
  17. #define _MCUCONF_H_
  18. /*
  19. * SPC56ELxx drivers configuration.
  20. * The following settings override the default settings present in
  21. * the various device driver implementation headers.
  22. * Note that the settings for each driver only have effect if the whole
  23. * driver is enabled in halconf.h.
  24. *
  25. * IRQ priorities:
  26. * 1...15 Lowest...Highest.
  27. * DMA priorities:
  28. * 0...15 Highest...Lowest.
  29. */
  30. #define SPC56ELxx_MCUCONF
  31. /*
  32. * HAL driver system settings.
  33. */
  34. #define SPC5_NO_INIT ${conf.instance.initialization_settings.do_not_init.value[0]?upper_case}
  35. #define SPC5_ALLOW_OVERCLOCK ${conf.instance.initialization_settings.allow_overclocking.value[0]?upper_case}
  36. #define SPC5_DISABLE_WATCHDOG ${conf.instance.initialization_settings.disable_watchdog.value[0]?upper_case}
  37. #define SPC5_FMPLL0_CLK_SRC SPC5_FMPLL_SRC_${conf.instance.initialization_settings.fmpll0_settings.clock_source.value[0]}
  38. #define SPC5_FMPLL0_IDF_VALUE ${conf.instance.initialization_settings.fmpll0_settings.idf_value.value[0]}
  39. #define SPC5_FMPLL0_NDIV_VALUE ${conf.instance.initialization_settings.fmpll0_settings.ndiv_value.value[0]}
  40. #define SPC5_FMPLL0_ODF ${conf.instance.initialization_settings.fmpll0_settings.odf_value.value[0]}
  41. #define SPC5_FMPLL1_CLK_SRC SPC5_FMPLL_SRC_${conf.instance.initialization_settings.fmpll1_settings.clock_source.value[0]}
  42. #define SPC5_FMPLL1_IDF_VALUE ${conf.instance.initialization_settings.fmpll1_settings.idf_value.value[0]}
  43. #define SPC5_FMPLL1_NDIV_VALUE ${conf.instance.initialization_settings.fmpll1_settings.ndiv_value.value[0]}
  44. #define SPC5_FMPLL1_ODF ${conf.instance.initialization_settings.fmpll1_settings.odf_value.value[0]}
  45. #define SPC5_SYSCLK_DIVIDER_VALUE ${conf.instance.initialization_settings.clocks.system_clock_divider.value[0]}
  46. #define SPC5_AUX0CLK_SRC SPC5_CGM_SS_${conf.instance.initialization_settings.clocks.aux0_clock_source.value[0]}
  47. #define SPC5_MCONTROL_DIVIDER_VALUE ${conf.instance.initialization_settings.clocks.motor_control_clock_divider.value[0]}
  48. #define SPC5_SWG_DIVIDER_VALUE ${conf.instance.initialization_settings.clocks.swg_clock_divider.value[0]}
  49. #define SPC5_AUX1CLK_SRC SPC5_CGM_SS_${conf.instance.initialization_settings.clocks.aux1_clock_source.value[0]}
  50. #define SPC5_FLEXRAY_DIVIDER_VALUE ${conf.instance.initialization_settings.clocks.flexray_clock_divider.value[0]}
  51. #define SPC5_AUX2CLK_SRC SPC5_CGM_SS_${conf.instance.initialization_settings.clocks.aux2_clock_source.value[0]}
  52. #define SPC5_FLEXCAN_DIVIDER_VALUE ${conf.instance.initialization_settings.clocks.flexcan_clock_divider.value[0]}
  53. #define SPC5_CLOCK_FAILURE_HOOK() ${conf.instance.initialization_settings.clocks.clock_failure_hook.value[0]}
  54. /*
  55. * EDMA driver settings.
  56. */
  57. #define SPC5_EDMA_CR_SETTING (EDMA_CR_GRP1PRI(1) | \
  58. EDMA_CR_GRP0PRI(0) | \
  59. EDMA_CR_EMLM | \
  60. EDMA_CR_ERGA)
  61. #define SPC5_EDMA_GROUP0_PRIORITIES [#rt/]
  62. [#list conf.instance.edma_settings.group_0_channels_priorities.* as channel]
  63. [#if channel_has_next]
  64. ${channel.value[0]}, [#rt/]
  65. [#else]
  66. ${channel.value[0]}
  67. [/#if]
  68. [/#list]
  69. #define SPC5_EDMA_ERROR_IRQ_PRIO 12
  70. #define SPC5_EDMA_ERROR_HANDLER() osalSysHalt("DMA failure")
  71. /*
  72. * PWM driver system settings.
  73. */
  74. [#assign pwm0_all_sm = conf.instance.flexpwm_settings.synchronized_flexpwm0.value[0]?upper_case /]
  75. [#assign pwm1_all_sm = conf.instance.flexpwm_settings.synchronized_flexpwm1.value[0]?upper_case /]
  76. #define SPC5_PWM0_USE_SYNC_SMOD ${pwm0_all_sm}
  77. #define SPC5_PWM1_USE_SYNC_SMOD ${pwm1_all_sm}
  78. #define SPC5_PWM_USE_SMOD0 ${conf.instance.flexpwm_settings.flexpwm0_sm0.value[0]?upper_case}
  79. [#if pwm0_all_sm == "FALSE"]
  80. #define SPC5_PWM_USE_SMOD1 ${conf.instance.flexpwm_settings.flexpwm0_sm1.value[0]?upper_case}
  81. #define SPC5_PWM_USE_SMOD2 ${conf.instance.flexpwm_settings.flexpwm0_sm2.value[0]?upper_case}
  82. #define SPC5_PWM_USE_SMOD3 ${conf.instance.flexpwm_settings.flexpwm0_sm3.value[0]?upper_case}
  83. [#else]
  84. #define SPC5_PWM_USE_SMOD1 TRUE
  85. #define SPC5_PWM_USE_SMOD2 TRUE
  86. #define SPC5_PWM_USE_SMOD3 TRUE
  87. [/#if]
  88. #define SPC5_PWM_SMOD0_PRIORITY ${conf.instance.irq_priority_settings.flexpwm0_sm0.value[0]}
  89. #define SPC5_PWM_SMOD1_PRIORITY ${conf.instance.irq_priority_settings.flexpwm0_sm1.value[0]}
  90. #define SPC5_PWM_SMOD2_PRIORITY ${conf.instance.irq_priority_settings.flexpwm0_sm2.value[0]}
  91. #define SPC5_PWM_SMOD3_PRIORITY ${conf.instance.irq_priority_settings.flexpwm0_sm3.value[0]}
  92. #define SPC5_PWM_USE_SMOD4 ${conf.instance.flexpwm_settings.flexpwm1_sm0.value[0]?upper_case}
  93. [#if pwm1_all_sm == "FALSE"]
  94. #define SPC5_PWM_USE_SMOD5 ${conf.instance.flexpwm_settings.flexpwm1_sm1.value[0]?upper_case}
  95. #define SPC5_PWM_USE_SMOD6 ${conf.instance.flexpwm_settings.flexpwm1_sm2.value[0]?upper_case}
  96. #define SPC5_PWM_USE_SMOD7 ${conf.instance.flexpwm_settings.flexpwm1_sm3.value[0]?upper_case}
  97. [#else]
  98. #define SPC5_PWM_USE_SMOD5 TRUE
  99. #define SPC5_PWM_USE_SMOD6 TRUE
  100. #define SPC5_PWM_USE_SMOD7 TRUE
  101. [/#if]
  102. #define SPC5_PWM_SMOD4_PRIORITY ${conf.instance.irq_priority_settings.flexpwm1_sm0.value[0]}
  103. #define SPC5_PWM_SMOD5_PRIORITY ${conf.instance.irq_priority_settings.flexpwm1_sm1.value[0]}
  104. #define SPC5_PWM_SMOD6_PRIORITY ${conf.instance.irq_priority_settings.flexpwm1_sm2.value[0]}
  105. #define SPC5_PWM_SMOD7_PRIORITY ${conf.instance.irq_priority_settings.flexpwm1_sm3.value[0]}
  106. /*
  107. * ICU driver system settings.
  108. */
  109. #define SPC5_ICU_USE_SMOD0 ${conf.instance.etimer_settings.etimer0_ch0.value[0]?upper_case}
  110. #define SPC5_ICU_USE_SMOD1 ${conf.instance.etimer_settings.etimer0_ch1.value[0]?upper_case}
  111. #define SPC5_ICU_USE_SMOD2 ${conf.instance.etimer_settings.etimer0_ch2.value[0]?upper_case}
  112. #define SPC5_ICU_USE_SMOD3 ${conf.instance.etimer_settings.etimer0_ch3.value[0]?upper_case}
  113. #define SPC5_ICU_USE_SMOD4 ${conf.instance.etimer_settings.etimer0_ch4.value[0]?upper_case}
  114. #define SPC5_ICU_USE_SMOD5 ${conf.instance.etimer_settings.etimer0_ch5.value[0]?upper_case}
  115. #define SPC5_ICU_ETIMER0_PRIORITY ${conf.instance.irq_priority_settings.etimer0.value[0]}
  116. #define SPC5_ICU_USE_SMOD6 ${conf.instance.etimer_settings.etimer1_ch0.value[0]?upper_case}
  117. #define SPC5_ICU_USE_SMOD7 ${conf.instance.etimer_settings.etimer1_ch1.value[0]?upper_case}
  118. #define SPC5_ICU_USE_SMOD8 ${conf.instance.etimer_settings.etimer1_ch2.value[0]?upper_case}
  119. #define SPC5_ICU_USE_SMOD9 ${conf.instance.etimer_settings.etimer1_ch3.value[0]?upper_case}
  120. #define SPC5_ICU_USE_SMOD10 ${conf.instance.etimer_settings.etimer1_ch4.value[0]?upper_case}
  121. #define SPC5_ICU_USE_SMOD11 ${conf.instance.etimer_settings.etimer1_ch5.value[0]?upper_case}
  122. #define SPC5_ICU_ETIMER1_PRIORITY ${conf.instance.irq_priority_settings.etimer1.value[0]}
  123. #define SPC5_ICU_USE_SMOD12 ${conf.instance.etimer_settings.etimer2_ch0.value[0]?upper_case}
  124. #define SPC5_ICU_USE_SMOD13 ${conf.instance.etimer_settings.etimer2_ch1.value[0]?upper_case}
  125. #define SPC5_ICU_USE_SMOD14 ${conf.instance.etimer_settings.etimer2_ch2.value[0]?upper_case}
  126. #define SPC5_ICU_USE_SMOD15 ${conf.instance.etimer_settings.etimer2_ch3.value[0]?upper_case}
  127. #define SPC5_ICU_USE_SMOD16 ${conf.instance.etimer_settings.etimer2_ch4.value[0]?upper_case}
  128. #define SPC5_ICU_USE_SMOD17 ${conf.instance.etimer_settings.etimer2_ch5.value[0]?upper_case}
  129. #define SPC5_ICU_ETIMER2_PRIORITY ${conf.instance.irq_priority_settings.etimer2.value[0]}
  130. /*
  131. * SERIAL driver system settings.
  132. */
  133. #define SPC5_SERIAL_USE_LINFLEX0 ${(conf.instance.linflex_settings.linflex0.value[0] == "Serial")?string?upper_case}
  134. #define SPC5_SERIAL_USE_LINFLEX1 ${(conf.instance.linflex_settings.linflex1.value[0] == "Serial")?string?upper_case}
  135. #define SPC5_SERIAL_LINFLEX0_PRIORITY ${conf.instance.irq_priority_settings.linflex0.value[0]}
  136. #define SPC5_SERIAL_LINFLEX1_PRIORITY ${conf.instance.irq_priority_settings.linflex1.value[0]}
  137. /*
  138. * SPI driver system settings.
  139. */
  140. #define SPC5_SPI_USE_DSPI0 ${conf.instance.dspi_settings.dspi_0.value[0]?upper_case}
  141. #define SPC5_SPI_USE_DSPI1 ${conf.instance.dspi_settings.dspi_1.value[0]?upper_case}
  142. #define SPC5_SPI_USE_DSPI2 ${conf.instance.dspi_settings.dspi_2.value[0]?upper_case}
  143. #define SPC5_SPI_DMA_MODE SPC5_SPI_DMA_${conf.instance.dspi_settings.dma_mode.value[0]?upper_case?replace(" ", "_")}
  144. [#assign s0 = [""," | SPC5_MCR_PCSIS0"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs0[0].@index[0]?trim?number] /]
  145. [#assign s1 = [""," | SPC5_MCR_PCSIS1"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs1[0].@index[0]?trim?number] /]
  146. [#assign s2 = [""," | SPC5_MCR_PCSIS2"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs2[0].@index[0]?trim?number] /]
  147. [#assign s3 = [""," | SPC5_MCR_PCSIS3"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs3[0].@index[0]?trim?number] /]
  148. [#assign s4 = [""," | SPC5_MCR_PCSIS4"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs4[0].@index[0]?trim?number] /]
  149. [#assign s5 = [""," | SPC5_MCR_PCSIS5"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs5[0].@index[0]?trim?number] /]
  150. [#assign s6 = [""," | SPC5_MCR_PCSIS6"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs6[0].@index[0]?trim?number] /]
  151. [#assign s7 = [""," | SPC5_MCR_PCSIS7"][conf.instance.dspi_settings.inactive_states.dspi_0___pcs7[0].@index[0]?trim?number] /]
  152. #define SPC5_SPI_DSPI0_MCR (0${s0 + s1 + s2 + s3 + s4 + s5 + s6 + s7})
  153. [#assign s0 = [""," | SPC5_MCR_PCSIS0"][conf.instance.dspi_settings.inactive_states.dspi_1___pcs0[0].@index[0]?trim?number] /]
  154. [#assign s1 = [""," | SPC5_MCR_PCSIS1"][conf.instance.dspi_settings.inactive_states.dspi_1___pcs1[0].@index[0]?trim?number] /]
  155. [#assign s2 = [""," | SPC5_MCR_PCSIS2"][conf.instance.dspi_settings.inactive_states.dspi_1___pcs2[0].@index[0]?trim?number] /]
  156. [#assign s3 = [""," | SPC5_MCR_PCSIS3"][conf.instance.dspi_settings.inactive_states.dspi_1___pcs3[0].@index[0]?trim?number] /]
  157. #define SPC5_SPI_DSPI1_MCR (0${s0 + s1 + s2 + s3})
  158. [#assign s0 = [""," | SPC5_MCR_PCSIS0"][conf.instance.dspi_settings.inactive_states.dspi_2___pcs0[0].@index[0]?trim?number] /]
  159. [#assign s1 = [""," | SPC5_MCR_PCSIS1"][conf.instance.dspi_settings.inactive_states.dspi_2___pcs1[0].@index[0]?trim?number] /]
  160. [#assign s2 = [""," | SPC5_MCR_PCSIS2"][conf.instance.dspi_settings.inactive_states.dspi_2___pcs2[0].@index[0]?trim?number] /]
  161. [#assign s3 = [""," | SPC5_MCR_PCSIS3"][conf.instance.dspi_settings.inactive_states.dspi_2___pcs3[0].@index[0]?trim?number] /]
  162. #define SPC5_SPI_DSPI2_MCR (0${s0 + s1 + s2 + s3})
  163. #define SPC5_SPI_DSPI0_TX1_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi0_tx1.value[0]}
  164. #define SPC5_SPI_DSPI0_TX2_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi0_tx2.value[0]}
  165. #define SPC5_SPI_DSPI0_RX_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi0_rx.value[0]}
  166. #define SPC5_SPI_DSPI1_TX1_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi1_tx1.value[0]}
  167. #define SPC5_SPI_DSPI1_TX2_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi1_tx2.value[0]}
  168. #define SPC5_SPI_DSPI1_RX_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi1_rx.value[0]}
  169. #define SPC5_SPI_DSPI2_TX1_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi2_tx1.value[0]}
  170. #define SPC5_SPI_DSPI2_TX2_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi2_tx2.value[0]}
  171. #define SPC5_SPI_DSPI2_RX_DMA_CH_ID ${conf.instance.edma_mux_settings.dspi_channels.dspi2_rx.value[0]}
  172. #define SPC5_SPI_DSPI0_DMA_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_0.value[0]}
  173. #define SPC5_SPI_DSPI1_DMA_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_1.value[0]}
  174. #define SPC5_SPI_DSPI2_DMA_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_2.value[0]}
  175. #define SPC5_SPI_DSPI0_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_0.value[0]}
  176. #define SPC5_SPI_DSPI1_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_1.value[0]}
  177. #define SPC5_SPI_DSPI2_IRQ_PRIO ${conf.instance.irq_priority_settings.dspi_2.value[0]}
  178. #define SPC5_SPI_DMA_ERROR_HOOK(spip) ${conf.instance.dspi_settings.dma_error_hook.value[0]}
  179. /*
  180. * CAN driver system settings.
  181. */
  182. #define SPC5_CAN_USE_FILTERS ${conf.instance.flexcan_settings.flexcan_enable_filters.value[0]?upper_case}
  183. #define SPC5_CAN_USE_FLEXCAN0 ${conf.instance.flexcan_settings.flexcan0.value[0]?upper_case}
  184. #define SPC5_CAN_FLEXCAN0_USE_EXT_CLK ${conf.instance.flexcan_settings.flexcan0_use_external_clock.value[0]?upper_case}
  185. #define SPC5_CAN_FLEXCAN0_IRQ_PRIORITY ${conf.instance.irq_priority_settings.flexcan0.value[0]}
  186. #define SPC5_CAN_NUM_RX_MAILBOXES ${conf.instance.flexcan_settings.can_configurations.mailboxes_configuration.number_of_rx_mailboxes.value[0]}
  187. #define SPC5_CAN_NUM_TX_MAILBOXES ${conf.instance.flexcan_settings.can_configurations.mailboxes_configuration.number_of_tx_mailboxes.value[0]}
  188. #define SPC5_CAN_FLEXCAN0_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  189. SPC5_ME_PCTL_LP(2))
  190. #define SPC5_CAN_FLEXCAN0_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  191. SPC5_ME_PCTL_LP(0))
  192. #define SPC5_CAN_USE_FLEXCAN1 ${conf.instance.flexcan_settings.flexcan1.value[0]?upper_case}
  193. #define SPC5_CAN_FLEXCAN1_USE_EXT_CLK ${conf.instance.flexcan_settings.flexcan1_use_external_clock.value[0]?upper_case}
  194. #define SPC5_CAN_FLEXCAN1_IRQ_PRIORITY ${conf.instance.irq_priority_settings.flexcan1.value[0]}
  195. #define SPC5_CAN_FLEXCAN1_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  196. SPC5_ME_PCTL_LP(2))
  197. #define SPC5_CAN_FLEXCAN1_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  198. SPC5_ME_PCTL_LP(0))
  199. #define SPC5_CAN_USE_FLEXCAN2 ${conf.instance.flexcan_settings.flexcan2.value[0]?upper_case}
  200. #define SPC5_CAN_FLEXCAN2_USE_EXT_CLK ${conf.instance.flexcan_settings.flexcan2_use_external_clock.value[0]?upper_case}
  201. #define SPC5_CAN_FLEXCAN2_IRQ_PRIORITY ${conf.instance.irq_priority_settings.flexcan2.value[0]}
  202. #define SPC5_CAN_FLEXCAN2_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  203. SPC5_ME_PCTL_LP(2))
  204. #define SPC5_CAN_FLEXCAN2_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  205. SPC5_ME_PCTL_LP(0))
  206. /*
  207. * ADC driver system settings.
  208. */
  209. [#if conf.instance.adc_settings.adc0_clock_divider.value[0] == "Peripheral clock frequency"]
  210. [#assign clk_f0 = "PERIPHERAL_SET_CLOCK_FREQUENCY"]
  211. [#else]
  212. [#assign clk_f0 = "HALF_PERIPHERAL_SET_CLOCK_FREQUENCY"]
  213. [/#if]
  214. [#if conf.instance.adc_settings.dma_mode.value[0] == "true" ]
  215. [#assign dma_mode = "SPC5_ADC_DMA_ON"]
  216. [#else]
  217. [#assign dma_mode = "SPC5_ADC_DMA_OFF"]
  218. [/#if]
  219. #define SPC5_ADC_DMA_MODE ${dma_mode}
  220. #define SPC5_ADC_USE_ADC0 ${conf.instance.adc_settings.adc0.value[0]?upper_case}
  221. #define SPC5_ADC_ADC0_CLK_FREQUENCY ${clk_f0}
  222. #define SPC5_ADC_ADC0_AUTO_CLOCK_OFF ${conf.instance.adc_settings.adc0_auto_clock_off_mode.value[0]?upper_case}
  223. #define SPC5_ADC_ADC0_WD_PRIORITY ${conf.instance.irq_priority_settings.adc0.value[0]}
  224. #define SPC5_ADC_ADC0_EOC_PRIORITY SPC5_ADC_ADC0_WD_PRIORITY
  225. #define SPC5_ADC_ADC0_DMA_CH_ID ${conf.instance.edma_mux_settings.adc_channels.adc0.value[0]}
  226. #define SPC5_ADC_ADC0_DMA_IRQ_PRIO ${conf.instance.irq_priority_settings.adc0.value[0]}
  227. #define SPC5_ADC_ADC0_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  228. SPC5_ME_PCTL_LP(2))
  229. #define SPC5_ADC_ADC0_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  230. SPC5_ME_PCTL_LP(0))
  231. [#if conf.instance.adc_settings.adc1_clock_divider.value[0] == "Peripheral clock frequency"]
  232. [#assign clk_f1 = "PERIPHERAL_SET_CLOCK_FREQUENCY"]
  233. [#else]
  234. [#assign clk_f1 = "HALF_PERIPHERAL_SET_CLOCK_FREQUENCY"]
  235. [/#if]
  236. #define SPC5_ADC_USE_ADC1 ${conf.instance.adc_settings.adc1.value[0]?upper_case}
  237. #define SPC5_ADC_ADC1_CLK_FREQUENCY ${clk_f1}
  238. #define SPC5_ADC_ADC1_AUTO_CLOCK_OFF ${conf.instance.adc_settings.adc1_auto_clock_off_mode.value[0]?upper_case}
  239. #define SPC5_ADC_ADC1_WD_PRIORITY ${conf.instance.irq_priority_settings.adc1.value[0]}
  240. #define SPC5_ADC_ADC1_EOC_PRIORITY SPC5_ADC_ADC1_WD_PRIORITY
  241. #define SPC5_ADC_ADC1_DMA_CH_ID ${conf.instance.edma_mux_settings.adc_channels.adc1.value[0]}
  242. #define SPC5_ADC_ADC1_DMA_IRQ_PRIO ${conf.instance.irq_priority_settings.adc1.value[0]}
  243. #define SPC5_ADC_ADC1_START_PCTL (SPC5_ME_PCTL_RUN(1) | \
  244. SPC5_ME_PCTL_LP(2))
  245. #define SPC5_ADC_ADC1_STOP_PCTL (SPC5_ME_PCTL_RUN(0) | \
  246. SPC5_ME_PCTL_LP(0))
  247. #endif /* _MCUCONF_H_ */